Menu

#2 inline SQL statements don't always work the same as SQLPLUS

General
open-fixed
General (2)
5
2008-10-16
2008-10-08
Anonymous
No

I really like what you’ve done with incanto. I’m trying to use it as part of a packaging and deployment mechanism. I’ve found what I think are a couple of minor bugs/anomolies that I hope you can sort out.

1) It seems that inline SQL statements that have whitespace at the beginning of the line cause them to fail. If I store these in a separate SQL file and call that it works.

2) I like to use the “dot” command to escape the edit/entry within SQLPLUS followed immediately by the LIST command and forward slash “/” on separate lines.

e.g.
alter session set NLS_DATE_FORMAT = “HH24:MI:SS DD.MM.YYYY”
.
LIST
/

This allows me to have a detailed listing of what statements I want to execute followed by the result messages from SQLPLUS. I like to do this because a spooled log then becomes my documentation of the installation.

Again, this does not seem to work with inline sql statements and I have to use external SQL files. My peference is do everything inline so that I could generate one big build file via a perl DBI script that extracts code from either a CVS repository or the database itself.

I’m hoping you can address these two small issues?

Thanks in advance,
Joe

Discussion

  • Alexander Karnstedt

    http://www.adp-gmbh.ch/ora/sqlplus/dot.html

    "The dot (.), if entered as first character on the line and possibly followed by whitespaces, ends inputting lines to the buffer."

    Seems that period MUST be the first character on the line. However as I understand (IMHO) that SQL*Plus feature you can also insert an empty line which has the same effect as the period (.) instead you wont have these leading whitespace issue.

    Works:

    <![CDATA[
    alter session set NLS_DATE_FORMAT = "HH24:MI:SS DD.MM.YYYY"

    LIST
    /
    ]]>

     
  • Alexander Karnstedt

    • assigned_to: nobody --> alexrk
     
  • Alexander Karnstedt

    Works too (with period at the beginning):

    <![CDATA[
    alter session set NLS_DATE_FORMAT = "HH24:MI:SS DD.MM.YYYY"
    .
    LIST
    /
    ]]>

    Works NOT:

    <![CDATA[
    alter session set NLS_DATE_FORMAT = "HH24:MI:SS DD.MM.YYYY"
    .
    LIST
    /
    ]]>

     
  • Alexander Karnstedt

    proposed workaround: use blank lines instead of periods (.)

     
  • Alexander Karnstedt

    • status: open --> open-fixed
     

Log in to post a comment.