472,353 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

From cursor to a table

151 100+
Hi All


Recently i was working on cursors in a procedure. I was using a cursor in a procedure to retrieve names and corresponding Ids. I used loop to fetch each record into an OUT variable. But I want all the names to be directly stored into a temporary table(created by myself, which has only one field for storing the names). I want to use this temporary table later at the front end application.


this was my code snippet
------------------------------------------------------------------------------------------------
CREATE Procedure HRMS ( id out varchar2,name out varchar2 )
IS
cursor c1 is
select PROJ_Id,LAST_NAME from HRMS_TABLE where LAST_name LIKE s%;
BEGIN
open c1;
LOOP
fetch c1 into ID,NAME;
exit when c1%NOTFOUND;
END LOOP;
close c1;
end;
----------------------------------------------------------------------------------------------
Please someone help regarding this. I hope i get an Reply for this as soon as possible.

Thank u
Jun 21 '07 #1
4 1275
r035198x
13,262 8TB
Hi All


Recently i was working on cursors in a procedure. I was using a cursor in a procedure to retrieve names and corresponding Ids. I used loop to fetch each record into an OUT variable. But I want all the names to be directly stored into a temporary table(created by myself, which has only one field for storing the names). I want to use this temporary table later at the front end application.


this was my code snippet
------------------------------------------------------------------------------------------------
CREATE Procedure HRMS ( id out varchar2,name out varchar2 )
IS
cursor c1 is
select PROJ_Id,LAST_NAME from HRMS_TABLE where LAST_name LIKE s%;
BEGIN
open c1;
LOOP
fetch c1 into ID,NAME;
exit when c1%NOTFOUND;
END LOOP;
close c1;
end;
----------------------------------------------------------------------------------------------
Please someone help regarding this. I hope i get an Reply for this as soon as possible.

Thank u
If I got your question right, then all you need to do is to put the insert statement between the fetch line and the exit when line. Are you having problems with the insert statement?
Jun 21 '07 #2
debasisdas
8,127 Expert 4TB
Please find more details regarding cursors here.
Jun 21 '07 #3
vamsioracle
151 100+
Please find more details regarding cursors here.



thank you very much. That was a timely help
Jun 21 '07 #4
debasisdas
8,127 Expert 4TB
Hi
vamsioracle
Welcome to TSDN.

You have reached the right place for knowledge shairing.

Here you will find a vast resource of related topics and code.

Feel free to post more doubts/questions in the forum.

But before that give a try from your side and if possible try to post what/how you have approached to solve the problem.

It will help Experts in the forum in solving/underestanding your problem in a better way.

Please follow the posting guidelines in every new post/reply.

Regards

Debasis
Jun 21 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Golawala, Moiz M (GE Infrastructure) | last post by:
Hi All, I am having problem returning values from a Stored Procedure that creates a dynamic table (table variable) inserts values during a...
0
by: Golawala, Moiz M (GE Infrastructure) | last post by:
Hi All, Could someone please help me with an issue I am having. I am having problem returning values from a Stored Procedure that creates a...
2
by: Dan Flynn | last post by:
We have a stored procedure that returns a result set. We call this stored procedure from an RPG program using SQL CLI. The first call is...
11
by: trinitypete | last post by:
Hi all, I have a user control that uses control literal to build a heading with a link, and a div containing links below. As the link heading...
10
by: technocrat | last post by:
Hi, I am trying to declare and cursor and thn load from that cursor into another table. Since I have almost 4 million records, I cant do it...
7
by: P. Adhia | last post by:
Sorry for quoting an old post and probably I am reading out of context so my concern is unfounded. But I would appreciate if I can get someone or...
2
by: andres | last post by:
hi all, thanks for everyone for your support! i have a report being built in studio 2005. It calls a stored procedure. The SP runs a query and...
5
by: Bill | last post by:
This database has no forms. I am viewing an Access table in datasheet view. I'd like to execute a macro to execute a function (using "runcode"). In...
12
by: robertino | last post by:
Hi all, I've put together a few SPs to produce a BOM (bill of materials) listing, which together use a couple of global temp tables, and return...
14
by: Ben | last post by:
I don't know whether anyone can help, but I have an odd problem. I have a PSP (Spyce) script that makes many calls to populate a database. They all...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.