Have you Read the Clarion Help - MSSQL Acc - Using Embedded Code?
I normally create a Dummy Table in MS-SQL and then create a view on that table and execute the SQL command on the view.
The way to execute is to use PROP:SQL.
SQLView VIEW(DummyFile)
....
END
Param1 string(30)
Param2 long
RetVal LONG
STORED PROCEDURE with Parameters Passed :
SQLView{PROP:SQL} = 'CALL dbo.store_proc_name (<39>' & CLIP(Param1) & '<39>, ' & Param2 & ')'
STORED PROCEDURE with Parameters Passed with Return Value:
BIND('RetVal',RetVal)
SQLView{PROP:SQL} = '&RetVal = CALL dbo.store_proc_name (<39>' & CLIP(Param1) & '<39>, ' & Param2 & ')'
UNBIND('RetVal')
STORED PROCEDURE with Parameters Passed with Return Value & OUTPUT Parameter (Param1):
BIND('RetVal',RetVal)
BIND('Param1',Param1)
SQLView{PROP:SQL} = '&RetVal = CALL dbo.store_proc_name ( &Param1, ' & Param2 & ')'
UNBIND('RetVal')
UNBIND('Param1')