OCLOperators sqlpassthroughobjects
No edit summary
No edit summary
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
===Example of using the sqlpassthroughobjects===
<message>Write the content here to display this box</message>
The two examples below can be used in a derived association
===Examples of how to use the sqlpassthroughobjects===
=====If you already have the primary key available to can to like this=====
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
  Kundfaktura.sqlpassthroughobjects('select ' + self.FakturaReferensnummer.toString )->first
=====If looking for a specific object using some field=====
=====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
  Kundfaktura.sqlpassthroughobjects('select FAKTURA_ID from tbl_FAKTUROR where FAKTURA_ID = ' + self.FakturaReferensnummer.toString )->first
[[Category:OCLOperators]]
 
===== 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 ([[Documentation:Escape codes|Escape codes]]).
[[Category:OCL General Operators]]
{{Edited|July|12|2025}}

Latest revision as of 05:42, 23 January 2025

This page was created by Lars.olofsson@mdriven.net on 2018-04-02. Last edited by Stephanie@mdriven.net on 2025-01-23.

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).
MDriven Chat

How would you like to chat today?

Setting up your conversation…

This may take a few moments