mihaela
27th May 2005, 10:48
Has anyone used dynamic SQL to update a table?
Can you give me an example, please?
Mihaela.
NPRao
28th May 2005, 02:10
Here is an example -
expression = "select " & tabname & ".* from " & tabname &
" for update where " & tabname &
".crol inrange :1 and " &
":2 and " & tabname &
"._compnr = 000 order by " & tabname & "._index1 "&
"with retry"
sqlid = sql.parse(expression)
sql.where.bind(sqlid, 1, erole.f)
sql.where.bind(sqlid, 2, erole.t)
sql.exec(sqlid)
while ( true )
on case ( sql.fetch(sqlid) )
case EENDFILE:
case ENOREC:
break
case 0:
tblid = db.bind("t" & tabname, buffer, 000)
if tblid > 0 then
db.delete(tblid, db.retry)
commit.transaction()
else
message("delete failed")
return(-2)
endif
continue
default:
destroy.progress.indicator()
mess("zmadms0017", db.error(), 1)
return(-3)
|* Error %1$d occurred
endcase
break
endwhile
sql.break(sqlid)
sql.close(sqlid)
veyant
30th May 2005, 12:37
hi NP,
due to have any documentation or help file on how to USE native SQL in Baan programming.
i will appreciate if you can share some knowledge on this topic.
thanks
Sandy