OCLOperators sqlpassthroughobjects
No edit summary
(Replacing message template with parser tag)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<message>Write the content here to display this box</message>
===Examples of how to use the sqlpassthroughobjects===
===Examples of how to use the sqlpassthroughobjects===
The two examples below can be used in a derived association.
The two examples below can be used in a derived association.
Line 10: Line 11:
* 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]]).
[[Category:OCL General Operators]]
[[Category:OCL General Operators]]
{{Edited|July|12|2024}}

Latest revision as of 07:52, 17 June 2024

Examples of how to use the sqlpassthroughobjects

The two examples below can be used in a derived association.

If you already have the primary key available, you can do this:
Kundfaktura.sqlpassthroughobjects('select ' + self.FakturaReferensnummer.toString )->first
If you are looking for a specific object using some field:
Kundfaktura.sqlpassthroughobjects('select FAKTURA_ID from tbl_FAKTUROR where FAKTURA_ID = ' + self.FakturaReferensnummer.toString )->first
   

Notes:

  • You can use @variable in your SQL because it is an automatically available variable 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).
This page was edited 94 days ago on 06/17/2024. What links here