sqlexec parameters input / output
Posted: Fri Jun 11, 2021 3:10 pm
good morning Forum
In FoxPro you can pass parameters in a sqlexec function like the next example cutted and pasted from VFP9 help on line.
Are there any equivalent support in xsharp? I recognice that it's related with sql driver and all are diferents but particulary is usefull in sql server.
You can do something like this too:
In FoxPro you can pass parameters in a sqlexec function like the next example cutted and pasted from VFP9 help on line.
Are there any equivalent support in xsharp? I recognice that it's related with sql driver and all are diferents but particulary is usefull in sql server.
Code: Select all
* Execute stored procedure with an INPUT parameter.
SQLEXEC(m.lnConn, 'exec byroyalty ?lnPercent','HalfOffAuthors')
* Create temp stored procedure with OUTPUT parameter and call it.
SQLEXEC(m.lnConn, "CREATE PROCEDURE #MyProc @outparam int OUTPUT AS;
SELECT @outparam=100")
SQLEXEC(m.lnConn, "exec #myProc ?@lnOutput")
? m.lnOutput
* Create a temp stored procedure with INPUT and OUTPUT parameters
* and call it.
SQLEXEC(m.lnConn, "CREATE PROCEDURE #MyProc2 " + ;
"@inputparam INT, " + ;
"@outparam int OUTPUT " + ;
"AS SET @outparam=@inputparam*10")
SQLEXEC(m.lnConn, "exec #myProc2 ?lnPercent, ?@lnOutput")
? m.lnOutput
Code: Select all
sqlexec(x, "select * from table where key= ?(LocalAlias.field)")