db2 script: how to comment if I want to run the whole script at once with multiple statements? -


i have lots of sql statements in db2 , i'm putting in script , using query tool run commands after highlighting sql statements.

my comments so:

/* comments */ however, query tool complains of following:

sql0198n statement string of prepare or execute immediate statement blank or empty. sqlstate=42617

i've tried using dash dash. same issue. remember taking mysql class before , able submit full scripts instructor grade.

someone else having same issue: http://www.dbforums.com/showthread.php?1118891-how-do-i-put-comment-in-db2-udb-7-2

put sql statements inside file called script.sql

 -- sample comment  -- create nation table   create table "tpcd    "."nation"  (       "n_nationkey" integer not null ,        "n_name" char(25) not null ,        "n_regionkey" integer not null ,        "n_comment" varchar(152) not null );    

then log instance user command line:

 su - db2inst1 

and run script.sql

 db2 -tvf script.sql 

please try , see if works.


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -