atpeace Novice
Joined: 26 Jan 2009 Posts: 32
|
Posted: Tue Jan 27, 2009 1:29 am
#Query Code for the interested. |
Having a rather painful time to get a dB Query to actually return what I want I thought I would re-share a sort of solution :
<func name="DBQUERY" type="Literal" id="894">
<value>#LOCAL $Result
#DBOFFLINE
#DBLOAD $Database
#DBFIRST
#VIEW $View
#DBFIRST
$Query=~"~($Query~)~"
#EXEC {#QUERY {$Query} {} {1}}
#DBFIRST
$Result = %rec
#ECHO %rec
#DBONLINE
#RETURN $Result</value>
<arglist>$Database,$View,$Query</arglist>
</func>
Fed By This Call Format and it's hard on the eyes:
@DBQUERY(Actions, ToDo, {~&FieldName=~"~"$LocalVariable~"~"})
Or in a more advanced and rather specific to my application:
@DBQUERY(Actions, ToDo, {(~&Name=~"~"$AddActionTemp.Name~"~")~&~&(~&Pram=~"~"$AddActionTemp.Pram~"~")~&~&(~&BalReq=~"~"$AddActionTemp.BalReq~"~")})
@DBQUERY with return null or a %rec of the first match. You could put in a loop in the query function to produce record numbers stringlists or whatever you wanted. |
|