Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to use Cursor's Fetch to return multiple column Data

793919Oct 14 2010 — edited Oct 15 2010
Hi ,

This is my Table :

SQL> select * from Login;

USERNAME PASSWORD CONFIRMPASSWORD
--------------- --------------- ---------------
RAvi SAI SAI
Kiran Keyboard Keyboard
VARNU JAINA JAINA

This is my stored Procedure , for that Table , this is working fine , where he Cursor's Fetch is returning only a Single column of Data .

CREATE OR REPLACE PROCEDURE getEmpName(EMP_ID IN VARCHAR2)
IS
EMPNAME VARCHAR2(50);
CURSOR MYCUR
IS
SELECT USERNAME from login where USERNAME=EMP_ID;
BEGIN
OPEN MYCUR ;
LOOP
FETCH MYCUR INTO EMPNAME;
DBMS_OUTPUT.PUT_LINE(EMPNAME);

EXIT WHEN MYCUR%NOTFOUND;
END LOOP;

close MYCUR ;
END;




Now , I have a requirement as , i need to get the Password also along with Username ,
Please tell me how can i use FETCH of Cursor to populate Details into the Declared Variables
FETCH MYCUR INTO EMPNAME;













CREATE OR REPLACE PROCEDURE getEmpName(EMP_ID IN VARCHAR2)
IS
EMPNAME VARCHAR2(50);
PASSWORD VARCHAR2(50);
CURSOR MYCUR
IS
SELECT USERNAME , PASSWORD from login where USERNAME=EMP_ID;
BEGIN
OPEN MYCUR ;
LOOP
FETCH MYCUR INTO EMPNAME; // Help needed here**
DBMS_OUTPUT.PUT_LINE(EMPNAME);

EXIT WHEN MYCUR%NOTFOUND;
END LOOP;

close MYCUR ;
END;

Edited by: user10503747 on Oct 14, 2010 11:51 AM

Edited by: user10503747 on Oct 14, 2010 11:52 AM
This post has been answered by Solomon Yakobson on Oct 14 2010
Jump to Answer

Comments

Pavan Kumar

Hi,

1. Do you have orapwd<ORACLE_SID> password in sync on primary and standby ?

2. Do you hosted static listener on standby node with Ur=A ?

3. Please execute same from source server and verify instead of executing from target server

Is this production server ?

I didn't stressed on the parameters - hope you have verified them

- Pavan Kumar N

JuanM

In addition to @"Pavan Kumar" answer,

Try to validate the steps posted here by Kamran Bakhshandeh

https://www.pythian.com/blog/duplicate-from-active-database-using-rman-step-by-step/

and validate if some step are missing.

AJ

Pavan Kumar skrev:

Hi,

1. Do you have orapwd<ORACLE_SID> password in sync on primary and standby ?

2. Do you hosted static listener on standby node with Ur=A ?

3. Please execute same from source server and verify instead of executing from target server

Is this production server ?

I didn't stressed on the parameters - hope you have verified them

- Pavan Kumar N

Ref point 2: You actually need to have the instance statically registered with the listener on both primary and standby for active duplicate to work.

AJ

Pavan Kumar

That's what my point is and asked for the same directly, perhaps only required on standby node - not on primary. Since standby instance can't be registered nomount phase.

Hemant K Chitale

Both Oracle_Homes must have the same Password file (the file name would be different).

Both Oracle_Homes must have tnsnames.ora entries pointing to each other.

Hemant K Chitale

1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 12 2010
Added on Oct 14 2010
3 comments
23,117 views