|
|
Choosing A Webhost: |
FETCH PREV/POS???: msg#00220db.maxdb
Hi again :) I've got a problem that drives me nuts, I got the program-fragment below, case(0) creates a result table and display the first entry, case(1) is for going forward and case(2) for going backwards through the temporary result Table tmp. case(0) works, it creates an Result table and displays the first entry, case(1) works, it displays the next entry (works not with FETCH POS) case(2) dosn't work, it also displays the next entry, the next FETCH NEXT about 10 rows ahead... I tried to replace the FETCH NEXT/PREV with FETCH POS (al you can see below), but that gives me the following error at runtime: -- SQLCODE: -812 Parameter list too short -- SQLCODE: -802 Invalid numeric input parameter value Whats wrong here??? EXEC SQL BEGIN DECLARE SECTION; unsigned int cnt=0; EXEC SQL END DECLARE SECTION; unsigned int count = 1; switch(flag) { case(0): memset(&DB_vein,0,sizeof(DB_vein)); comitwrk(); EXEC SQL SELECT tmp(!DB_vein) FROM VER_EINRICHT WHERE Bverknr LIKE :DB_vein_mask.Bverknr AND Bindex LIKE :DB_vein_mask.Bindex AND FLR_Mschnam LIKE :DB_vein_mask.FLR_Mschnam AND Version LIKE :DB_vein_mask.Version AND Mat_Status = 'A' ; EXEC SQL FETCH FIRST tmp INTO :DB_vein :DB_vein_i; ret = SQLC; if(ret == SUCCESS) memcpy(&db_ver,&DB_vein,sizeof(DB_vein)); comitend(); break; case(1): count++; memset(&DB_vein,0,sizeof(DB_vein)); cnt = count; // EXEC SQL FETCH POS(:cnt) tmp EXEC SQL FETCH NEXT tmp INTO :DB_vein :DB_vein_i; ret = SQLC; if(ret == SUCCESS) memcpy(&db_ver,&DB_vein,sizeof(DB_vein)); comitend(); break; case(2): count--; memset(&DB_vein,0,sizeof(DB_vein)); cnt = count; // EXEC SQL FETCH POS(:cnt) tmp EXEC SQL FETCH PREV tmp INTO :DB_vein :DB_vein_i; ret = SQLC; if(ret == SUCCESS) memcpy(&db_ver,&DB_vein,sizeof(DB_vein)); comitend(); break; } Greets, **Jürgen** -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/maxdb?unsub=gcdm-maxdb@xxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | is the MaxDB7.6 realease date already known?, Bodo.Teichmann |
|---|---|
| Next by Date: | Re: maxdb_php and dbproc question, Fritz |
| Previous by Thread: | is the MaxDB7.6 realease date already known?, Bodo.Teichmann |
| Next by Thread: | SQL syntax for record locks ?????, A . Beermann |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home
| advertise | OSDir is
an inevitable website.
|