Skip to content

Instantly share code, notes, and snippets.

@eduard93
Created December 2, 2015 17:24
Show Gist options
  • Save eduard93/de0dc2043e02e113bc8c to your computer and use it in GitHub Desktop.
Save eduard93/de0dc2043e02e113bc8c to your computer and use it in GitHub Desktop.
%SQL.CustomResultSet example for InterSystems Caché
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2015.1.1 (Build 505U)" ts="2015-12-02 20:23:32">
<Class name="Utils.CustomQueryRS">
<Super>%SQL.CustomResultSet</Super>
<TimeChanged>63888,71332.597734</TimeChanged>
<TimeCreated>63888,69965.290043</TimeCreated>
<Property name="Id">
<Type>%String</Type>
</Property>
<Property name="Prop1">
<Type>%String</Type>
</Property>
<Property name="Prop2">
<Type>%Integer</Type>
</Property>
<Method name="%OpenCursor">
<ReturnType>%Library.Status</ReturnType>
<Implementation><![CDATA[
Set ..Id = ""
Quit $$$OK
]]></Implementation>
</Method>
<Method name="%Next">
<FormalSpec><![CDATA[&sc:%Library.Status]]></FormalSpec>
<PlaceAfter>%Execute</PlaceAfter>
<ReturnType>%Library.Integer</ReturnType>
<Implementation><![CDATA[
Set sc = $$$OK
Set ..Id = $Order(^Utils.CustomQueryD(..Id),1,val)
Quit:..Id="" 0
Set ..Prop1 = $Lg(val,2)
Set ..Prop2 = $Lg(val,3)
Quit $$$OK
]]></Implementation>
</Method>
<Method name="Test">
<Description>
Do ##class(Utils.CustomQueryRS).Test()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
Set resultset=..%New()
Do resultset.%Display()
]]></Implementation>
</Method>
</Class>
</Export>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment