Hi, I have a recursive table "Objectnew" with the columns "objectref"
(primary key), objectname, objectid, and parentobjectid
Recursive Relation: objectid ----< Parentobjectid
I have the following cursor that extracts information about all
objects with a specific name below a starting point
DECLARE
CURSOR findChildren(
starting Objectnew.objectref%TYPE,
name Objectnew.objectname%TYPE) IS
SELECT
objectref,
objectname
FROM
Objectnew
WHERE
objectref in (
SELECT
objectref
FROM
Objectnew
CONNECT BY PRIOR objectid = parentobjectid
START WITH objectref = startingref
) AND
objectname = name;
What I need is, once I found some objects with a specific name, to run
another query below each of them to find objects with another name.
Something like
OPEN findChildren(1234, 'A');
LOOP
FETCH findChildren INTO ref, name
EXIT WHEN findChildren%NOTFOUND;
-- I have found an object A,
-- I need to know if there is a B below A
OPEN findChildren(ref, 'B');
LOOP
FETCH findChildren INTO ref2, name2
EXIT WHEN findChildren%NOTFOUND;
-- YES, there is a B, process it
....
Is it possible without creating a duplicate of cursor findChildren ?
Thank you
Bernard Drolet 1 16809
the cursor can only be opened once, but you could do a recursive procedure
call, ie.:
declare
procedure findC (...
cursor cFindC ...
is
...
-- found record, recursive call
findC(...);
...
end;
begin
-- initial call
findC(...);
end;
(or create the recursively called procedure as a stored procedure)
--
Mark C. Stock
email mcstock -> enquery(dot)com www.enquery.com
(888) 512-2048
"Bernard Drolet" <be*****@drolet.com> wrote in message
news:a9**************************@posting.google.c om... Hi, I have a recursive table "Objectnew" with the columns "objectref" (primary key), objectname, objectid, and parentobjectid Recursive Relation: objectid ----< Parentobjectid
I have the following cursor that extracts information about all objects with a specific name below a starting point
DECLARE CURSOR findChildren( starting Objectnew.objectref%TYPE, name Objectnew.objectname%TYPE) IS SELECT objectref, objectname FROM Objectnew WHERE objectref in ( SELECT objectref FROM Objectnew CONNECT BY PRIOR objectid = parentobjectid START WITH objectref = startingref ) AND objectname = name;
What I need is, once I found some objects with a specific name, to run another query below each of them to find objects with another name.
Something like OPEN findChildren(1234, 'A'); LOOP FETCH findChildren INTO ref, name EXIT WHEN findChildren%NOTFOUND;
-- I have found an object A, -- I need to know if there is a B below A OPEN findChildren(ref, 'B'); LOOP FETCH findChildren INTO ref2, name2 EXIT WHEN findChildren%NOTFOUND;
-- YES, there is a B, process it ...
Is it possible without creating a duplicate of cursor findChildren ?
Thank you
Bernard Drolet This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Michal Adamski |
last post by:
I'm trying to make a popup. The code I pasted below works, but my problem
is, that I want the http://www.mypage.com to open in the same browser
window. So I need something instead of window.open()....
|
by: gil |
last post by:
I have a form that I would like to get the values entered on the page
and go to a new page in the same window. I can make the code work to
open a new window, but I need it to open in the same...
|
by: Debbie Gilbert |
last post by:
When running a report..I get the message "Cannot open any more
databases." Run-time error 3048... Has anyone seen this message
before?
|
by: Koen |
last post by:
Hi all,
At work I created a database which is really helpful. The database is used
by approx 15 users. Everything worked great, until I added some
'scoreboard' forms and reports. I get the...
|
by: Niranjan |
last post by:
I have a relatively straight forward report. The query that populates
data for this report is complicated. The report opens without any
problem and I can print it as well.
However, If I have...
|
by: Phil Stanton |
last post by:
Real problem usink AK2
I have got a form with 7 tabs on it, numerous subforms and combo boxes. as
well as continuous subforms with combo boxes. I get the message "Can't open
any more databases"...
|
by: celtic_kiwi |
last post by:
I have an Access 97 database, quite large, and have started getting the
error, Error 3048: Can't Open any more databases.
-The data is split from the application (front end and back end).
-The...
|
by: celtic_kiwi |
last post by:
I have an Access 97 database, quite large, and have started getting the
error, Error 3048: Can't Open any more databases.
-The data is split from the application (front end and back end).
-The...
|
by: n8kindt |
last post by:
i'm stuck. i'm using access 2007 on a windows vista machine (i've tried running on xp too, though--same result) and this is the error i keep getting whenever i try running my main query:
Cannot...
|
by: vanlanjl |
last post by:
Okay lets see if I can do this with out confusing myself or others. First I will give ALL the details then state my problem and request at the bottom.
Tables:
tblContacts
ID
Company
LastName...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |