If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Informix "for update" cursor

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-22-06, 05:16
ycy3 ycy3 is offline
Registered User
 
Join Date: May 2006
Posts: 6
Informix "for update" cursor

Any one had any idea if the for update CURSOR can be used for the following selection together with the order by:

let sql_str = "select * from tableA where ctry_cd = 'AA' ",
" for update ",
" order by accnt_no desc "

prepare stmt1 from sql_str
declare cur1 cursor for stmt1

Facing runtime error while executing the binary.
SQL statement error number -201.
A syntax error has occurred.
Reply With Quote
  #2 (permalink)  
Old 08-22-06, 09:41
mjldba mjldba is offline
Registered User
 
Join Date: Dec 2003
Location: North America
Posts: 139
It's been a long time since I've looked at 4gl code but I'm pretty sure that you can't use the "order by" clause with an update cursor.

Here's the syntax I found in some old documentation:

let sqlstmt1 = "select * from tableA where cntry_cd = 'AA'"
prepare statement3 from sqlstmt1
declare my_cursor cursor for statement3 for update

I also have seen this syntax used:

declare my_cursor cursor for
select * from tableA where cntry_cd = "A"
for update
Reply With Quote
  #3 (permalink)  
Old 01-18-07, 05:07
adelxp adelxp is offline
Registered User
 
Join Date: Nov 2006
Posts: 3
yes it's ok
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On