Home » SQL & PL/SQL » SQL & PL/SQL » sequence (windows 7 )
sequence [message #507246] Fri, 13 May 2011 06:35 Go to next message
x-oracle
Messages: 380
Registered: April 2011
Location: gujarat
Senior Member
i have create one sequece using this syntax

CREATE SEQUENCE seq_emp_id START WITH 100;

after that when i create a table using this syntax

CREATE TABLE employee
(
emp_id integer default NEXTVAL ('seq_emp_id'),
name text
);

i got an error like this

*
ERROR at line 2:
ORA-04044: procedure, function, package, or type is not allowed here

so how can i resolve my this error

Re: sequence [message #507248 is a reply to message #507246] Fri, 13 May 2011 06:42 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Quote:
NEXTVAL ('seq_emp_id')
Quote:
name text
datatype ?




Quote:
ORA-04044:
procedure, function, package, or type is not allowed here
Cause: A procedure, function, or package was specified in an inappropriate place in a statement.
Action: Make sure the name is correct or remove it.



[Updated on: Fri, 13 May 2011 06:46]

Report message to a moderator

Re: sequence [message #507254 is a reply to message #507248] Fri, 13 May 2011 06:57 Go to previous messageGo to next message
Littlefoot
Messages: 21826
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, Oracle doesn't allow sequence numbers at that place. You'll have to write a trigger that will insert sequence's next value into that column.

Do search the board; there've been examples previously (such as this one).
Re: sequence [message #507468 is a reply to message #507254] Mon, 16 May 2011 02:01 Go to previous message
x-oracle
Messages: 380
Registered: April 2011
Location: gujarat
Senior Member
its ok i have create a trigger and its solve
Previous Topic: error in procedure
Next Topic: privilege required to gather table statistics
Goto Forum:
  


Current Time: Sun Aug 24 14:38:50 CDT 2025