cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

difference in exec vs call storeproc?

Former Member
0 Likes
14,744

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

View Entire Topic
Former Member

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

Former Member
0 Likes

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.

VolkerBarth
Contributor
0 Likes

Your experienced problems with the Sybase/SAP migration (which certainly are not uncommon, sadly) seem not to be related to that question so I would recommend to ask that as a different question (or perhaps better: to call your sales rep...).