patternMinor
what is the formal statement terminator with db2 sql
Viewed 0 times
thewhatstatementwithformalsqlterminatordb2
Problem
I have added
error. I could resolve this issue by changing statement terminator character from
My question is should I keep statement terminator character as
/ character as statement terminator all in my db2 statements. I can run sql file in data studio client without any issue. But when I run the sql file in db2 command prompt by issuing db2 -tsvf db2.sql command I got DB21007E End of file reached while reading the command.error. I could resolve this issue by changing statement terminator character from
/ to ;. My question is should I keep statement terminator character as
/ or ;? If I keep /, is there any way to run sql file from command line also?Solution
You would need to use the
This would tell DB2 that your statement terminator is the
-td syntax. So you would need to format the above as follows:db2 -td/ -svf db2.sqlThis would tell DB2 that your statement terminator is the
/ character, otherwise, yes the default is the semicolon ;.Code Snippets
db2 -td/ -svf db2.sqlContext
StackExchange Database Administrators Q#122652, answer score: 6
Revisions (0)
No revisions yet.