Re: Trigger

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 06 Mar 2008 11:14:48 -0800
Message-ID: <1204830887.920140_at_bubbleator.drizzle.com>


Bumsys_at_gmail.com wrote:
> create or replace trigger trg_i_au_clients
> before insert on au_clients for each row
> begin
> select au_clients_seq.nextval into :new.id from dual;
> end;
>
> I have error "java.lang.IllegalArgumentException: No SQL selected for
> execution.Position: 0".
> Why can it be? Please help.

The error has nothing to do with the trigger unless you have corruption.

SELECT owner, object_type, COUNT(*)
FROM dba_objects
WHERE status = 'INVALID'
GROUP BY owner, object_type;

SELECT comp_name, version, status
FROM dba_registry;

What is in the alert log?

Your code works fine here though you should note that no column should ever be named id. First because it violates database basics ... what id? Person ID? Document ID? Passport ID? And secondly because it is a reserved word in Oracle.

Learn this query:
SELECT keyword
FROM gv$reserved_word
WHERE keyword LIKE '%<your_string_here>%';

-- 
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Thu Mar 06 2008 - 20:14:48 CET

Original text of this message