OCLOperators Sqlpassthrough
No edit summary
No edit summary
Line 13: Line 13:
A use case and examples of using sqlPassThrough can be found here "[[PSExpression , or how to do things in the DB from MDriven|PSExpression, or how to do things in the DB from MDriven]]"
A use case and examples of using sqlPassThrough can be found here "[[PSExpression , or how to do things in the DB from MDriven|PSExpression, or how to do things in the DB from MDriven]]"


Also, look here: [[OCLOperators sqlpassthroughobjects]]
Also, look here: [[OCLOperators sqlpassthroughobjects]], [[OCLOperators PSEval|PSEval]], [[OCLOperators PSEvalValue|PSEvalValue]], [[PSEvalTuples]]
[[Category:OCL General Operators]]
[[Category:OCL General Operators]]

Revision as of 10:00, 5 June 2023

SomeClass.sqlpassthrough('SqlExpression',Type1OfTupleResult,Type2OfTupleResult,...)

Note: There is also the operator, OCLOperators PSEval, that uses OCL instead of SQL.

Example of how the OCL looks like to call a stored procedure:

Anvandare.sqlpassthrough('sp_Upd_Losen ' + self.AnvId.asString + ', \'' + self.Anvandarnamn + '\', @aNyttLosenord', Int32) 

Notes:

  • @aNyttLosenord here is automatically available because it's a variable available when the function is called
  • You need to quote strings to be passed (if they aren't variables), like self.Anvandarnamn above. The \' is an escaped quote in OCL (Escape codes)
  • Int32 at the end is the SQL server return code
  • Your expression starts with a class, not an object

A use case and examples of using sqlPassThrough can be found here "PSExpression, or how to do things in the DB from MDriven"

Also, look here: OCLOperators sqlpassthroughobjects, PSEval, PSEvalValue, PSEvalTuples

This page was edited 87 days ago on 02/10/2024. What links here