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 > DB2 > MSSQL Query to DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-30-04, 19:05
chris58950 chris58950 is offline
Registered User
 
Join Date: Mar 2004
Posts: 5
MSSQL Query to DB2

Can someone help me modify this query from MSSQL to DB2? I'm a novice and don't know exactly what query does. I do know that it connects the the indexdb table. I don't know what the CSR function is, nor what it does. Thank you for your help.

-- ms-sql server 7.0
-- q2.sql.syb

PRINT "Query2: F_DOCNUMBER > 100200; ; 300 ; ;"
USE indexdb
SETUSER 'f_sw'
GO

DECLARE csr CURSOR FOR
SELECT f_docnumber FROM doctaba
WHERE (f_docnumber > 100200) AND
((f_deletedate is not null and f_retentbase='1' and f_deletedate >= 9443) OR
(f_archivedate is null and f_deletedate is null) OR
(f_archivedate is not null and f_retentbase = '1' and f_archivedate >= 9443))
ORDER BY f_docnumber
GO

OPEN csr
FETCH csr
DEALLOCATE csr
GO;
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