dbTalk Databases Forums  

PL/SQL Nested Table inside a SQL statement

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss PL/SQL Nested Table inside a SQL statement in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mirko
 
Posts: n/a

Default PL/SQL Nested Table inside a SQL statement - 10-09-2003 , 12:01 PM






Hi,
I have a PL/SQL procedure (inside a package) with the following SQL code:

INSERT INTO set_day_substore_r_k
(day_id, ...)
SELECT e.day_id,...
FROM
e,
TABLE(datetimes_required) dtr,
-- only find the capture_dates within the range of the datetimes we require
e.capture_date >= dtr.dt AND
e.capture_date <
(dtr.dt + reporting_common.day_interval)

ORA-22905: cannot access rows from a non-nested table item
ORA-06512: at "M.PACKAGENAME", line 842
ORA-06512: at line 1

Line 842 is the BEGIN of the procedure.

Any ideas?
THANK YOU,
Mirko PLEASE REPLY TO: mirko.carlini (AT) libero (DOT) it

Reply With Quote
  #2  
Old   
Daniel Morgan
 
Posts: n/a

Default Re: PL/SQL Nested Table inside a SQL statement - 10-09-2003 , 12:05 PM






Mirko wrote:

Quote:
Hi,
I have a PL/SQL procedure (inside a package) with the following SQL code:

INSERT INTO set_day_substore_r_k
(day_id, ...)
SELECT e.day_id,...
FROM
e,
TABLE(datetimes_required) dtr,
-- only find the capture_dates within the range of the datetimes we require
e.capture_date >= dtr.dt AND
e.capture_date
(dtr.dt + reporting_common.day_interval)

ORA-22905: cannot access rows from a non-nested table item
ORA-06512: at "M.PACKAGENAME", line 842
ORA-06512: at line 1

Line 842 is the BEGIN of the procedure.

Any ideas?
THANK YOU,
Mirko PLEASE REPLY TO: mirko.carlini (AT) libero (DOT) it


You need to use the correct syntax for the nested table. This will
require a constructor of which you can read
all about them at http://tahiti.oracle.com and find numerous examples at
http://asktom.oracle.com.

--
Daniel Morgan
http://www.outreach.washington.edu/e...ad/oad_crs.asp
http://www.outreach.washington.edu/e...oa/aoa_crs.asp
damorgan@x.washington.edu
(replace 'x' with a 'u' to reply)



Reply With Quote
  #3  
Old   
Phenton
 
Posts: n/a

Default Re: PL/SQL Nested Table inside a SQL statement - 10-10-2003 , 06:01 AM



On 9 Oct 2003 10:01:54 -0700, mirkocarlini (AT) yahoo (DOT) co.uk (Mirko) wrote:

Quote:
Hi,
I have a PL/SQL procedure (inside a package) with the following SQL code:

INSERT INTO set_day_substore_r_k
(day_id, ...)
SELECT e.day_id,...
FROM
e,
TABLE(datetimes_required) dtr,
-- only find the capture_dates within the range of the datetimes we require
e.capture_date >= dtr.dt AND
e.capture_date
(dtr.dt + reporting_common.day_interval)

ORA-22905: cannot access rows from a non-nested table item
ORA-06512: at "M.PACKAGENAME", line 842
ORA-06512: at line 1

Line 842 is the BEGIN of the procedure.

Any ideas?
THANK YOU,
Mirko PLEASE REPLY TO: mirko.carlini (AT) libero (DOT) it
AFAIK You can only use select ... table(A_Collection) operations if
A_Collection is defined explicitly for the data dictionary. Types
defined locally in procedure or packages are not.

All you have to do is use : create type A_Collection as table of .....

Phenton.


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.