Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Stored procedure problems
Hi,
SQL*Plus SHOW ERRORS command can list the errors in the compiled module. Although it is useful but bit limited since it does not show you the source code lines where error occured.
You can use EXEC S.LSTERR command of my SQLPlusPlus (freeware) to list compilation errors along with the source code lines. e.g.
SQL> EXEC S.LSTERR
| ----------------------------------------------------------------------
|
regards,
M. Armaghan Saqib
+---------------------------------------------------------------| 2. SQL Link for XL => Integrate Oracle with XL
| 1. SQL PlusPlus => Add power to SQL Plus command line
+---------------------------------------------------------------
<kirk_at_kaybee.org> wrote in message news:<8898kn$3q7$1_at_news- int.gatech.edu>...
> I am trying to create a stored procedure to create a new account. The > tables are all in the 'udb' schema. My problem is that this procedure > has errors, but I don't know where they are or how to determine where > they are. > > Here is the commands I used to create the pertinent DB elements: > > CREATE TABLE users (u_id int primary key not null, u_name varchar2(20) > not null, u_index int not null); > > CREATE SEQUENCE uid_seq INCREMENT BY 1 START WITH 1 MAXVALUE2147483648
> nocycle nocache noorder; > > CREATE FUNCTION create_account (newname IN VARCHAR2) > RETURN number > AS > max number; > BEGIN > SELECT max(u_index) > INTO max > FROM udb.users > WHERE u_name = newname; > > max := (max + 1); > > INSERT INTO udb.users (u_id, u_name, u_index) > VALUES (udb.uid_seq.nextval, newname, max); > > RETURN max; > > END; > > When I run the last command (CREATE FUNCTION) in 'sqlplus' it just > tells me: > Warning: Function created with compilation errors. > > I would appreciate any help you could give me on this. > > -- > Kirk Bauer -- CmpE, Georgia Tech -- kirk_at_kaybee.org -- Avid Linux User > GT Sport Parachuting Club! http://cyberbuzz.gatech.edu/skydive > Opinions expressed are my own, but they should be everybody's.
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Feb 14 2000 - 11:30:15 CST
![]() |
![]() |