Bender
2nd January 2007, 18:21
Baan: Baan IVc4
DB: SQL Server 2000
OS: Windows 2003
C/S: Both
Hi there,
can anyone solve this Problem? ForumSearch did not help yet.
I am quite new to baan but have experience in DynamicSQL for Oracle.
Here my Problem:
I want to transfer tabledata from one company to another.
After i checked and compared all RDI-Infos an possible references,
i want to get a count of the data i want to transfer.
So i'm building a SQL with a "count(*):1" and a "not exists" clause.
Everything passes until the fetch is reached. Then i get this Errormessage in the Event-Viewer only: "bdberrno 509 (Bad memory cursor; bad table pointer specified)"
The Session itself crashes away to Nirvana.
This is the part of the code, that matters.
If anybody has a clue, please tell me :)
Thanks in advance guys
****************
sql.source.cnt.select=sprintf$("select count(%s):1 "& "from %s where %s._compnr = %d "
& "and not exists (select * from %s where %s._compnr = %d) " ,str.cnt.column
,tmp.source.table, tmp.source.table, tmp.sourcecompnr
,tmp.target.table, tmp.target.table, tmp.targetcompnr)
sql_id.source.cnt.tbl = sql.parse(sql.source.cnt.select)
if sql_id.source.cnt.tbl<>0 then if(sql.select.bind(sql_id.source.cnt.tbl, 1, src.cnt)=0)then if(sql.exec(sql_id.source.cnt.tbl)=0)then while true on case sql.fetch(sql_id.source.cnt.tbl) case eendfile:
break
case 0:
break
default:
endcase
break
endwhile
sql.break(sql_id.source.cnt.tbl)
sql.close(sql_id.source.cnt.tbl)
endif
endif
endif
****************
DB: SQL Server 2000
OS: Windows 2003
C/S: Both
Hi there,
can anyone solve this Problem? ForumSearch did not help yet.
I am quite new to baan but have experience in DynamicSQL for Oracle.
Here my Problem:
I want to transfer tabledata from one company to another.
After i checked and compared all RDI-Infos an possible references,
i want to get a count of the data i want to transfer.
So i'm building a SQL with a "count(*):1" and a "not exists" clause.
Everything passes until the fetch is reached. Then i get this Errormessage in the Event-Viewer only: "bdberrno 509 (Bad memory cursor; bad table pointer specified)"
The Session itself crashes away to Nirvana.
This is the part of the code, that matters.
If anybody has a clue, please tell me :)
Thanks in advance guys
****************
sql.source.cnt.select=sprintf$("select count(%s):1 "& "from %s where %s._compnr = %d "
& "and not exists (select * from %s where %s._compnr = %d) " ,str.cnt.column
,tmp.source.table, tmp.source.table, tmp.sourcecompnr
,tmp.target.table, tmp.target.table, tmp.targetcompnr)
sql_id.source.cnt.tbl = sql.parse(sql.source.cnt.select)
if sql_id.source.cnt.tbl<>0 then if(sql.select.bind(sql_id.source.cnt.tbl, 1, src.cnt)=0)then if(sql.exec(sql_id.source.cnt.tbl)=0)then while true on case sql.fetch(sql_id.source.cnt.tbl) case eendfile:
break
case 0:
break
default:
endcase
break
endwhile
sql.break(sql_id.source.cnt.tbl)
sql.close(sql_id.source.cnt.tbl)
endif
endif
endif
****************