on 2014 Jan 15 3:49 PM
What are the main differences between EXECUTE
and EXECUTE IMMEDITATE
statements?
For example with this dynamic SQL:
EXECUTE ('SELECT * FROM ' || sometable ||' ORDER BY somecol'); EXECUTE IMMEDITATE ('SELECT * FROM ' || sometable ||' ORDER BY somecol');
Request clarification before answering.
The basic difference between the two is that EXECUTE IMMEDIATE is WATCOM SQL and EXECUTE is TSQL. Both statements will parse a string and execute the statement(s) contained within. Each statement has different options - see the documentation for details - but other than that they are the same. Which one you use is likely more dependent on whether you are writing your procedural code using WATCOM SQL dialect or TSQL dialect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To help with understanding syntax that is Watcom vs TSQL, the documentation provides statement applicability indicators to identify where a statement can be used. See the following for additional information:
http://dcx.sybase.com/index.html#sa160/en/dbreference/statement-applicabilityusing-wsqlstmt.html
User | Count |
---|---|
50 | |
9 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.