ORA 00928: missing Select keyword.

Hi all

I get an error when executing the following command

Sélectionnez a.cost_price,d.pvms_no,d.nomenclature,a.item_id,a.stock_id,a.closing_stock comme stock_qty,a.closing_stock*a.cost_price comme valeur, (a.closing_stock*a.cost_price) * 100 comme per,SUM((b.closing_stock*b.cost_price)*100) comme cum de store_item_batch_stock a, store_item_batch_stock b, mas_store_item d où a.item_id=d.item_id et a.cost_price > = b.cost_price GROUP BY a.cost_price union
*
ERROR on line 1:
ORA-00928: lack of SELECT keyword

the clause "group by" must have more values, all the columns that are not in Group functions:
http://docs.Oracle.com/CD/E17952_01/refman-5.1-en/group-by-functions.html

select a.cost_price,
     d.pvms_no,
     d.nomenclature,
     a.item_id,
     a.stock_id,
     a.closing_stock as stock_qty,
     a.closing_stock*a.cost_price as value,
     (a.closing_stock*a.cost_price)*100 as per,
     SUM((b.closing_stock*b.cost_price)*100) as dum
from store_item_batch_stock a,
     store_item_batch_stock b,
     mas_store_item d
where a.item_id=d.item_id and
     a.cost_price >= b.cost_price
GROUP BY a.cost_price,
     d.pvms_no,
     d.nomenclature,
     a.item_id,
     a.stock_id,
     a.closing_stock

Tags: Database

Similar Questions

  • Disqualification - Error exporting to DB: ORA-00928 missing SELECT


    Hello

    I use v12.1.3.0.0 of the Disqualification and have created evidence very basic process of concept that takes as input a comma-demilited of files through the process of the player and then with a writing processor to write data staged entry.

    I then try to export the data showcased in the corresponding table in the database, but get the following error message:

    "xxxxxx failed: writing problem Insert batch of database: ORA-00928: lack of SELECT key word."

    A single CSV file with 3 fields and across the database contains the input staging file data, all I have in the schema is a single table that I write for. I can connect to my DB store data target in Disqualification without any problem.

    Does anyone have any ideas as to what could be the cause? Reading upward on this error gives to think it is to SELECT key missing with the word in a CREATE VIEW statement, but I don't know where or why she strives to create a view.

    Any help would be appreciated.

    Hello

    -Your export write in an existing table or create a new table (as configured in the export task definition)?

    -If the former, that export option do you use (as configured in the work using export)? The three options assuming a DB target are 'Erase existing data and insert","add to current data' and 'Replace records with the help of the primary key'.

    Note If just run the export as a stand-alone task rather than in a work (for example, right-click, executed in the tree) it will run in mode Delete and Insert.

    It looks a bit like the export may be trying to replace the records by primary key, but can not detect the PK in the target table to select the records to be deleted before insertion (Disqualification does not 'Update' statements currently - this is why the table must be an intermediate table autonomous or similar without FK constraints or the permission issues that would prevent the Disqualification deleting records in this mode).

    Kind regards

    Mike

  • 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...

  • ORA-30654: 'missing DEFAULT keyword' in the recursive subquery factoring

    The subquery recursive factoring works without clause CYCLE and cycle only.

    When I have a cycle (uncomment SELECT 5, 2 double UNON ALL) ORACLE detects the cycle properly, but when I include the clause CYCLE I get ORA-30654.

    I'm pretty shure that this statement already worked in my DB (11.2.0.3.0 - 64 bit)

    CREATE TABLE temp_rsq (a,b)
    AS
    SELECT 1, 2 FROM dual UNION ALL
    SELECT 2, 3 FROM dual UNION ALL
    SELECT 3, 4 FROM dual UNION ALL
    SELECT 4, 5 FROM dual UNION ALL
    --SELECT 5, 2 FROM dual UNION ALL
    SELECT 5, 6 FROM dual UNION ALL
    SELECT 6, 7 FROM dual;
    --
    --
    
    -- b-> new A
    WITH cte (  pb, a,    b,      weg) AS
    (SELECT   NULL, a,    b,        a
       FROM temp_rsq
      WHERE a=1
    UNION ALL
    SELECT cte.b, n.a a, n.b, weg+n.a
       FROM temp_rsq n
       JOIN cte
         ON (cte.b=n.a))
    SEARCH depth FIRST BY a SET abst
    --CYCLE a SET is_cycle to '1' DEFAULT '0'
    SELECT * FROM cte;
    
    
    
    

    Found last al:

    It does not with cusor_sharing = FORCE, only with the cursor sharing = TRUE!

    For me, a very strange behavior.

  • 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.

  • 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.

  • 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.

  • Error (74,34): PL/SQL: ORA-00928: falta the word clave SELECT

    INSERT SHOW ME BECAUSE AN ERROR ORA-00928: WHEN I AM IN COMPLIANCE WITH THE SINTASIX



    create or replace
    Procedure metodo_inventario (tipo_inventario varchar2)
    As
    number of;
    date of pl_fecha_factura;
    number of pl_numero_factura;
    pl_id_tp_movimiento nucreate or replace
    Procedure metodo_inventario (tipo_inventario varchar2)
    As
    number of;
    date of pl_fecha_factura;
    number of pl_numero_factura;
    number of pl_id_tp_movimiento;
    number of pl_id_producto;
    number of pl_cantidad;
    number of pl_vlr_unitario;
    number of pl_vlr_vairable;
    number of pl_vlr_peps;
    number of pl_vlr_upes;
    number of;
    number of;

    Begin
    pl_vlr_promedio: = 0;
    pl_vlr_peps: = 0;
    pl_vlr_upes: = 0;
    : = 0 ;
    : = 0 ;

    -> primero is crea una tabla auxiliar of facturas...
    / * Start
    create the table as
    Select *.
    of c_factura;

    ALTER TABLE
    ADD ("ESTADO" DEFAULT NUMBER 1 NOT NULL);
    end; * /
    If (tipo_inventario = '% PEP') then

    loop
    Selección - of the first factura...
    If (tipo_movimiento = 'COMPRA %') then

    Select min (FECHA_FACTURA)
    min (NUMERO_FACTURA)
    in pl_fecha_factura, pl_numero_factura
    of
    where State = 1;

    Select FECHA_FACTURA
    NUMERO_FACTURA
    ID_TP_MOVIMIENTO
    ID_PRODUCTO
    AMOUNT - amount
    VLR_UNITARIO - vlr law
    , (AMOUNT * VLR_UNITARIO)-total of vlr
    -, AMOUNT - total, und-> este to hace a select aside para sumar...
    -, (AMOUNT * VLR_UNITARIO)-total, vlr-> este to hace a select aside para sumar...
    IN pl_fecha_factura
    pl_numero_factura
    pl_id_tp_movimiento
    pl_id_producto
    pl_cantidad
    pl_vlr_unitario
    pl_vlr_variable
    of
    where NUMERO_FACTURA = pl_numero_factura
    and State = 1;

    Select the amount, vlr_unitario
    in pl_cantidad, pl_vlr_unitatrio
    of
    where State = 1
    and numero_factura = pl_numero_factura;

    estado set update = 0
    where numero_factura = pl_numero_factura;

    insert into c_inventario_final ('FECHA_FACTURA', ID_TIPO_MOVIMIENTO,
    VLR_UNITARIO, E_CANTIDAD_PRODUCTO, E_VLR_FACTURA, S_CANTIDAD_PRODUCTO.
    S_VLR_FACTURA, IF_CANTIDAD, IF_VLR, ESTADO_FACTURA) values ('pl_fecha_factura',
    pl_numero_factura, pl_id_tp_movimiento, pl_id_producto, pl_cantidad,
    pl_vlr_unitario, pl_vlr_variable, (pl_cantida +), (pl_vlr_peps + pl_vlr_variable);
    end if;
    end loop;

    exception
    while others then
    dbms_output.put_line (SQLERRM);
    -> PROCEDURE OF GENERACIÓN INVENTARIO MEOTDOS...
    end;
    House;
    number of pl_id_producto;
    number of pl_cantidad;
    number of pl_vlr_unitario;
    number of pl_vlr_vairable;
    number of pl_vlr_peps;
    number of pl_vlr_upes;
    number of;
    number of;

    Begin
    pl_vlr_promedio: = 0;
    pl_vlr_peps: = 0;
    pl_vlr_upes: = 0;
    : = 0 ;
    : = 0 ;

    -> primero is crea una tabla auxiliar of facturas...
    / * Start
    create the table as
    Select *.
    of c_factura;

    ALTER TABLE
    ADD ("ESTADO" DEFAULT NUMBER 1 NOT NULL);
    end; * /
    If (tipo_inventario = '% PEP') then

    loop
    Selección - of the first factura...
    If (tipo_movimiento = 'COMPRA %') then

    Select min (FECHA_FACTURA)
    min (NUMERO_FACTURA)
    in pl_fecha_factura, pl_numero_factura
    of
    where State = 1;

    Select FECHA_FACTURA
    NUMERO_FACTURA
    ID_TP_MOVIMIENTO
    ID_PRODUCTO
    AMOUNT - amount
    VLR_UNITARIO - vlr law
    , (AMOUNT * VLR_UNITARIO)-total of vlr
    -, AMOUNT - total, und-> este to hace a select aside para sumar...
    -, (AMOUNT * VLR_UNITARIO)-total, vlr-> este to hace a select aside para sumar...
    IN pl_fecha_factura
    pl_numero_factura
    pl_id_tp_movimiento
    pl_id_producto
    pl_cantidad
    pl_vlr_unitario
    pl_vlr_variable
    of
    where NUMERO_FACTURA = pl_numero_factura
    and State = 1;

    Select the amount, vlr_unitario
    in pl_cantidad, pl_vlr_unitatrio
    of
    where State = 1
    and numero_factura = pl_numero_factura;

    estado set update = 0
    where numero_factura = pl_numero_factura;

    insert into c_inventario_final ('FECHA_FACTURA', ID_TIPO_MOVIMIENTO,
    * VLR_UNITARIO, E_CANTIDAD_PRODUCTO, E_VLR_FACTURA, S_CANTIDAD_PRODUCTO, *.
    * S_VLR_FACTURA, IF_CANTIDAD, IF_VLR, ESTADO_FACTURA) values ('pl_fecha_factura', *)
    * pl_numero_factura, pl_id_tp_movimiento, pl_id_producto, pl_cantidad, *.
    * pl_vlr_unitario, pl_vlr_variable, (pl_cantida +), (pl_vlr_peps + pl_vlr_variable); *
    end if;

    end loop;

    exception
    while others then
    dbms_output.put_line (SQLERRM);
    -> PROCEDURE OF GENERACIÓN INVENTARIO MEOTDOS...
    end;

    THANK ME THAT COLLABORATE WITH THE CORRECTION OF THIS ERROR...

    THANK YOU, GOOD DAY...
    REYNEL MARTINEZ SALAZAR

    Hola Amigo,
    Como Estes?
    Buena Noche

    It's all the Spanish I know (almost) :)

    If you can translate your English error could be useful in the meantime let me brush up on my Spanish language ;)

    On the second opinion, your column name insert why there quotes around it?
    try to set it to

    insert into c_inventario_final(FECHA_FACTURA, ID_TIPO_MOVIMIENTO,   /* quotes removed*/
    VLR_UNITARIO, E_CANTIDAD_PRODUCTO, E_VLR_FACTURA, S_CANTIDAD_PRODUCTO,
    S_VLR_FACTURA, IF_CANTIDAD, IF_VLR, ESTADO_FACTURA) values ('pl_fecha_factura',
    pl_numero_factura, pl_id_tp_movimiento, pl_id_producto, pl_cantidad,
    pl_vlr_unitario, pl_vlr_variable, (pl_cantida+pl_cant_aux), (pl_vlr_peps+pl_vlr_variable)
    

    See you soon!
    Bobin

    Published by: Buga on November 15, 2009 18:31

  • "missing the SELECT keyword" error during an insert into the temporary table using the blob value

    I'm trying to insert into an oracle temp table using select that retrieves data from a blob field but I get the error: "lack the SELECT keyword.

    How we store temporary in oracle result when we make this type of operation (extraction of data in fields and try to load them into a separate table on the fly.?)

    with cte as)

    Select user_id, utl_raw.cast_to_varchar2 (dbms_lob.substr (PREFERENCES)) as USER my_blob

    )

    create table new_table as

    SELECT user_id,EXTRACTvalue(xmltype(e.my_blob),'/preferences/locale') regional settings

    E ETC

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

    BLOB data - value - which is

    <? XML version = "1.0" encoding = "ISO-8859-1" ?>

    - < Preferences >

    < time zone > America/New_York < / > zone

    < displayscheduleinusertimezone > Y < / displayscheduleinusertimezone >

    < local > Spanish < /locale >

    < DateFormat > JJ/mm/aaaa < / DateFormat >

    < timeFormat > hh: mm aaa < / timeFormat >

    < longformat > Long_01 < / longformat >

    < doubleformat > Double_01 < / doubleformat >

    < percentformat > Percentage_01 < / percentformat >

    < currencyformat > Currency_01 < / currencyformat >

    < / Preferences >

    A WITH clause that must immediately precede the SELECT keyword:

    SQL > create table t:

    2 with the o as (select double dummy)

    3 select * West longitude;

    Table created.

  • 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.

  • DBMS_ADVANCED_REQRITE get ORA-00905: lack of keyword

    What I'm doing wrong here?
    17:17:29 NJ3417@pubd1> create table test_a (col_a varchar2(20));
    
    Table created.
    
    Elapsed: 00:00:00.04
    17:17:55 NJ3417@pubd1> insert into test_a values('Red');
    
    1 row created.
    
    Elapsed: 00:00:00.02
    17:18:09 NJ3417@pubd1> create table test_b (col_b varchar2(20));
    
    Table created.
    
    Elapsed: 00:00:00.02
    17:18:32 NJ3417@pubd1> insert into test_b values('Blue');
    
    1 row created.
    
    Elapsed: 00:00:00.03
    17:18:55 NJ3417@pubd1> commit;
    
    Commit complete.
    
    17:34:56 NJ3417@pubd1> begin
    17:34:56   2    sys.dbms_advanced_rewrite.declare_rewrite_equivalence(
    17:34:56   3           name => 'Mikes SQL override',
    17:34:56   4           source_stmt => 'SELECT col_a FROM test_a',
    17:34:56   5           destination_stmt => 'SELECT col_b FROM test_b',
    17:34:56   6           validate => FALSE);
    17:34:56   7  end;
    17:34:56   8  /
    begin
    *
    ERROR at line 1:
    ORA-00905: missing keyword
    ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 29
    ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 185
    ORA-06512: at line 2
    
    17:54:18 NJ3417@pubd1> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for Solaris: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    
    5 rows selected.
    Thank you
    Mike

    mtefft wrote:
    What I'm doing wrong here?

    I don't have your exact version but I think that you can't have any string as the name of the rewrite rule. Refer to the documentation
    Here's the working example:

    SQL> select * from v$version ;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    SQL> create table test_a (col_a varchar2(20));
    
    Table created.
    
    SQL> insert into test_a values('Red');
    
    1 row created.
    
    SQL> create table test_b (col_b varchar2(20));
    
    Table created.
    
    SQL> insert into test_b values('Blue');
    
    1 row created.
    
    SQL> commit ;
    
    Commit complete.
    
    SQL> select col_a from test_a ;
    
    COL_A
    --------------------
    Red
    
    SQL> select col_b from test_b ;
    
    COL_B
    --------------------
    Blue
    
    begin
      sys.dbms_advanced_rewrite.declare_rewrite_equivalence(
           name => 'Mikes SQL override',
           source_stmt => 'SELECT col_a FROM test_a',
           destination_stmt => 'SELECT col_b FROM test_b',
           validate => FALSE);
    end;
      8  /
    begin
    *
    ERROR at line 1:
    ORA-00905: missing keyword
    ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 29
    ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 185
    ORA-06512: at line 2
    
    begin
      sys.dbms_advanced_rewrite.declare_rewrite_equivalence(
           name => 'myrule',
           source_stmt => 'SELECT col_a FROM test_a',
           destination_stmt => 'SELECT col_b FROM test_b',
           validate => FALSE);
    end;
      8  /
    
    PL/SQL procedure successfully completed.
    
    SQL> show parameter rewrite
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    query_rewrite_enabled                string      TRUE
    query_rewrite_integrity              string      enforced
    SQL> alter session set query_rewrite_integrity=trusted ;
    
    Session altered.
    
    SQL> show parameter rewrite
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    query_rewrite_enabled                string      TRUE
    query_rewrite_integrity              string      TRUSTED
    
    SQL> select col_a from test_a ;
    
    COL_A
    --------------------
    Blue
    
  • ORA-00928

    Hello

    I need to insert data into a table and the values are fetched from a cursor.

    Here's the code in part



    BEGIN
    Select max (current_start_date) in the v_start_date from ods_batch_parameter where mapping_name = 'M_PARTY ';
    FOR ut_rec IN ut_cur

    LOOP
    sqlstr: =.
    ' select count (case when ods_update_date = 1 then ods_load_date).
    Count (case when ods_update_date! = ods_load_date then 1 end).
    Count (*)
    of ' | ut_rec.Ta | »
    where ods_update_date > = "' | v_start_date | » '' ';
    -dbms_output.put_line (sqlstr);

    Sqlstr EXECUTE IMMEDIATE IN ins, updt, tot.

    dbms_output.put_line (ut_rec.ta);
    dbms_output.put_line (INS);
    dbms_output.put_line (UPDT);
    dbms_output.put_line (tot);




    *' insert into IIMS_ODS_TABLES_REC_COUNT(:v_column1,:v_column2,:v_column3) *.
    the values of ('| ut_rec.ta |) «, » || Ins | «, » || UPDT |') ' ;
    EXECUTE IMMEDIATE sqlins using v_column1, v_column2, v_column3;

    commit;

    dbms_output.put_line (Sqlins);

    END LOOP;


    It gives an error as follows:


    ORA-00928: lack of SELECT keyword
    ORA-06512: at the 'ODS '. ODS_REC_COUNT', line 155
    ORA-06512: at line 2



    I need to the syntax for inserting data by using the syntax of normal in oracle dynamic sql insert*.



    This following syntax generates an error

    column not allowed here

    ' insert into IIMS_ODS_TABLES_REC_COUNT (ODS_TABLE_NAME, ODS_INSERT_COUNT,
    Values ODS_UPDATE_COUNT) ('| ut_rec.ta |) «, » || Ins | «, » || UPDT |') '




    Help, please

    Published by: chrys on November 26, 2008 14:59

    Published by: chrys on November 26, 2008 15:02

    This is because you cannot use bind variables for columns, you need to use:

    ' insert into IIMS_ODS_TABLES_REC_COUNT (ODS_TABLE_NAME, ODS_INSERT_COUNT, ODS_UPDATE_COUNT)
    values ("' | ut_rec.ta |") «, » || Ins | «, » || UPDT |') ' ;

    or

    ' insert into IIMS_ODS_TABLES_REC_COUNT('|| v_column1 ||) «, » || v_column2 | «, » || v_column3 |')
    values ("' | ut_rec.ta |") «, » || Ins | «, » || UPDT |') ' ;

  • 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-02421: missing or not valid schema authorization identifier

    Hello Evryone,

    I'm having a problem with the session of the user schema. I'm not able to change the schema that it even exists.
    SQL>ALTER session SET CURRENT_SCHEMA='QA'
    Error report:
    SQL Error: ORA-02421: missing or invalid schema authorization identifier
    02421. 00000 -  "missing or invalid schema authorization identifier"
    *Cause:    the schema name is missing or is incorrect in an authorization
               clause of a create schema statement.
    *Action:   If the name is present, it must be the same as the current
               schema.
    
    
    SQL>select username, account_status from DBA_USERS where username='QA';
    
    USERNAME                       ACCOUNT_STATUS                   
    ------------------------------ -------------------------------- 
    QA                                        OPEN                             
    
    SQL>SHOW user
    
    USER is SYSTEM
    
    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for HPUX: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    Try it without the single quotes.

    Best regards

    mseberg

    Test on mine:

    Release 11.2.0.1.0 - 64 bit production

    I get the same error with quotes

    ERROR on line 1:
    ORA-02421: missing or not valid schema authorization identifier

    Published by: mseberg on August 15, 2011 14:50

    So, this and then check

    ALTER SESSION SET CURRENT_SCHEMA=QA
    

    You can check it using this:

    select sys_context('USERENV','SESSION_SCHEMA') from dual;
    

    Published by: mseberg on August 15, 2011 15:08

  • Error: PL / SQL: ORA-00922: missing or invalid option

    I'm sorry, I'm new to Oracle and am in a crazy time. I'm having all kinds of problems with the conversion of SQL to Oracle... and get the PL/SQL: ORA-00922: missing or not valid error option with the following function. Any help appreciated.

    FUNCTION IEXGADQReceived)
    v_BDateTime IN DATE
    v_EDateTime IN DATE
    v_Queuename IN VARCHAR2
    v_Username IN VARCHAR2
    )
    RETURN int IS
    INT v_retval;
    BEGIN
    SET v_retval: = (select count (distinct iid)
    Of agentinteractionsview
    WHERE the ibegintime between v_BDateTime and v_EDateTime
    and fromqueue = v_Queuename
    and fromroutereasonid = 11
    and username = v_Username);

    RETURN v_retval;
    END IEXGADQReceived;

    No problem, we've all been there before: D)

    FUNCTION IEXGADQReceived (v_BDateTime IN DATE,v_EDateTime IN DATE,v_Queuename IN VARCHAR2,v_Username IN VARCHAR2)RETURN int ISv_retval INT;BEGINselect count(distinct iid) INTO v_retval FROM agentinteractionsviewWHERE ibegintime between v_BDateTime and v_EDateTimeand fromqueue = v_Queuenameand fromroutereasonid = 11and username = v_Username;
    
    RETURN v_retval;END IEXGADQReceived;
    

Maybe you are looking for