OCLOperators Sqlpassthrough
Peter Mugabe (talk | contribs) (Created page with "SomeClass.sqlpassthrough('SqlExpression',Type1OfTupleResult,Type2OfTupleResult,...) Example of how the OCL look like to call a stored procedure Anvandare.sqlpassthrough('sp_...") |
(Automatically adding template at the end of the page.) |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
SomeClass.sqlpassthrough('SqlExpression',Type1OfTupleResult,Type2OfTupleResult,...) | SomeClass.sqlpassthrough('SqlExpression',Type1OfTupleResult,Type2OfTupleResult,...) | ||
Example of how the OCL | '''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 + ', \<nowiki>''</nowiki> + self.Anvandarnamn + '\', @aNyttLosenord', Int32) | Anvandare.sqlpassthrough('sp_Upd_Losen ' + self.AnvId.asString + ', \<nowiki>''</nowiki> + self.Anvandarnamn + '\', @aNyttLosenord', Int32) | ||
Notes | Notes: | ||
* @aNyttLosenord here is automatically available because it's a variable available when the function is called | * @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]]) | * 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 | * Int32 at the end is the SQL server return code | ||
* Your expression starts with a '''class''' not an object | * 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]]" | 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]]" | ||
The return value is a [[Tuple|Tuple.]] | |||
Also look | Also, look here: [[OCLOperators sqlpassthroughobjects]], [[OCLOperators PSEval|PSEval]], [[OCLOperators PSEvalValue|PSEvalValue]], [[OCLOperators PSEvalTuples|PSEvalTuples]] | ||
[[Category:OCL General Operators]] | |||
{{Edited|July|12|2024}} |
Latest revision as of 15:40, 10 February 2024
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"
The return value is a Tuple.
Also, look here: OCLOperators sqlpassthroughobjects, PSEval, PSEvalValue, PSEvalTuples
This page was edited more than 11 months ago on 02/10/2024. What links here