Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 10:48 PM
Vishal
Guest
 
Posts: n/a
Default ORA-00947: WHY!?!?!?

Hello,

I have the following types/table:

create or replace type point as object(
x number(3),
y number(3),
z number(3)
);
/

create or replace type cube as object(
id number(5),
bottom_corner point,
top_corner point,
member function volume return number,
member function surface return number,
pragma restrict_references(volume, WNDS),
pragma restrict_references(surface, WNDS)
);
/

create table Cubes of cube(
id primary key,
bottom_corner not null,
top_corner not null
);
[color=blue]
> Why does the following line in a procedure i have written[/color]
give me these errors:

create or replace procedure cube_intersect(ident IN NUMBER) as
this_cube Cubes%ROWTYPE;
....
....

begin
select * into this_cube from Cubes where id = ident;

^ERROR


36/3 PL/SQL: SQL Statement ignored
36/23 PL/SQL: ORA-00947: not enough values

Thanks,
Vishal
  #2  
Old July 19th, 2005, 10:48 PM
Douglas Hawthorne
Guest
 
Posts: n/a
Default Re: ORA-00947: WHY!?!?!?

"Vishal" <vabru4u@yahoo.com> wrote in message
news:3fc78ae.0404241954.6e2a0fa7@posting.google.co m...[color=blue]
> Hello,
>
> I have the following types/table:
>
> create or replace type point as object(
> x number(3),
> y number(3),
> z number(3)
> );
> /
>
> create or replace type cube as object(
> id number(5),
> bottom_corner point,
> top_corner point,
> member function volume return number,
> member function surface return number,
> pragma restrict_references(volume, WNDS),
> pragma restrict_references(surface, WNDS)
> );
> /
>
> create table Cubes of cube(
> id primary key,
> bottom_corner not null,
> top_corner not null
> );
>[color=green]
> > Why does the following line in a procedure i have written[/color]
> give me these errors:
>
> create or replace procedure cube_intersect(ident IN NUMBER) as
> this_cube Cubes%ROWTYPE;
> ...
> ...
>
> begin
> select * into this_cube from Cubes where id = ident;
>
> ^ERROR
>
>
> 36/3 PL/SQL: SQL Statement ignored
> 36/23 PL/SQL: ORA-00947: not enough values
>
> Thanks,
> Vishal[/color]

Vishal,

The primary reason appears to be the nested objects in the definition of the
CUBE object. If I create a procedure as follows, then I have no compilation
or execution errors on 10.1.0.2 on WinXP Pro:

CREATE OR REPLACE PROCEDURE
cube_intersect(
p_ident IN NUMBER
)
AS
-- this_cube Cubes%ROWTYPE;
TYPE cubes_type IS RECORD (
id NUMBER,
bottom_corner
point,
top_corner
point
);
l_this_cube cubes_type;
l_this_point points%ROWTYPE;
BEGIN
SELECT * INTO l_this_cube FROM cubes WHERE id = p_ident;
SELECT * INTO l_this_point FROM points WHERE ROWNUM = 1;
END;
/

Firstly, I created a RECORD that matched the structure of the CUBE object.
There was no problem with the included objects.

Secondly, I created a table (POINTS) with the POINT object type. The
compiler had no problem with one level of object definition.

Douglas Hawthorne


 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles