stored procedure %SYSTEM.SQL_TableExists
"SELECT %SYSTEM.SQL_TableExists('table name') "could work as expected under SQL shell,
but for "CALL %SYSTEM.SQL_TableExists('table name')" does not work (not any error reported, it just show nothing).
Is there any reason why CALL could not be applied to a stored procedure?
Thanks.
Discussion (7)0
Comments
?=CALL %SYSTEM.SQL_TableExists('table name')Thanks for minus. My legs more will not be here.
SAMPLES>d $system.SQL.Shell() SQL Command Line Shell ---------------------------------------------------- The command prefix is currently set to: <>. Enter q to quit, ? for help. SAMPLES>>?=CALL %SYSTEM.SQL_TableExists('Sample.Person') 1. ?=CALL %SYSTEM.SQL_TableExists('Sample.Person') executing statement with parameter values: set %tResult=%tStatement.%Execute() Output Values: 0. 1 statement prepare time(s)/globals/lines/disk: 0.0025s/14/862/0ms execute time(s)/globals/lines/disk: 0.0003s/7/179/0ms cached query class: %sqlcq.SAMPLES.cls2 --------------------------------------------------------------------------- SAMPLES>>
Kyle, please notice that indeed
CALL %SYSTEM.SQL_TableExists('table name')
shows nothing -- no result is returned.
Whereas
?= CALL %SYSTEM.SQL_TableExists('table name')
prints boolean result 1 or 0 depending on whether 'table name' exists.
Works for me:
[SQL]SAMPLES>>CALL %SYSTEM.SQL_TableExists('table name')
1. CALL %SYSTEM.SQL_TableExists('table name')
statement prepare time(s)/globals/lines/disk: 0.0398s/1847/15479/4ms
execute time(s)/globals/lines/disk: 0.0007s/7/159/0ms
cached query class: %sqlcq.SAMPLES.cls8So I don't know what Vitaliy is on about. What's your version?
if "ReturnResultsets" specified in the SqlProc definittion,
could I just directly use "call SqlProcName" instead of "? = call SlqProcName" ?
Yes.