Discussion:
IBM Data Studio - SQL script
(too old to reply)
SANDRO HAIDEN TEIXEIRA
2018-08-12 01:59:22 UTC
Permalink
Regarding IBM Data Studio 4.1.3 Client, do I really need to be connected to a database in order to run an sql script?

Because when I want to create another database through the script, Data Studio requires me to connect to a database. Is there any way to disable this requirement?

grateful for the attention.
Joachim Tuchel
2018-08-12 16:50:20 UTC
Permalink
There is not much point in issueing an SQL statement "into the universe". You need a table to select/insert/delete/update from/into (DML) or a database to make any changes to (DDL).

The few exceptions that come to mind are create and/or drop database, force application or start/stop DBM. In Data Studio, you can do that visually in the left pane, but afaik not per SQL script. You still need to be talking to an existing DB Server or Instance.

Joachim
Post by SANDRO HAIDEN TEIXEIRA
Regarding IBM Data Studio 4.1.3 Client, do I really need to be connected to a database in order to run an sql script?
Because when I want to create another database through the script, Data Studio requires me to connect to a database. Is there any way to disable this requirement?
grateful for the attention.
m***@yahoo.com
2018-09-27 09:01:40 UTC
Permalink
Post by SANDRO HAIDEN TEIXEIRA
Regarding IBM Data Studio 4.1.3 Client, do I really need to be connected to a database in order to run an sql script?
Because when I want to create another database through the script, Data Studio requires me to connect to a database. Is there any way to disable this requirement?
grateful for the attention.
If you are a competent scripter, you do not need to use DataStudio to run an SQL script. If the script contains only SQL, it requires a database-connection (which you can create outside of the script if you know what you are doing). If the script contains *commands* (i.e. NOT SQL) then some commands do not need a pre-existing database connection (such as create database, drop database, backup database etc.). For those kinds of scripts , DataStudio may not be the correct tool for the job.
Peter H. Coffin
2018-09-27 15:10:00 UTC
Permalink
On Sunday, 12 August 2018 02:59:24 UTC+1, SANDRO HAIDEN TEIXEIRA
Post by SANDRO HAIDEN TEIXEIRA
Regarding IBM Data Studio 4.1.3 Client, do I really need to be
connected to a database in order to run an sql script?
Because when I want to create another database through the script,
Data Studio requires me to connect to a database. Is there any way to
disable this requirement?
grateful for the attention.
If you are a competent scripter, you do not need to use DataStudio
to run an SQL script. If the script contains only SQL, it requires a
database-connection (which you can create outside of the script if you
know what you are doing). If the script contains *commands* (i.e. NOT
SQL) then some commands do not need a pre-existing database connection
(such as create database, drop database, backup database etc.). For
those kinds of scripts , DataStudio may not be the correct tool for
the job.
Data Studio knows how to do things like "start dbm remote hostname
<address> user <user> using <password>", so there's quite a lot it can
do as long as the remote system is at least fully booted and properly
configured, so I don't see why a script counldn't also. It's just very
insistant about having a database connection DEFINED before it lets you
get to the meat of the tool. But you don't have to be connected yet. You
can, for example, define the connection you want to run Data Studio to
eventually, then (before actually opening the connection), start the
database manager instance, create the target database there, THEN twist
open the actual connection you defined earlier.
--
26. No matter how attractive certain members of the rebellion are,
there is probably someone just as attractive who is not desperate to
kill me. Therefore, I will think twice before ordering a prisoner
sent to my bedchamber. --Peter Anspach's Evil Overlord list
Loading...