#269 SQLTool.jar and auto.sql

closed
nobody
tools (21)
5
2011-09-23
2011-09-02
No

Per description at:

https://sourceforge.net/projects/hsqldb/forums/forum/73674/topic/4687415

When using SQLTool.jar ( this is SqlTool v. 4141, but, I think with HSQL 1.8 too ) interactively, the documentation indicates it will execute the statements in user's home directory .. . file . . . auto.sql .

However, if I define a few commands, such as, * *DSV_COL_DELIM = \t . . . immediately after starting SQLTool.jar, issuing * listvalue will correctly display the values from auto.sql. BUT, it seems that they are NOT recognised by SQLTool.jar until another interactive value is assigned . . . for example, * *BOGUS_COMMAND =

Discussion

  • Sliderule Smith

    Sliderule Smith - 2011-09-02

    Just an additional note. According to SQLTool documentation ( $Revision: 3539 $ ) . . .

    \i path/to/script.sql

    execute the specified SQL script, then continue again interactively. Since SqlTool is a Java program, You can safely use forward slashes in your file paths, regardless of your operating system.

    The same situation described above for an auto.sql file OCCURS when issuing another .sql file interactively with a \i command.

    That is, the system does not have the values available for use, until another PL is issued interactively . . . such as:

    * *BOGUS_COMMAND =

    Sliderule

     
  • Blaine Simpson

    Blaine Simpson - 2011-09-23

    Note that the documented requirement simply requires that you add

    *

    at the top of your input stream. This does not harm portability, since your input is already SqlTool-specific if it contains variable references that you want expanded.

     
  • Blaine Simpson

    Blaine Simpson - 2011-09-23
    • status: open --> closed
     
  • Blaine Simpson

    Blaine Simpson - 2011-09-30

    Have improved consistency of variable scope.
    The set of user variables is global, regardless of whether set in auto.sql, a previous SQL file on command line, or a nested \i file. Once set, variables can now always be used with the *{x} construct.
    Remember that auto.sql is only executed if SqlTool is run interactively.
    There are some contexts where SqlTool will not attempt to dereference references like *{x}: All : commands but one, SQL if no user variables have been set (this excludes system *y variables).
    Whether special * variables perform their function is a different subject covered by tracker 3413413.

     
  • Sliderule Smith

    Sliderule Smith - 2011-09-30

    In your comment below, you said:

    -- The set of user variables is global, regardless of whether set in
    -- auto.sql, a previous SQL file on command line, or a nested \i file. Once
    -- set, variables can now always be used with the *{x} construct.

    Based on your words, thank-you, that is what I was 'commenting and requested' about. It was just that, based on the documentation, that was my expectation. Again, thanks for the response.

    Also, just as an FYI . . . I sometimes do use the HTML output capabilities of SQLTOOL. I think you recently commented that you did not know if anyone was using it. I do, after reading about it.

    SQLTOOL is a fantastic tool, and, easy to use against a multitude of database engines.

    Sliderule

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks