ORA-00928: lack of keyword SELECT when you create a trigger

Hello

I am trying to create a trigger that is simple for the purpose of verification as below:
CREATE OR REPLACE TRIGGER customer_audit
before insert or update or delete on CUSTOMER for each row
BEGIN
   if :old.cname is null and :new.cname is not null or :old.cname is not null and :new.cname is null  or :old.cname != :new.cname  THEN
      INSERT INTO audit_table (:old.cname,  :new.cname, null, 'cname');
      COMMIT;
   ENDIF;
end;
This compiles with warning. When I check the warning, he said:
TRIGGER customer_audit compiled
Warning: execution completed with warning
3/32           PL/SQL: ORA-00928: missing SELECT keyword
3/7            PL/SQL: SQL Statement ignored
Do not know how to SELECT is part of what I'm trying to do here, or miss me something of totally. Help, please. Thank you very much.

Change ENDIF; in END IF; and try again...

Tags: Database

Similar Questions

  • Keeping selected when you create a new layer of origin

    Is it possible to "definitively" select a layer?


    At the moment I just a single layer that I am trying to select a portion of and then new layer by cutting. Once this new layer is selected, I have to reselect the original layer before you replicate this process again.

    On the one hand, this seems really minor, on the other hand, really Basic. I assume that there is an easy way to do what I'm overlooking. I need to replicate this process a few hundred times and work with / export sections is not conducive to my endgoal.

    possible?

    Not a new layer will become the current target layer in Photoshop. It that way forever and a lot of things relies on this.  If this was changed it would brake a lot.  The best thing you could do is an action that would do what you want to do and make a shortcut you can use instead of "new layer via cut."  The action would simply make a new layer by cutting then the Alt + [Select layers backward step.

  • WITH ACE translated by ORA-00928: lack of SELECT keyword


    Hi all

    We run on Oracle 10 g. The following script is translated by ORA-00928: lack of keyword SELECT. Any ideas what causes this error? Two statements by operating by themselves, complete with success "select".

    [code]

    WITH A1 AS

    WITH A1 (SELECT MIN (VAPS_RPT_INTV_DMSN. INTV_DT), VAPS_RPT_INTV_DMSN. RPT_ID, VAPS_RPT_INTV_DMSN. RPT_INTV_ID OF THE APS. VAPS_RPT_INTV_DMSN, APS. VAPS_RPT_CL_INTV_DMSN WHERE APS. VAPS_RPT_INTV_DMSN. RPT_INTV_ID = APS. VAPS_RPT_CL_INTV_DMSN. RPT_CL_INTV_ID AND VAPS_RPT_INTV_DMSN. HM_VST_IND = '1' GROUP OF VAPS_RPT_INTV_DMSN. RPT_ID, VAPS_RPT_INTV_DMSN. RPT_INTV_ID ORDER BY VAPS_RPT_INTV_DMSN. RPT_ID, VAPS_RPT_INTV_DMSN. RPT_INTV_ID) A2 AS (SELECT DISTINCT TAPS_REFERRALS_FACT. RPT_ID, TAPS_REFERRALS_FACT. DB2_UPDATE_DT, TAPS_REFERRALS_FACT. RPT_RECV_DT OF THE APS. TAPS_REFERRALS_FACT, APS. VAPS_RPT_CL_DMSN, APS. VAPS_RPT_CL_INTV_DMSN WHERE VAPS_RPT_CL_DMSN. RPT_ID = TAPS_REFERRALS_FACT. RPT_ID AND VAPS_RPT_CL_INTV_DMSN. RPT_CL_ID = VAPS_RPT_CL_DMSN. RPT_CL_ID AND TAPS_REFERRALS_FACT. EMRG_IND = '1') SELECT * FROM A1, A2 WHERE A1. RPT_INTV_ID = A2. RPT_INTV_ID

    [/ code]

    Thank you

    Seyed

    Right, A2 is not column named RPT_INTV_ID.

    SY.

  • Could not commit: ORA-00928: lack of creating the table SELECT keyword

    Hello guys.
    I tried to create the table with web interface on oracle 11g.

    I just follow this path on interface: schema-> table-> create-> standard (lot organized)-> SQl select on (set using the)->
    and I just use these scripts to create the table:

    CREATE TABLE suppliers
    (the number (10) of supplier_id not null,)
    supplier_name varchar2 (50) not null,
    Contact_Name varchar2 (50)
    );

    but this error occurred: failed to commit: ORA-00928: lack of SELECT key word!
    Please lock on this picture for more information: http://s17.postimg.org/kgoumzmvz/attachment.jpg

    could you help me please?
    and I could not find any manual for working with the web interface in oracle 11g.
    Please give me somesources to start.
    Thank you.

    1003778 wrote:
    Thank you sybrand_b
    but I already read this document.
    Unfortunately, there is nothing on the creation of table with sql scripts in this document!

    and I really don't understand how to create table with SQL commands! My question has not yet been answered.
    you please give me little details about it?
    for example, how can create table using this sql command:

    CREATE TABLE suppliers
    (the number (10) of supplier_id not null,)
    supplier_name varchar2 (50) not null,
    Contact_Name varchar2 (50)
    );

    Thank you.

    Edited by: 1003778 may 3, 2013 11:43

    When you got to the CREATE TABLE screen, you have selected "set using the--> SQL.
    Did you notice in the window that appears, just above this entry field is this text: "enter a SQL * select * statement below.» ' + This query results will be used to fill the table with Canada.* + "(underlining)
    And hip, just to the left of this field is this text: «CREATE TABLE AS»

    He tries to build a ' CREATE TABLE AS SELECT... ». Creates a table with the same structure as the table in which you SELECT and fills with the results of this SELECT '. With your entry, you create a CREATE TABLE AS CREATE TABLE to read statement...

    If you want to create your tables with a simple CREATE TABLE command, go to sqlplus and do it. You want to have a graphical interface to help build a simple CREATE table, when you get to the CREATE TABLE page, just to stay there with the default "use Define-> column specification." If you want, after completing "build" your table specification here, you will have a "Show sql" option to show you the actual sql statement that will be executed to create your table.

  • ORA-00928: lack of SELECT keyword

    Hello
    My version of oracle 9i, I need to use a dynamic array
    I use the query but I'm below receive the error-ORA-00928: lack of SELECT keyword

    declare

    o_error_message VARCHAR2 (500);

    l_query varchar2 (2000);
    HEADER_TABLE VARCHAR2 (30);


    BEGIN
    Select TABLE_NAME in HEADER_TABLE
    from sys.all_tables
    where
    Upper (table_name) = Upper ('cd_alloc_header_conv');

    for r_allocconv in
    (SELECT t.ORDER_NO
    Of
    shconv. CD_ORDER_CONV_TRACK t
    WHERE
    t.RMS_update_status = 'Y' AND
    t.ALLOC_UPDATE_STATUS =' only)

    loop

    l_query: ='(insert en shconv.) CD_ALLOC_HDR_ACT_CONV (ALLOC_NO,
    ORDER_NO,
    WH,
    SKU,
    STATUS,
    ALLOC_DESC,
    PO_TYPE,
    ALLOC_METHOD,
    RELEASE_DATE,
    ALLOC_TYPE,
    ALLOC_RIB_STATUS,
    CREATED_BY,
    CREATE_DATE,
    UPDATED_BY,
    UPDATE_DATE,
    CREATE_PGM_NAME,
    ROW_ID,
    EXCEPTION_DETAILS,
    CONV_UPDATED_STATUS) select * from shconv.' | HEADER_TABLE | "WHERE order_no =' | r_allocconv.order_no |') ' ;

    run immediately l_query;

    END LOOP;

    EXCEPTION

    WHILE OTHERS THEN
    o_error_message: = "error in CD_ALLOC_CONV_MAIN" | substr (SQLERRM, 1, 250);
    dbms_output.put_line (o_error_message);



    END;

    ORA-00928: lack of SELECT keyword

    Please suggest

    Hello

    990047 wrote:
    ...
    l_query: ='(insert en shconv.) CD_ALLOC_HDR_ACT_CONV (ALLOC_NO,

    ...

    CONV_UPDATED_STATUS) select * from shconv.' | HEADER_TABLE | "WHERE order_no =' | r_allocconv.order_no |') ' ;

    I don't think you want to Try parentheses

    l_query   := 'insert into shconv.CD_ALLOC_HDR_ACT_CONV(ALLOC_NO,
    ...
    CONV_UPDATED_STATUS) select * from shconv.' || HEADER_TABLE ||' WHERE order_no=' ||r_allocconv.order_no;
    

    I wonder if you have the best table design for what you need.
    Apparently, you have mulitple header_tables, who are all pretty similar. Would it not be simpler if you just had a header_table, with a column that distinguishes the lines that are now in separate tables? Her you wouldn't need dynamic SQL code at all. This work would be much simpler, more efficient and more robust.

    I hope that answers your question.
    If this isn't the case, after a complete test script that people can run to recreate the problem and test their ideas.

  • Query cannot be parsed in the generator. If you believe that your query is syntactically correct, check the generic "columns" box below the source of the region without analysis. ORA-00905: lack of keyword

    Hi all

    I have create report sql in version 4.2, and now we have apex version 5.0 upgrade.

    I encountered error when I change the State of sql

    The error massage:

    Query cannot be parsed in the generator. If you believe that your query is syntactically correct, check the generic "columns" box below the source of the region without analysis. ORA-00905: lack of keyword

    My SQL

    SELECT VW.*

    , CASE WHEN (VW.file_code is null

    OR VW.cancel_flg = 'Y'

    OR (TOUR_DEP_DATE + GET_FILE_LOCKING_DAYS (VW. (SBU_CODE) < = trunc (sysdate))

    ) THEN

    ' < font color = "Red" > < b > other < /b > < / police > '

    ON THE OTHER

    "< a href =" f? p = & APP_ID.:51: & SESSION. : O PR: & DEBUG. : 51:P51_FILE_CODE, P51_COSTING_CODE, P51_TOUR_REG_NO, P51_VERSION_NO, P51_REQUEST, P51_AGENT_NAME, P51_ADULTS, P51_CHILDS, P51_MKT_CODE, P51_QUOT_CURR:'

    || FILE_CODE | «, » || COSTING_CODE | «, » || TOUR_REG_NO | «, » || VERSION_NO | «, » ||' OPR' | «, » || AGENT_CODE | «, » || VW. FROM_PAX | «, » || 0||','|| VW.mkt_code | ',' | VW. QUOT_CURR |': ' > < font color = blue > < b > other < /b > < / police > '. "

    END as "other Actions".

    , CASE WHEN ((VW.file_code is not null AND TOUR_DEP_DATE + GET_FILE_LOCKING_DAYS (VW. (SBU_CODE) < = TRUNC (SYSDATE))

    OR cancel_flg = 'Y '.

    OR (VW. REF_COSTING_CODE = VW. ADDL_FIELD2 AND VW. ADDL_FIELD1 LIKE '% COPIED FROM % OF APPROVAL'

    AND BOOKING_NAME LIKE "%-Backup")

    ) THEN

    ' < font color = "Red" > < b > edit < /b > < / police > '

    ON THE OTHER

    "< a href =" f? p = & APP_ID.:149: & SESSION. : & DEBUG. : 149:P149_COSTING_CODE:'

    || COSTING_CODE |': ' > < font color = blue > < b > edit < /b > < / police > '. "

    END AS 'Edit '.

    , CASE WHEN (Nvl (cancel_flg, 'n') = 'Y')

    )

    THEN

    ' < font color = "Red" > < b > add < /b > < / police > '

    ON THE OTHER

    "< a href =" f? p = & APP_ID.:33: & SESSION. : & DEBUG. : 33:P33_COSTING_CODE, P33_FILE_CODE, P33_MKT_CODE, P33_QUOT_CURR, P33_NO_OF_ADULT, P33_NO_OF_CHILD:'

    || COSTING_CODE | «, » || file_code | «, » || VW.mkt_code | ',' | VW. QUOT_CURR | «, » || VW. FROM_PAX | «, » || 0 | ': "> < font color = blue > < b > add < /b > < / police > '

    END as 'Services '.

    OF TOUR_MAS_VW VW

    How to solve it.

    Thank you

    Dear friends

    Thanks for your helping hands.

    I found the solution for this. We can solve this problem by using these solutions

    • A region of HTML:

      click me
      
    • Using PL/SQL:
      htf.anchor('f?p=100:5:'||V('APP_SESSION'),'click me');
      
    • Using a SQL query: SELECT htf.anchor('f?p=100:5:'||:APP_SESSION,'clickme') FROM DUAL;

    We can write the query in the form

    SELECT ' f? p = 100: 1 :'|| : APP_SESSION |': ' | : APP_UNIQUE_PAGE_ID |

    ': P1_EMPNO :'|| employe_id,

    first name,

    job_id

    Employees

    Thank you & best regards

    CORINE

  • ORA-00905: lack of keyword

    Hi all


    CREATE OR PACKAGE BODY ORDER_MANAGEMENT IS




    FUNCTION GETERROR (ERRORCODE NUMBER) RETURN VARCHAR2
    IS
    V_ERRORDESC VARCHAR2 (500)
    Error on line 1
    ORA-00905: lack of keyword
    V_ERRORCODE NUMBER (10);
    Error on line 9
    ORA-00900: invalid SQL statement
    CURSOR TEST_ERROR IS
    Error on line 10
    ORA-00900: invalid SQL statement
    SELECT TEXTE_ERREUR
    OF API_ERRORS
    WHERE ERROR_CODE = V_ERRORCODE
    *
    Error on line 3
    ORA-00904: "V_ERRORCODE": invalid identifier

    Any idea?

    Kai

    Line

    V_ERRORDESC VARCHAR2 (500);

    missing a semicolon.

    SY.

  • ASM &gt; ALTER DISKGROUP &gt; error: ORA-00905: lack of keyword

    Oracle 10.2.0.3.0 on RHEL 5 database

    SQL > create diskgroup data4
    external redundancy 2
    3 disc "ORCL:DATA4";

    DiskGroup created.

    SQL > ALTER DISKGROUP DATA4 SET the ATTRIBUTE "compatible.rdbms" = "10.1 ';
    ALTER DISKGROUP DATA4 SET the ATTRIBUTE "compatible.rdbms" = "10.1 '."
    *
    ERROR on line 1:
    ORA-00905: lack of keyword


    Is not the correct syntax? Please help... Thank you!

    SQL > alter diskgroup DATA4 set attribute "au_size" = "4 M";
    alter diskgroup DATA4 set attribute "au_size" = "4 M"
    *
    ERROR on line 1:
    ORA-00905: lack of keyword

    CipherDBA wrote:
    Hi, Aman-

    I have check the syntax before posting this message. I always get the error message, even if I believe that my syntax is correct.

    SET the ATTRIBUTE 'attributeName' = "attribute_value".

    Have you seen my 2nd answer where I asked that you are sure that 4 M size to THE East actually possible in 10g ASM (10203 your version) as far as I KNOW, this has begun to 11.1 from which can reach the size of the AU to a default value of 1 M 64 M. And this must explain the reason why your order is a failure since it was added in 11.1 Reference sql of the DSO. See 2nd link I gave.

    Aman...

  • ORA-00902 error invalid data type when you use CAST in the PL/SQL Package

    I'm getting ORA - 00902 Datatype not valid error when you use cast in getEmpValues (see code below) method in the package I created.
    I don't know what is the cause of the error. Any help would be appreciated



    CREATE OR REPLACE PACKAGE TEST. TEST_PKG AS

    ARRAY TYPE MyTableType IS NUMBER;
    TYPE REF_CURSOR IS REF CURSOR;

    FUNCTION str2tbl (p_str IN VARCHAR2)
    RETURN myTableType;

    PROCEDURE getContactValues (p_ParameterString IN VARCHAR2, p_Cursor1 to REF_CURSOR);

    END TEST_PKG;



    CREATE OR REPLACE PACKAGE BODY TEST. TEST_PKG AS

    FUNCTION str2tbl (p_str IN VARCHAR2)
    RETURN myTableType
    AS
    l_str LONG default p_str | ',';
    l_n NUMBER;
    myTableType l_data: = myTabletype();

    BEGIN
    LOOP

    l_n: = INSTR (l_str, ",");
    WHEN the OUTPUT (nvl(l_n,0) = 0);
    l_data.extend;
    l_data (l_data.count): = ltrim (rtrim (substr(l_str,1,l_n-1)));
    l_str: = substr (l_str, l_n + 1);
    END LOOP;
    L_data return;
    END;

    /*
    p_ParameterString is a string of the form 3, 6, 8, 9'
    */

    PROCEDURE getEmpValues (p_ParameterString IN VARCHAR2, p_Cursor1 to REF_CURSOR)
    AS


    BEGIN


    OPEN FOR P_Cursor1

    SELECT *.
    FROM EMP

    WHERE EMP_ID IN (SELECT *)
    OF THE (SELECT CAST (TEST.) (TEST_PKG.str2tbl (p_ParameterString) as myTableType) double)

    );
    END getEmpValues;

    END TEST_PKG;

    ARRAY TYPE MyTableType IS NUMBER;

    This type must be created outside of the package as a SQL type if it must be used in a select statement.

  • ORA-01403: no given available problem when you use FETCH of AUTOMATIC LINE to fill

    ORA-01403: no given available problem when you use FETCH of AUTOMATIC LINE to fill out a form.

    1) has created a FORM on the use of assistants of EMP. This creates an AUTOMATIC FETCH of LINE
    NAME OF THE TABLE - EMP
    The PRIMARY KEY containing - P2099_EMPNO point
    Primary key column - EMPNO

    By default, automatic extraction has a "process Error Message' of"Unable to fetch line."

    (2) created an HTML region. In this region add
    text P2099_FIND_EMPNO element
    GET_EMP submit button
    The update branch the conditional branch created when the Create button to set P2099_EMPNO with & P2099_FIND_EMPNO.

    If I then turn the page, enter an employee in P2099_EMPNO number and press the GET_EMP button, the form is filled correctly. But if I get an employee who does not exist, then I get error oracle ORA-01403: no data found and no form but a message at the top of the page 'Action transformed '. I was expecting a blank form is displayed with the message 'Could not extract line.'

    In conditioning automated extraction so that it checks that the line exists first, I can work around that. Change the fetch EMP automated line so that it is conditional
    EXIST (SQL query returns at least one row)

    Select 'x '.
    from EMP
    where EMPNO =: P2099_EMPNO


    But this means that when the employee exists I must be get DB twice, once to the State, and then again for the extraction of the actual line.

    I can't change so I don't get the Oracle error, rather than work around for a above is there something? I wonder now if the automatic extraction of line is only supposed to be used when you bind a report to a form and that I should manually write the extraction process. The reason for which I don't have at the moment, it is that I'm trying to stick with the auto generation Assistant as I can.

    Any ideas?

    Thanks, Pete

    Pete:

    The process Assistant APEX (ARF, ARP etc) errors are generally not recoverable. The error encountered is simply displayed on a page by using the model of "Error Message. So as you said yourself, you create your own process line Fetch and have the opportunity to customize the management mistakes, or you paste a validation on the page to verify that a folder can be accessed for the views expressed.

    CITY

  • When you create a new message in Windows Mail only some contact appear just by typing the first few letters of their name

    Original title: Windows mail contact probrem

    When you create a new email, why some of my E-mail contacts appear with just by typing the first letters of his name while other contacts in my list do not appear?

    for example, if I send an email to alan, so when I type the letter 'a' all contacts beginning with 'a' used to appear and you can select whatever you want. This is not the case now, and I have checked the contacts that do not appear are saved the same way as those that appear.

    Any suggestions please

    WinMail stores AutoComplete addresses in the registry and it has a maximum of 29. Claire on some dead wood.
     
     
    How to remove an address from the list of AutoComplete in Windows Mail
    http://email.about.com/od/windowsmailtips/Qt/et_del_autocomp.htm 
  • When you create a new site to replace your existing it publish you it to a new or existing site?

    When you create a new site to replace your existing it publish you it to a new or existing site?

    To replace or update an existing site, you must select the same site when downloading.

    If you create the new site then it will not replace the existing but would create a new site itself.

    Thank you

    Sanjit

  • When you create PDF from WORD 2010 files, can't do the TOC header as hyperlinks entries

    When you create PDF from WORD 2010 files, I can't have the TOC header as hyperlinks entries. I'm used to be able to do this in WORD 2003. I tried to create a PDF file in Acrobat by selecting file > create PDF > navigate to the WORD file > select three check boxes >

    Help them get the entries in TOC topic as hyperlinks?

    Try to do this from Word by using the Ribbon.

  • Get the blue screen when you create a new message or the response message in OWA Exchange 2007

    Get the blue screen when you create a new message or the response message in OWA (Exchange 2007)

    Hello

    I suggest you post the question in the forums and check them off below if it helps:

    http://social.technet.Microsoft.com/forums/en-us/exchangesvrclients/

    It will be useful.

  • When you create a new email a first letter of the contact request full email address on frequent contacts.

    original title: contact prompting

    When you create a new email a first letter of the contact request full email address on frequent contacts. How to extend the time, what he remembers of those contacts?

    WinMail remembers only 29 addresses used through the registry. These links will give you a few options.

    How to delete registration completion email in Windows Mail
    http://www.Winhelponline.com/articles/245/1/how-to-clear-the-email-auto-complete-entries-in-Windows-mail.html

    How to remove an address from the list of AutoComplete in Windows Mail
    http://email.about.com/od/windowsmailtips/Qt/et_del_autocomp.htm

Maybe you are looking for