SQL Error: Invalid identifier ORA-00904

Hello

The Version of SQL Developer: 11g

Two tables: nav_vendors (source), vendor (destination)

Both having 16 'Same' columns (data will differ for some records of... for some data records are same to check the process DML works according to the need).

I'm trying to insert update and delete using merge operation

I m getting error below whenever I tried to merge them. All column names are the same in the table.

SQL error: ORA-00904: "S". "" COMPANY_CODE ": invalid identifier

SQL:

MERGE INTO s source

USING (nvl (d.VENDOR, s.VENDOR) selection of the SELLER,

NVL (d.Name, s.Name) NAME.

NVL (d.NAME3, s.NAME3) Name3,

NVL (d.ADDRESS1, s.ADDRESS1) address1.

NVL (d.DISTRICT, s.DISTRICT) DISTRICT.

NVL (d.CITY, s.CITY), CITY,

NVL (d.Country, s.Country) COUNTRIES.

NVL (d.Postcode, s.Postcode) ZIP Code,

NVL (d.TELEPHONE, s.TELEPHONE), PHONE,.

NVL (d.Fax, s.Fax) FAX.

NVL (d.contact, s.contact) CONTACT.

NVL (d.URL, s.URL) URL.

NVL (d.email, s.email) EMAIL.

NVL (d.DELIVERY_TOLERANCE, s.DELIVERY_TOLERANCE) DELIVERY_TOLERANCE.

NVL (d.EXCLUDE_REWORK_TEXT, s.EXCLUDE_REWORK_TEXT) EXCLUDE_REWORK_TEXT.

NVL (d.COMPANY_CODE, s.COMPANY_CODE) COMPANY_CODE.

(case

When ((d.VENDOR = s.VENDOR)

and (d.NAME = s.NAME)

and (d.NAME3 = s.NAME3)

and (d.ADDRESS1 = s.ADDRESS1)

and (d.DISTRICT = s.DISTRICT)

and (d.CITY = s.CITY)

and (d.COUNTRY = s.COUNTRY)

and (d.POSTCODE = s.POSTCODE)

and (d.TELEPHONE = s.TELEPHONE)

and (d.FAX = s.FAX)

and (d.CONTACT = s.CONTACT)

and (d.URL = s.URL)

and (d.EMAIL = s.EMAIL)

and (d.DELIVERY_TOLERANCE = s.DELIVERY_TOLERANCE)

and (d.EXCLUDE_REWORK_TEXT = s.EXCLUDE_REWORK_TEXT)

and (d.COMPANY_CODE = s.COMPANY_CODE))

then "correspondence".

When d.COMPANY_CODE is null

then 'DELETE '.

When s.COMPANY_CODE is null

then "INSERT."

on the other

"no match."

chck end)

of s nav_vendorz

full outer join of the seller d

On(d.COMPANY_CODE=s.COMPANY_CODE)

) d

(S.COMPANY_CODE = d.COMPANY_CODE AND (in d.chck ("not matched", 'match', 'DELETE')))

WHEN MATCHED THEN

->UPDATE SET s.company_code = d.company_code <-error line

WHERE in d.chck ("not matched", "DELETE")

DELETE WHERE d.chck = 'DELETE '.

WHEN NOT MATCHED THEN

INSERT (VENDOR, NAME, ADDRESS1, NAME3, NEIGHBORHOOD, CITY, COUNTRY, CODE POSTAL, PHONE, FAX, CONTACT, URL, EMAIL, DELIVERY_TOLERANCE, EXCLUDE_REWORK_TEXT, COMPANY_CODE)

VALUES

(d.VENDOR, d.NAME, d.NAME3, d.ADDRESS1, d.DISTRICT, d.CITY, d.COUNTRY, d.POSTCODE, d.TELEPHONE, d.FAX, d.CONTACT, d.URL, d.EMAIL, d.DELIVERY_TOLERANCE,d.EXCLUDE_REWORK_TEXT,d.COMPANY_CODE);/

(1) use different alias names

(2) do not try to update a column that is used to 'ON' clause.

Tags: Database

Similar Questions

  • Invalid identifier ORA-00904

    Hello.

    This error

    Error starting at line 1 in command:
    select consulta_ingrediente('Sal','Miguel Goyanes') from dual
    Error at Command Line:1 Column:7
    Error report:
    SQL Error: ORA-00904: "CONSULTA_INGREDIENTE": invalid identifier
    00904. 00000 -  "%s: invalid identifier"
    *Cause:    
    *Action:
    The procedure is:
    create or replace
    PROCEDURE consulta_ingrediente(produto IN INGREDIENTE.PRODUTO%TYPE, user_name IN UTILIZADOR.U_NOME%TYPE) IS
         CURSOR consulta IS
            SELECT energia_kcal, total_hc_disponiveis,proteina,gordura_total FROM INGREDIENTE
            WHERE PRODUTO = produto;
         
    privilegios UTILIZADOR.U_PRIVILEGIOS%TYPE;
    
    calorias ingrediente.energia_kcal%TYPE;
    hidratos_carbono ingrediente.total_hc_disponiveis%TYPE;
    proteinas ingrediente.proteina%TYPE;
    gordura ingrediente.gordura_total%TYPE;
    
    BEGIN
         SELECT utilizador.U_PRIVILEGIOS INTO privilegios
         FROM utilizador
         WHERE utilizador.U_NOME = user_name;     
         
      OPEN consulta;
         IF privilegios = 0 THEN
              FETCH consulta INTO calorias, hidratos_carbono, proteinas, gordura;
        CLOSE consulta;
         END IF;
    END;
    Why I get this error?

    Published by: 898791 on 10/Dec/2011 09:05

    You can try to execute consulta_ingrediente ('Sal', 'Miguel Goyanes');

  • HELP: instr() error - invalid identifier

    Hello

    Query is attack on this line:

    instr(hntl.note_text, "Critical and/or Actionable") != 0
    

    Error:

    ORA-00904: "criticism and/or action": invalid identifier

    00904, 00000 - '% s: invalid identifier '.

    note_text column is of type varchar (2000)

    How can I make this work?

    Hello

    In Oracle SQL, string literals are enclosed in single quotes, not double - quote.  You probably want to

    ... instr (hntl.note_text, "Criticism and/or Actionable")! = 0

    Note that SQL differs from SQL * more in this regard.  In SQL * Plus, - single and double quotes are often used interchangeably.  In SQL, they always have a different meaning.

    In Oracle SQL, quotation marks are used in identifiers (such as table names or column) which are not conform to the normal rules of naming.  For example, the column names cannot usually contain special characters such as spaces or slashes (' / ').  If you really want to have a column that is named

    Criticism or action

    you will then need to with the spaces and the bar slash, surround it with quotation marks.  That's exactly what the system thought you were doing: he thought you were trying to refer to a column called 'Critical and/or usable' and, when he couldn't find a column with this name, it gave you an error indicating that the column name was not fair.

  • ODI: Error invalid identifiers in "insert stream I$ table. '

    Hello

    I am trying to write a temporary interface (yellow), which will act as a source for a standard interface (in blue).

    However when I run the standard interface, I get the error on step 8 - integration: Insert flow I$ table

    ODI-1228: CR_2 (integration) task fails on the connection target ORACLE ORACLE_Local.

    Caused by: java.sql.SQLSyntaxErrorException: ORA-00904: "T". "" R_id ": invalid identifier

    The target code:

    / * DETECTION_STRATEGY = NOT_EXISTS * /.

    Insert / * + append * / in THE_SCHEMA. I _CR_TABLE $

    (

    CNUMBER,

    R_ID,

    IND_UPDATE

    )

    Select

    CNUMBER,

    R_ID,

    IND_UPDATE

    de)

    Select

    C1_CNUMBER CNUMBER,

    C2_R_ID R_ID,

    'I' IND_UPDATE

    of THE_SCHEMA. C$ _0CR_TABLE

    where (1 = 1)

    ) S

    If NOT EXISTS

    (select 1 from THE_SCHEMA. CR_TABLE T

    where T.R_ID = S.R_ID

    and ((T.CNUMBER = S.CNUMBER) or (T.CNUMBER IS NULL and S.CNUMBER IS NULL))

    )

    Source : DB2 v9.1.0.7,.

    Target : database Oracle 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    ODI v11.1.1

    On the standard interface:

    I set the box "use the temporary interface as an underlying table (subselect).

    R_ID field on the target table is the key field. It is mapped to one of the fields in the interface of temp and it the value "run on: Source" with set of Insert and Update check boxes.

    I use SQL LKM for Oracle components to get the data from the interface of the target temp.

    On the interface of temp:

    No key for each field in the target field

    IKM DB2 using updated incremental, FLOW_CONTROL with STATIC_CONTROL set to false.

    Any help would be greatly appreciated!

    In the target database, I changed the name of the field R_ID... but I forgot to update this column in the ODI of the table model. Once I have updated the model and mappings, the interface ran as expected.

  • criticism: Error invalid identifier in interface

    Hello

    I have 3 identical ODI viz Dev, Test, and production environments.
    We develop packages in Dev and migrate them to Test to test and when everything works well in the Test then move to prod.
    Now, I created a package which is kind of transformation type of package that collects data from other tables and put in unique tables based on rules and the different filters.

    The problem here, I do face is that I have the package which is fine workmanship in dev and tests but gives me error in Prod which seems such DB error.
    Error is given in session task interfaces control of PK inserting errors and the error is as

    ODI-1217: INT_GEN_BSMASTERTYRE Session (69702202) fails with return code 904.
    ODI-1226: step INT_GEN_BSMASTERTYRE fails after 1 attempt.
    ODI-1240: Flow INT_GEN_BSMASTERTYRE fails during a control operation. This flow of charge table target NEWBSMASTERTYRE.
    ODI-1228: task failed NEWBSMASTERTYRE (control) on the target of connection ORACLE OMP.
    Caused by: java.sql.SQLSyntaxErrorException: ORA-00904: "MASTERUNITID": invalid identifier
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)

    MASTERUNITID is now field that is present in all tables target of Dev, Test, Prod, but still I get this error.
    Please help me to solve this error. What would be the cause of this error.

    all entries would be useful.


    Thank you
    Mahesh

    MaheshGx wrote:
    Hello

    I have 3 identical ODI viz Dev, Test, and production environments.
    We develop packages in Dev and migrate them to Test to test and when everything works well in the Test then move to prod.
    Now, I created a package which is kind of transformation type of package that collects data from other tables and put in unique tables based on rules and the different filters.

    The problem here, I do face is that I have the package which is fine workmanship in dev and tests but gives me error in Prod which seems such DB error.
    Error is given in session task interfaces control of PK inserting errors and the error is as

    ODI-1217: INT_GEN_BSMASTERTYRE Session (69702202) fails with return code 904.
    ODI-1226: step INT_GEN_BSMASTERTYRE fails after 1 attempt.
    ODI-1240: Flow INT_GEN_BSMASTERTYRE fails during a control operation. This flow of charge table target NEWBSMASTERTYRE.
    ODI-1228: task failed NEWBSMASTERTYRE (control) on the target of connection ORACLE OMP.
    Caused by: java.sql.SQLSyntaxErrorException: ORA-00904: "MASTERUNITID": invalid identifier
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)

    MASTERUNITID is now field that is present in all tables target of Dev, Test, Prod, but still I get this error.
    Please help me to solve this error. What would be the cause of this error.

    all entries would be useful.

    Thank you
    Mahesh

    Hello

    The following applies to your case?

    You have a target say XYZ table, on which you have defined the Frother.
    Evety works very well.
    Now, you have added a new column say Col1 in XYZ, regenarated the script and try to run it.
    This operation fails with error ORA-00904: invalid identifier ' Col1'

    This is due to the fact, ODI creats the error table (E$) once and then use the same table for any Sub sequent performance. If there is no change in the target table, this change does not get propagated to the table structure of $ E.

    If the above is true, then you have two options.
    1 > drop the E$ _
    Then ODI will create the table for you and that it will be "Col1" columns.
    2 > manually change the E$ _ and add the missing column there.

    Thank you
    Fati

  • Apps BI - workflow task has received the error "invalid identifier".

    Hi all

    I'm loading acreage subject of projects using the client CAD for 11.5.10 container. And my Oracle EBS 11.5.10 only data source. Few of the workflow tasks failed. For example: "SDE_ORA_TaksDimension." When I checked the logs of session, its display like "ORA-00904 'PA_PROJ_ELEMENT_VERSIONS'." FINANCIAL_TASK_FLAG ': invalid identifier "error of a few paintings of projects (PA). I checked in the database to Oracle 11.5.10 and noticed that the column (FINANCIAL_TASK_FLAG) itself is not there in the table (PA_PROJ_ELEMENT_VERSIONS).
    I also checked SDE_ORA_TaksDimension in "SDE_ORA11510_Adaptor" mapping in the table PA_PROJ_ELEMENT_VERSIONS Design, Informatica PowerCenter Workflow is to have the column with "FINANCIAL_TASK_FLAG".

    In other words, there are some differences between available "SDE_ORA11510_Adaptor" and Oracle EBS 11.5.10 database. Could someone please help me or guide me to solve this problem?

    Thank you
    Harish Nunn

    This is probably because you do not have the PRE REQUISIUTE following for PROJECT ANALYTICS for 11.5.10:

    requires the Family Pack M (11i. PJ_PF. (M) to be applied to Oracle eBusiness Suite 11.5.10.

    You need to run the analytical project.

    Check the answer as CORRECT

  • Get the error invalid identifier in the left outer join

    I wrote a query and get the invalid identifier error during execution:
    the exact error is: ORA-00904: "D". "" ACCT_NO ": invalid identifier
    This query is not able to access the parent table alias in the subquery of the left outer join.

    This is the query:
    SELECT D.PROD_DESC_TX, BASE. ASSET_NUM, BASE. PROD_ID, BASE.NAME
    OF TABLE1 D
    LEFT OUTER JOIN
    (
    SELECT ASSET_NUM, PROD_ID, B.SID
    FROM TABLE2 E
    JOIN IN-HOUSE TABLE3 HAS IT E.PROD_ID = A.ROW_ID
    JOIN INTERNAL TABLE 4 C ON A.PAR_PROD_INT_ID = C.ROW_ID
    INTERNAL TABLE5 JOIN B ON C.ROW_ID = B.PAR_ROW_ID
    AND B.TYPE = 'VALUE '.
    AND B.NAME = 'VALUE '.
    WHERE E.ASSET_NUM = ((CASE WHEN LTRIM (RTRIM (D.BANK_NO)) = '021 ' THEN '021' ELSE ' 020' END) |) LTRIM (RTRIM (D.APPL_CD)). LTRIM (RTRIM (D.ACCT_NO)))
    ) BASE ON ((CASE WHEN LTRIM (RTRIM (D.BANK_NO)) = '021 ' THEN '021' ELSE ' 020' END) |) LTRIM (RTRIM (D.APPL_CD)). LTRIM (RTRIM (D.ACCT_NO))) = BASE. ASSET_NUM
    WHERE D.BANK_NO = 'VALUE '.
    AND D.APPL_CD = 'VALUE '.
    AND D.ACCT_NO = 'VALUE '.

    Edited by: user648525 13 Sep, 2011 01:21

    I can easily look at your request at this time (using my iPhone on a train).

    But trying out this line in the WHERE (the one with the invalid reference) clause in the main query.

    Who is... in the view of inline, use only the logic of the join (the clauses).

    Overflow the filtering logic (WHERE clause) to the main request. You may need to select some additional inline view columns to make these references work.

  • What is the problem with my sql says invalid identifier

    CREATE THE TABLE PROJECT

    (proj # NUMBER (6) NOT NULL,)

    p_name VARCHAR2 (15) NOT NULL,

    p_desc VARCHAR2 (150) NOT NULL,

    p_budget NUMBER (8).

    CONSTRAINT project_proj PRIMARY KEY #pname_pk (proj #, p_name));

    CREATE TABLE WORK ORDERS

    (wo # NUMBER (6))

    proj # NUMBER (6).

    wo_desc VARCHAR2 (150).

    wo_assigned VARCHAR2 (30),

    wo_hours NUMBER (5),

    wo_start DATE,

    wo_due DATE,

    wo_complete char (1),

    CONSTRAINT workorders_wo #_pk KEY(wo#) primary SCHOOL.

    CONSTRAINT workorders_wo #_fk FOREIGN KEY (proj #)

    REFERENCES PROJECT (proj #).

    Workorders_wodesc_uk of CONSTRAINT UNIQUE (wo_desc).

    CONSTRAINT workorders_hours_ck CHECK (wo_hours > = 0).

    CONSTRAINT workorders_wocomplete_ck CHECK (wo_complete in ('Y', 'n')));

    Whenever you have an error message the best thing to do is post a copy of your session with your statement sqlplus output. Like this.

    I have no problem with your first statement regarding the syntax and semantics

    SQL> create table project
      2  (
      3  proj# number(6) not null,
      4  p_name varchar2(15)not null,
      5  p_desc varchar2(150)not null,
      6  p_budget number(8),
      7  constraint project_proj#pname_pk primary key (proj#, p_name)
      8  );
    
    Table created.
    

    Second table a problem that his tent to make reference to project.proj #. But the problem is that it doesn't have a primary or unique key defined in this topic.

    SQL> create table workorders
      2  (
      3  wo# number(6),
      4  proj# number(6),
      5  wo_desc varchar2(150),
      6  wo_assigned varchar2(30),
      7  wo_hours number(5),
      8  wo_start date,
      9  wo_due date,
     10  wo_complete char(1),
     11  constraint workorders_wo#_pk primary key(wo#),
     12  constraint workorders_wo#_fk foreign key (proj#)
     13  references project (proj#),
     14  constraint workorders_wodesc_uk unique (wo_desc),
     15  constraint workorders_hours_ck check (wo_hours >=0),
     16  constraint workorders_wocomplete_ck check (wo_complete in ('y' ,'n'))
     17  );
    references project (proj#),
                        *
    ERROR at line 13:
    ORA-02270: no matching unique or primary key for this column-list
    

    I defined a

    SQL> alter table project add constraint project_proj#_uk unique (proj#);
    
    Table altered.
    

    Now, the second table is also created correctly

    SQL> create table workorders
      2  (
      3  wo# number(6),
      4  proj# number(6),
      5  wo_desc varchar2(150),
      6  wo_assigned varchar2(30),
      7  wo_hours number(5),
      8  wo_start date,
      9  wo_due date,
     10  wo_complete char(1),
     11  constraint workorders_wo#_pk primary key(wo#),
     12  constraint workorders_wo#_fk foreign key (proj#)
     13  references project (proj#),
     14  constraint workorders_wodesc_uk unique (wo_desc),
     15  constraint workorders_hours_ck check (wo_hours >=0),
     16  constraint workorders_wocomplete_ck check (wo_complete in ('y' ,'n'))
     17  );
    
    Table created.
    
    SQL>
    

    My Version of DB's

    SQL> select * from v$version where rownum = 1;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    
    SQL>
    
  • TO_CHAR function gives an error "Invalid number" - ORA - 01722

    I will execute under query in Oracle 11 g.

    Select to_char (nvl ("2013-08-12', to_date (1 January 1924 ',' DD-MON-YY')"), ' mm/dd/yyyy') FROM dual;

    But I got error below.

    ORA-01722: invalid number

    01722 00000 - "invalid number."

    * Cause:

    * Action:

    A know all work around that. Your help is very appreciated.

    Like this.

    SELECT TO_CHAR)

    NVL (TO_DATE ('2013-08-12', 'YYYY-MM-DD'),)

    TO_DATE (1 JANUARY 1924 ', 'DD-MON-YYYY')),

    'mm/dd/yyyy')

    conv_to_char

    FROM DUAL;

    -----------------------------------------

    CONV_TO_CHAR

    -------

    12/08/2013

    See you soon,.

    Manik.

  • Error - invalid identifier

    Hello

    Get the identifier not valid error query below

    Select * from c2s_tbl where tbl_name in (c2m_client
    c2m_client_a
    c2m_client_p
    c2m_exp2lim
    c2m_exp2lim_diff
    c2m_exposure
    c2m_exposure_a
    c2m_limit
    c2m_limit_a
    c2m_limit_acl
    c2m_limit_diff
    c2m_limit_diff_sum
    c2m_limit_err
    c2m_limit_exp
    c2m_limit_irb
    c2m_limit_irb_pr_k_dil
    c2m_limit_k_dil
    c2m_limit_p
    c2m_limit_rc
    c2m_ls
    c2m_ls_a
    c2m_ls_irb
    c2m_ls_secu_id
    c2m_rating
    c2m_rating_a
    c2n_gl
    c2m_limit_a_tot
    c2u_exp_pk_tmp
    c2u_cost_of_funds
    c2u_cost_of_funds_err
    c2u_xr
    c2u_secu_pk_tmp
    c2uu_sys_map
    c2uu_limit
    c2uu_exp
    c2uu_ls
    c2uu_prov
    c2uu_rating_borr
    c2uu_rating_limit
    c2uu_rating_secu
    c2uu_client
    c2uu_client_group
    c2ud_sys_map
    c2ud_limit
    c2ud_exp
    c2ud_ls
    c2ud_prov
    c2ud_rating_borr
    c2ud_rating_limit
    c2ud_rating_secu
    c2ud_client
    c2ud_client_group
    c2ud_log_rows
    c2u_bk_facility_err
    c2u_bk_facility
    c2t_gl
    c2ux_xr_ar_diff
    c2u_ccy_cf_err
    c2u_client
    c2u_client_err
    c2u_client_map
    c2u_client_master
    c2u_client_master_err
    c2u_client_pk_tmp
    c2u_exposure
    c2u_exposure_err
    c2u_gl
    c2u_gl_err
    c2u_limit
    c2u_limit_err
    c2u_limit_pk_tmp
    c2u_ls
    c2u_ls_err
    c2u_log_rows
    c2u_log_rows_row4id
    c2u_pool
    c2u_rating
    c2u_rating_borr_err
    c2u_rating_limit_err
    c2u_rating_sec_err
    c2u_stat
    chn_upload
    c2u_prov
    c2u_prov_err
    c2u_client_group
    c2u_client_group_err
    c2ru_bk_gl
    c2ru_bk_gl_err
    c2ccu_cust_sales
    c2ccu_cust_sales_err
    c2r_obs
    c2r_car
    c2m_limit_id_diff
    chn_temp_retail_err
    c2ub_client_pk_tmp
    c2ub_limit_pk_tmp
    c2ub_exposure_pk_tmp
    c2ub_security_pk_tmp
    c2u_client_crar
    c2u_client_crar_err
    c2ua_sys_map
    c2ua_limit
    c2ua_exp
    c2ua_ls
    c2ua_prov
    c2ua_rating_borr
    c2ua_rating_limit
    c2ua_rating_secu
    c2ua_client
    c2ua_client_group
    c2ub_sys_map
    c2ub_limit
    c2ub_exp
    c2ub_ls
    c2ub_prov
    c2ub_rating_borr
    c2ub_rating_limit
    c2ub_rating_secu
    c2ub_client
    c2ub_client_group
    c2uv_sys_map
    c2uv_limit
    c2uv_exp
    c2uv_ls
    c2uv_prov
    c2uv_rating_borr
    c2uv_rating_limit
    c2uv_rating_secu
    c2uv_client
    c2uv_client_group
    c2uf_sys_map
    c2uf_limit
    c2uf_exp
    c2uf_ls
    c2uf_prov
    c2uf_rating_borr
    c2uf_rating_limit
    c2uf_rating_secu
    c2uf_client
    c2uf_client_group
    c2up_sys_map
    c2up_limit
    c2up_exp
    c2up_ls
    c2up_prov
    c2up_rating_borr
    c2up_rating_limit
    c2up_rating_secu
    c2up_client
    c2up_client_group
    c2m_tb
    c2u_client_ai
    c2u_client_ai_err
    c2u_limit_ai
    c2u_limit_ai_err
    c2u_exposure_ai
    c2u_exposure_ai_err
    c2u_ls_ai
    c2u_ls_ai_err
    c2u_client_master_ai
    c2u_client_master_ai_err
    c2u_control
    c2u_control_err
    c2u_upload_log
    c2m_client_ai
    c2m_client_master_ai
    c2m_limit_ai
    c2m_exposure_ai
    c2m_ls_ai
    c2u_irb_xr)

    Kindly help

    table_name is varchar, so keep the values in single quotes

    select * from c2s_tbl where tbl_name in ('c2m_client'
    ,'c2m_client_a'
    , 'c2m_client_p'
    , 'c2m_exp2lim'
    , 'c2m_exp2lim_diff'
    ...
    ....
    );
    
  • HELP-immediate execution in PL/SQL has received the error ORA-00904: invalid identifier

    What is the problem with the following codes from PL/SQL (actually it comes to Oracle Metalink Note: 313175.1):
    ===========
    declare
    cursor c1 is select * from $ semantic;
    v_statement VARCHAR2 (255);
    v_nc number (10);
    v_nt number (10);
    Start
    immediate execution
    "select count (*) from $ semantics" in v_nc;
    immediate execution
    ' select count (distinct s_table_name) of semantics$ "in v_nt;
    dbms_output.put_line
    ('Edit' | v_nc |) 'columns ' | v_nt | "tables");
    to r1 c1 loop
    v_statement: = 'ALTER TABLE ' | R1.s_owner | '.' || R1.s_table_name;
    v_statement: = v_statement | «change (' |)» R1.s_column_name | ' ';
    v_statement: = v_statement | R1.s_data_type | ' (' | r1.s_char_length;)
    v_statement: = v_statement | ' CHAR))';
    immediately run v_statement;
    end loop;
    dbms_output.put_line ('Done');
    end;
    /
    =====
    Executed once the codes as sysdba against 10gr 2 database, I got this error:
    From build to select columns to change
    Editing columns 4428 35249
    declare
    *
    ERROR on line 1:
    ORA-00904: invalid identifier
    ORA-06512: at line 22

    I see nothing wrong with the line of "immediate execution". I appreciate your help!

    Thank you.

    Hello
    Try to print the offending instruction using exception, I used small test cases by changing the pl/sql block, you may need to change to respond to all other types of data in this table.

    CREATE TABLE semantics$
    AS
       SELECT USER AS owner,
              table_name,
              data_type AS s_data_type,
              column_name,
              data_length AS s_char_length
       FROM cols
       WHERE table_name = 'MY_OBJECTS';
    
    DECLARE
       CURSOR c1
       IS
          SELECT *
          FROM semantics$;
    
       v_statement   VARCHAR2 (255);
       v_nc          NUMBER (10);
       v_nt          NUMBER (10);
    BEGIN
       EXECUTE IMMEDIATE 'select count(*) from semantics$' INTO v_nc;
    
       EXECUTE IMMEDIATE 'select count(distinct table_name) from semantics$'
          INTO v_nt;
    
       DBMS_OUTPUT.put_line(   'ALTERing '
                            || v_nc
                            || ' columns in '
                            || v_nt
                            || ' tables');
    
       FOR r1 IN c1
       LOOP
          v_statement   := 'ALTER TABLE ' || r1.owner || '.' || r1.table_name;
          v_statement   := v_statement || ' modify (' || r1.column_name || ' ';
          v_statement   :=
             v_statement || r1.s_data_type || '(' || r1.s_char_length;
    
          IF (r1.s_data_type = 'NUMBER')
          THEN
             v_statement   := v_statement || '))';
          ELSE
             v_statement   := v_statement || ' CHAR))';
          END IF;
    
          DBMS_OUTPUT.put_line (v_statement);
    
          -- EXECUTE IMMEDIATE v_statement;
       END LOOP;
    
       DBMS_OUTPUT.put_line ('Done');
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.put_line ('Statement = ' || v_statement);
          DBMS_OUTPUT.put_line (SUBSTR (SQLERRM, 1, 200));
          RAISE;
    END;
    

    _ Output

    ALTERing 13 columns in 1 tables
    ALTER TABLE MY_OBJECTS modify (OWNER VARCHAR2(30 CHAR))
    ALTER TABLE MY_OBJECTS modify (OBJECT_NAME VARCHAR2(30 CHAR))
    ALTER TABLE MY_OBJECTS modify (SUBOBJECT_NAME VARCHAR2(30 CHAR))
    ALTER TABLE MY_OBJECTS modify (OBJECT_ID NUMBER(22))
    ALTER TABLE MY_OBJECTS modify (DATA_OBJECT_ID NUMBER(22))
    ALTER TABLE MY_OBJECTS modify (OBJECT_TYPE VARCHAR2(19 CHAR))
    ALTER TABLE MY_OBJECTS modify (CREATED DATE(7 CHAR))
    ALTER TABLE MY_OBJECTS modify (LAST_DDL_TIME DATE(7 CHAR))
    ALTER TABLE MY_OBJECTS modify (TIMESTAMP VARCHAR2(19 CHAR))
    ALTER TABLE MY_OBJECTS modify (STATUS VARCHAR2(7 CHAR))
    ALTER TABLE MY_OBJECTS modify (TEMPORARY VARCHAR2(1 CHAR))
    ALTER TABLE MY_OBJECTS modify (GENERATED VARCHAR2(1 CHAR))
    ALTER TABLE MY_OBJECTS modify (SECONDARY VARCHAR2(1 CHAR))
    Done
    

    Concerning

    Published by: OrionNet on January 5, 2009 23:53

    Published by: OrionNet on January 5, 2009 23:55

  • Why this error ORA-00904: invalid identifier

    Hi all
    Please advice me what is wronge with this
    ORA-00904: "NONE": invalid identifier


    create or replace trigger test_table2
    before inserting
    on Ta
    for each line
    declare
    v2_none_con varchar2 (20);
    v2_none_con2 varchar2 (20);
    I have number (10);
    TYPE v2_EmpCurTyp IS REF CURSOR;
    v2_emp_cursor v2_EmpCurTyp;
    v2_stmt_str VARCHAR2 (200);
    RECORD IS of TYPE v2_employee_type (v_rowid varchar (100));
    v2_emp_content v2_employee_type;
    Start

    v2_none_con2: = 'NONE ';

    v2_stmt_str: = 'select rowid from t1 where name =' v2_none_con2;
    I: = 0;
    V2_emp_cursor OPEN FOR v2_stmt_str;
    LOOP FETCH v2_emp_cursor INTO v2_emp_content;
    EXIT WHEN v2_emp_cursor % NOTFOUND;
    dbms_output.put_line (v2_emp_content.v_rowid);
    i: = i + 1;
    v2_none_con: = 'NO ' | TO_CHAR (i);

    END LOOP;
    end;




    SQL > /.
    Insert in your values (10, 'W')
    *
    ERROR on line 1:
    ORA-00904: "NONE": invalid identifier
    ORA-06512: in the 'END. TEST_TABLE2', line 15
    ORA-04088: error during execution of trigger ' FINAL. TEST_TABLE2'


    SQL >

    First of all:

    v2_stmt_str: = 'select rowid from t1 where name =' v2_none_con2;

    I would give you compilation errors. I guess the real code is:

    v2_stmt_str: = 'select rowid from t1 where name =' | v2_none_con2;

    Now that the text of the statement would be? V2_none_con2 is 'NONE', dynamic SQL would be:

    Select rowid from t1 where name = NONE

    It is obvious, it will trigger ORA-00904 (except a column named NONE t1). What you want is:

    Select rowid from t1 where name ='' NONE

    So change:

    v2_stmt_str: = 'select rowid from t1 where name =' | v2_none_con2;

    TO

    v2_stmt_str: = ' select rowid from t1, whose name =="' | v2_none_con2 | '''';

    SY.

  • ORA-00904: invalid identifier

    Hi all

    I'm getting ORA-00904: "SNO_T": invalid identifier will be done in this example. Please let me know where I have error.

    create table t4(name varchar2(22),sno number);
    
    
    insert into t4 values('suman2',2);
    insert into t4 values('suman',1);
    
    create or replace type t4_t as object(
     name_t  varchar2(22),
     sno_t   number
     );
    
    
    create or replace type t4_m is table of t4_t;
    
    
    /
    declare
     l_toys t4_m;
     l1     pls_integer;
    begin
     select t4_t(name_t,sno_t)  
      bulk collect into l_toys
      from t4;
    -- DBMS_OUTPUT.PUT_line(l_toys.count);
    
     select count(*) into l1 from t4;
    
    
    DBMS_OUTPUT.PUT_line(l1);
    
    
    end;
    
    Error report -
    ORA-06550: line 5, column 21:
    PL/SQL: ORA-00904: "SNO_T": invalid identifier
    ORA-06550: line 5, column 2:
    PL/SQL: SQL Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    

    Select t4_t (name_t, sno_t)

    bulk collect into l_toys

    T4;

    the columns in your table are called name and sno, so you must use these names in your select statement

    t4_t is the manufacturer that expects two values (a string and a number) and having built an object, you will be able to access the object by using object_name.sno_t, but do not all by building this...

    HTH

  • ORA-00904: "YEAR": invalid identifier

    Hello

    I'm getting ORA-00904: 'YEAR': Error invalid identifier when executing the following query.
    This application was written in MySQL and migrated to Oracle.
    The problem is in where clause as I am unable to migrate the YEAR MONTHNAME

    "diet_details.diet_date = July 1, 12.

    SELECT
    diet_details.diet_id AS diet_id,
    diet_details.diet_combination_id AS diet_combination_id,
    (diet_details.diet_details_id) be counted AS County,.
    mas_diet_combination.diet_combination_name AS mas_diet_combination_name,
    diet_details.diet_date AS diet_diet_date,
    diet_details.diet_details_id AS diet_diet_details_id,
    mas_department.department_name AS mas_department_name,
    mas_hospital.hospital_name AS mas_hospital_name
    Of
    mas_diet_combination RIGHT OUTER JOIN diet_details ON mas_diet_combination.diet_combination_id = diet_details.diet_combination_id
    LEFT OUTER JOIN mas_department ON diet_details.department_id = mas_department.department_id
    LEFT OUTER JOIN mas_hospital ON diet_details.hospital_id = mas_hospital.hospital_id

    WHERE
    MonthName (diet_details.diet_date) = JUL
    and year (diet_details.diet_date) = 12
    and diet_details.department_id = 11


    GROUP BY
    diet_details.diet_id,
    diet_details.diet_combination_id,
    diet_details.diet_details_id,
    mas_diet_combination.diet_combination_name,
    diet_details.diet_date,
    diet_details.diet_details_id,
    mas_department.department_name,
    mas_hospital.hospital_name
    order of mas_diet_combination.diet_combination_id

    Instead of the YEAR, MONTHNAME, use the function to_char.

    for example
    where to_char(diet_details.diet_date,'MON-YYYY') = ' JUL-2012'.

  • ORA-00904: string: invalid identifier

    Alert by noob, I try to use an identifier in a case statement to avoid have to write the statement twice. I know that there is a better way to do someone can help?

    below is the current code, that I inherited...

    Date1 - DATE_RCVD as DAYS_TO_REFERRAL,
    -case when DATE1 - > 15 DATE_RCVD can "FAIL".
    Another 'PASS '.
    finish as a REFERENCE
    DATE2,
    DATE3,




    Here's what I'm trying, so I can combine steps... but I get the error invalid identifier

    Date1 - DATE_RCVD as DAYS_TO_REFERRAL,
    When case DAYS_TO_REFERRAL > 15 can "FAIL".
    Another 'PASS '.
    finish as a REFERENCE
    DATE2,
    DATE3,


    I changed the names of fields btw. Thanks in advance.
    Rich

    You cannot reference alias on the same leveluse: see online:

    SELECT  DAYS_TO_REFERRAL,
            case
              when DAYS_TO_REFERRAL > 15 then 'FAIL'
              else 'PASS'
            end as REFERRAL
            DATE2,
            DATE3
      FROM  (
             SELECT  DATE1 - DATE_RCVD as DAYS_TO_REFERRAL
                     DATE2,
                     DATE3
               FROM  your_table
           )
    /
    

    SY.

Maybe you are looking for

  • Several problems with my Satellite A200-1QZ

    Hello I'm sorry to open a new thread, but I already looked around for awhile and has failed to find the answers I need. Since I have several different problems, some of which are probably unique, I thought I might as well start a new thread. So lets

  • Logitech C920 crashing during video call Skype V7.1

    In Skype version 7.1 under Windows 7 64 - bit, when I'm in a Skype call with more than one other person that my webcam freezes and Skype will stop using it for video. I see a single frozen image of the webcam on my dissertation, but others in the cal

  • WIFI Link 5100 drivers 12.1.2.1 does not maintain steady speed

    I have connected the DIR-855 (Dlink) to, Wifi Intel 5100 of the Qosmio and with the original drivers I can maintain a connection constantly 150Mbps (5 GHz 40 Mhz N only). After upgrading to the 12.1.2.1 I can only keep it for an hour or two before it

  • Compaq Presario C500: Upgrade to Windows 10 Bugs

    Only encountered two so far, both with workarounds, but the second question concerns a significant loss of functionality ("sleep" mode no longer works) and for which we could do with a fix: (i) the upgrade of Windows 10 resulted in a loss of sound, b

  • Support S10 and USB3.0

    Hi all Anyone have experience with enahncing a Thinkstation S10 with a USB 3.0 PCI-e card? any help is appreciated. Michael