0

I used to write PL/SQL programs in oracle 9i.Since windows 7 doesnt support it, switched to oracle 10g express edition. All my SQL programs are alright. But I cant put mutiple queries on a single run though. Like insert into many rows. But PL SQL programs are going crazy. Too many errors.Please help me figure out what is wrong here. How to convert 9i programs to 10g

declare
       pi constant number(5,2):=3.14;
       radius number(5);
	   area number (14,2);
	   circumference number(14,2);
	   l_limit number(2);
	   u_limit number(3);
	   
	   
begin
       l_limit:=&l_limit;	
       u_limit:=&u_limit;
	   radius:=l_limit;
       while radius<=u_limit
	   loop
			area			:=pi*radius*radius;
			circumference	:=2*pi*radius;
			insert into area VALUES(radius,area,circumference);
			radius:=radius+1;
        end loop;
end; 	   
/

create table area(radius number(5) primary key ,area number (14,2), circumference number(14,2));
2
Contributors
10
Replies
12
Views
5 Years
Discussion Span
Last Post by hfx642
0

Well, for one thing...
You're trying to insert into a table that doesn't exist. Area!
Because you only create the table AFTER your insert.
Reverse this and try again.
In fact, these should be in separate scripts.

Edited by hfx642: n/a

0

Hey , I did create the table. Just that I pasted it here at the end.That is not the problem

0

Hey... I'm just going by what YOU posted.
So... What IS the problem?

Edited by hfx642: n/a

0

The problem is it says that & encountered when : or < etc was expected.I found out from the internet that in oracle 10g : is used to read user input instead of &

0

So , I replaced & with : . Then the pop came and asked for inputs L and H limit. But as soon as I enter ,it says ; encountered at pi CONSTANT NUMBER(5,2):=3.14; So I removed that ; , then it says ; / etc missing ! What in the world is that mate? I'm totally confused. Why is 10g radically different from 9i?

0

It isn't!
I'll take it to work to see if I can spot anything.
Give me a day to two, and I'll get back to you.

0

Wait a minute.
I don't think that lines #11 and #12 are valid.
Try giving them different names for your substitution variables.

0

The problem was I was using HTML DB ( now called APEX )on Oracle 10g and it does support PL SQL. The program works perfectly on SQL+ commandline. Thank you for your time

0

Took it to work and tried it on both a 9i and 10g DB. Worked fine.
Even lines #11 and #12. (I just learned something!! Thank-you!)
I haven't had a chance to use APEX yet.
Not really sure if I want too.
I'm a Forms and Reports kinda guy!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.