DB Query and Fetching
Posted: Sun Apr 11, 2010 11:01 am
Hi Guys,
I am trying to fetch some data from a db to my wf given a list of variable names from a group. The problem I have is with the lack of db query function via command line. Let me give you a short example of what I am trying to accomplish:
I think this could be done in either of the two ways I have in mind: 1. the "if" case above, or 2. some sort of error handling, something along the line as:
My psuedo codes above may be wrong; if you find something funny with the while loop or the for loop, forgive me. But I just really want to see how I could do the query in a program just as the gui alternative. Please let me know. Thanks.
Tchaithonov
I am trying to fetch some data from a db to my wf given a list of variable names from a group. The problem I have is with the lack of db query function via command line. Let me give you a short example of what I am trying to accomplish:
Code: Select all
' group name: group1, containing !n variables
for !i = 1 to !n
!j = 0
%var = group1.@seriesname(!i)
%rawvar = left(%var, @len(%var) - 3) ' I have a suffix for the transformed variables (%var) in the group that is 3-char long
while !j <> 1
' ALGORITHM: if @...(%rawvar) = 1 then 'something similar to @isobject, but for database
fetch(link) db::{%rawvar}
!j = 1
else
@uiedit(%var, "Please enter the correct raw variable name.", 24)
!j = 0
endif
wend
next
Code: Select all
'ALGORITHM
fetch(link) db:{%rawvar}
if NOT_FOUND then
@uiedit(%var, "...)
endif
Tchaithonov