Home » SQL & PL/SQL » SQL & PL/SQL » Compile error (Oracle 10g)
Compile error [message #333763] Mon, 14 July 2008 07:04 Go to next message
sumski
Messages: 2
Registered: July 2008
Junior Member
I try to compile a trigger in Oracle 10g
DECLARE
new_value NUMBER;
BEGIN
SELECT ACCOUNT_ID_SEQ.NEXTVAL INTO new_value FROM dual;
:NEW.account_id := new_value;
IF (:NEW.USERNAME IS NULL) THEN
:NEW.USERNAME := '#' || TO_CHAR(new_value);
END IF;
END;

Can you help me where i wrong?

Thanks
Re: Compile error [message #333767 is a reply to message #333763] Mon, 14 July 2008 07:10 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Please copy-paste your session from SQLPlus where you try to compile this trigger.
This will give us
- The actual error (which you did not give)
- the line number where the error occurred.

Also, what you showed here does not look like a trigger. Trigger code does (generally) not start with DECLARE.
Anonymous procedures do start with DECLARE; they however can't contain :new.xxx .


Wrap your code in [code] tags when posting it here; it will make it more readable.

[Updated on: Mon, 14 July 2008 07:12]

Report message to a moderator

Re: Compile error [message #333771 is a reply to message #333763] Mon, 14 July 2008 07:18 Go to previous messageGo to next message
sumski
Messages: 2
Registered: July 2008
Junior Member
Trigger has compile with errors.But status for the trigger is invalid in oracle10g.when i try to compile show me this error from the past code.

Line # = 4 Column # = 8 Error Text = PL/SQL: ORA-02289: sequence does not exist
Line # = 4 Column # = 1 Error Text = PL/SQL: SQL Statement ignored

Re: Compile error [message #333773 is a reply to message #333771] Mon, 14 July 2008 07:27 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
ORA-02289: sequence does not exist


Question: Now, how many sequences does your code refer to?
Answer : 1

So, if there is only one sequence refered to in the code, and the error message says 'Sequence does not exist', what do you think the problem might be?
Re: Compile error [message #333775 is a reply to message #333771] Mon, 14 July 2008 07:27 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Quote:
ORA-02289: sequence does not exist

And what does that error message tell you, any conclusions on your own ?
Re: Compile error [message #333859 is a reply to message #333775] Mon, 14 July 2008 11:23 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
JRowbottom
the error message says 'Sequence does not exist', what do you think the problem might be?

tahpush
ORA-02289: sequence does not exist

And what does that error message tell you, any conclusions on your own ?


Isn't it obvious? One solution is to rewrite the trigger so that it does not use a sequence.
Previous Topic: Host command NOT getting executed in Hot backup script.
Next Topic: send html emails with images?
Goto Forum:
  


Current Time: Sat Dec 10 09:22:37 CST 2016

Total time taken to generate the page: 0.09914 seconds