Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I am passing a variable to a

Status
Not open for further replies.

rummage

MIS
Apr 8, 2003
33
US
Hi,

I am passing a variable to a SQL Server store procedure. I am getting a syntax error at the EX statment. What could be the reason?


The code is the following

SQL SQLMSS

-DEFAULT &SESSIONGUID = 40709297-9D5F-4D26-BF76-9159F0D664D9
EX GOA01_SQL.dbo.spgoa_GetSummaryDataA '&SESSIONGUID',0;
TABLE FILE SQLOUT
PRINT *
END



Thanks in advance
 
I saw this question in many places. The problem is that a focexec cannot be more than 80 chars. Even when you use a
Dialogue Manager variable it still substitutes the value in the focexec prior to execution. Try this :

-SET &ECHO=ALL;
SQL SQLMSS
EX GOA01_SQL.dbo.spgoa_GetSummaryDataA
'40709297-9D5F-4D26-BF76-9159F0D664D9'
,0;
TABLE FILE SQLOUT
PRINT *
END

You can break up the Stored Proc call on mutliple lines
it looks for the ; to terminate.

The -SET &ECHO=ALL; will allow you to type in view source
code from the browser and you will see the focexec and the
Dialogue Manager commands if you desire. -SET &ECHO=ALL; is a good debugging tool. After debugging you can leave it in but comment it out with -* SET ECHO=ALL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top