Trigger compile but the runtime error

You guys wouldn't like that. Sound on a trigger!

Below is a trigger, I found in OTN. I have a similar requirement. Compile under triggers. But, while running, I get
ORA-00936: missing expression during execution
I have this feeling that the last line of the INSERT statement is the origin of the problem.
create or replace trigger trg_test
before insert or update on central_dtls.emp_config
for each row

declare
v_schema varchar2(100);
v_sql_stat varchar2(32767);


begin
     
select schema_name into v_schema from central_dtls.master_config where company_id= :new.id;


                              v_sql := 'insert into ' ||v_schema||'..emp_config_local 
                              (
                              company_id, 
                              .
                              .
                              .
                              )
                              values 
                              (' 
                               ||:new.col1||', '
                               ||:new.col2||', '
                               .
                               .
                               .
                               .
                               ||:new.lastcol||  ')';    ----- Potential issue in this line




exception
when others then ......;

end;
/
I tried the things below.

||:new.lastcol  ');';   --- Trigger Will not compile
||:new.lastcol||  ')';    --- Trigger Will compile , but, will get "ORA-00936: missing expression" during execution
||:new.lastcol|| ');';   --- Trigger Will compile , but, will get "ORA-00936: missing expression" during execution

If: new.col1 is a character column, you must also place them with single quotes.

The best way would be to print your insert string and see what you found

Tags: Database

Similar Questions

Maybe you are looking for

  • Cannot add the find now is in the Tools menu when you try to install add to import Windows Live messages, contacts, etc.

    I want to import Windows Live 2011 messages, contacts, etc and tried to install the recommended add on. I downloaded and registered the add on by following the instructions, but when I went on the Tools menu, to add on the of are not there to complet

  • Update on Portege A100 HDD

    Hello 2 questions: 1. I would like to replace my hard drive 3 yr old portege a100 with 2.5 inch 100-200 GB hard drive (internal).I was wondering if it was possible? 2. I was wondering if, if the hard drive has been replaced with a new drive from 100

  • Works 8.5

    All of a sudden my text, spreadsheet and Works database programs stopped working. When I try to open the programs they climb but then it just sit there and finally I get the "program does not message. I tried reinstalling several times but the same t

  • Question about QSqlDatabase

    Hi, my application using QSqlDatabase. It works fine, I can insert and load the data from DB. The debugging of the device and release device. The problem is, when I export Release Build on .bar-descriptor, then created .bar file. So I want to try ins

  • Plugins in oracle apex 5.0

    HelloA few questions about the Plugins.I'm following chart example packaged application to create different types of graphs based on the need. I found some very interesting things in it.what I know:I tried to use D3 Donut chart, now they use some plu