Magnussw
4th September 2002, 16:02
I'm having a hard time finding any help on if a selectdo can be used in dynamic SQL or not.
If so, how?
If not, how is this same result achieved?
Thanks ahead for any help.
Mark
mark_h
4th September 2002, 17:15
You use sql.fetch. Follow this http://www.baanboard.com/programmers_manual_baanerp_help_functions_dynamic_sql_queries_sql_fetch to read about sql.fetch.
Mark
FransG
4th September 2002, 17:21
Here is a simple example, maybe it is helpful:
table ttcmcs010
function main()
{
long sql.id
long ret.val
string sql.string(200)
sql.string = "select tcmcs010.* "
& "from tcmcs010 "
sql.id = sql.parse(sql.string)
ret.val = sql.exec(sql.id)
ret.val = sql.fetch(sql.id)
while not ret.val and ret.val <> EENDFILE
|* This is your selectdo part.
message(sprintf$("%s", tcmcs010.ccty))
ret.val = sql.fetch(sql.id)
endwhile
sql.close(sql.id)
}
Magnussw
4th September 2002, 17:30
Thanks mark_h and FransG,
I already figured it out.
I used:
while not sql.fetch(sql_id)
Filter.Desc.Or.Not.Then.Print()
endwhile
Thank you very much for your responce.
Mark
ims_lenor
24th June 2004, 09:26
Here is a simple example, maybe it is helpful:
table ttcmcs010
function main()
{
long sql.id
long ret.val
string sql.string(200)
sql.string = "select tcmcs010.* "
& "from tcmcs010 "
sql.id = sql.parse(sql.string)
ret.val = sql.exec(sql.id)
ret.val = sql.fetch(sql.id)
while not ret.val and ret.val <> EENDFILE
|* This is your selectdo part.
message(sprintf$("%s", tcmcs010.ccty))
ret.val = sql.fetch(sql.id)
endwhile
sql.close(sql.id)
}
Great example thx a lot