SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Issue with SELECT query of CURSOR
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Mary Anotny
Starting Member

India
1 Posts

Posted - 09/09/2009 :  02:36:57  Show Profile  Reply with Quote
Hi,

I have declared a CURSOR as follows in my Por*C code.

DECLARE sample_dt_cursor CURSOR
FOR
SELECT LPAD(TO_CHAR(TO_DATE(sample_dt,'DD-MON-YY'),'MMDDYY'),6,0),
sample_id
FROM SAMPLE_TABLE
WHERE sample_ind= 'N'
AND upper(sample_id) = upper(:db_sample_id)
AND sample_dt <> TRUNC(SYSDATE);

When I run the select query in the sqlplus prompt, I get the Left padded value of the sample_dt (090809 - MMDDYY). But when I fetch the data from the cursor in the code, I'm not getting the left padded value(90809 - MMDDYY).

Can anyone help me resolve this issue ? I'm new to cursors.

Thanks,
Mary Antony

madhivanan
Premature Yak Congratulator

India
22761 Posts

Posted - 09/09/2009 :  03:21:10  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Post your question at Oracle forums like www.orafaq.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000