on ‎2014 May 22 9:40 PM
I found in sa 11 isql, it's a lot easier to use exec dba.procname parmlist then the call ( parmlist) just curious why should on use call instead of exec besides the possibliility of use some expression in call parmlist. of course in sub query in call unless sa 16
Request clarification before answering.
The missing ';' aspect of this has more to do with the SQL Dialect differences than it does have with this being a stored procedure call (uh 'exec').
By using
EXEC <sproc_name> . . . .
the SQL parsers involved sees the 'EXEC' token and identifies the SQL dialect as being Transact-SQL. From that point on the parser must determine the "end of statement" boundaries based solely by the T/SQL dialect-specific syntax of the statement types involved.
Transact-SQL is different in many aspects from Standard SQL (and SQL Anywhere specifically) but for this question it does not require the use of semi-colons. And the is the sole source of the
perceived *'easy of use'* you mention.
So, in short, it is not a case of one being better than the other. The two uses belong to different SQL dialects and those just have different syntactical requirements.
The use of ';' as a statement delimiter is normal with SQL Anywhere and an easy convention to follow once adopted. You can avoid it if you restrict yourself to just T/SQL valid statements, and that only provides a sub-set of functionality.
Beyond this simple explanation this topic does overlap the concept of SQL Batches which I will not go into here but you should probably visit the topic to flesh out the concepts there for yourself.
HTH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use of ; is not much of problem for using sa but then we will be locked in sa by making migration more difficult. with the sap, we don't seem to valued as we don't buy anything directly ourselves from sap although we help our client to buy licenses.
our sybase developer accounts have not been migrated to sap and seem to be stuck in a limbo.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.