• IBM Data Studio - SQL script

    From SANDRO HAIDEN TEIXEIRA@21:1/5 to All on Sat Aug 11 18:59:22 2018
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joachim Tuchel@21:1/5 to All on Sun Aug 12 09:50:20 2018
    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



    Am Sonntag, 12. August 2018 03:59:24 UTC+2 schrieb 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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mikeodba@yahoo.com@21:1/5 to SANDRO HAIDEN TEIXEIRA on Thu Sep 27 02:01:40 2018
    On Sunday, 12 August 2018 02:59:24 UTC+1, SANDRO HAIDEN TEIXEIRA wrote:
    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.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter H. Coffin@21:1/5 to mikeodba@yahoo.com on Thu Sep 27 10:10:00 2018
    On Thu, 27 Sep 2018 02:01:40 -0700 (PDT), mikeodba@yahoo.com wrote:

    On Sunday, 12 August 2018 02:59:24 UTC+1, SANDRO HAIDEN TEIXEIRA
    wrote:

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)