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.

Tags: Database

Similar Questions

  • 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 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 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
    
  • 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 |') ' ;

  • 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

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

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

  • 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

  • ORA-00936: lack of Interface STEP expression for update flag lines

    Hello world!

    We have an interface that retrieves data of essbase and the load into a table target Oracle.

    We use the Modules (KM) following Knowledge:

    LKM Hyperion Essbase DATA SQL

    IKM SQL incremental update

    When we run the interface, at the stage of 'flag to update lines', we get the following error

    Stage: 'make update'

    Error: ORA-00936: lack of expression

    This is definition message tab:

    ODI-1228: Exportar Presupuesto General (integration) task fails on ORACLE ODI_STAGE connection target.

    Caused by: java.sql.SQLSyntaxErrorException: ORA-00936: lack of expression

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)

    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)

    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)

    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)

    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)

    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)

    at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1115)

    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1488)

    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769)

    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3954)

    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1539)

    at oracle.odi.runtime.agent.execution.sql.SQLCommand.execute(SQLCommand.java:163)

    at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:102)

    at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:1)

    at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:577)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:468)

    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2128)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ 2.doAction(StartSessRequestProcessor.java:366)

    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)

    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$ 0 (StartSessRequestProcessor.java:292)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ StartSessTask.doExecute (StartSessRequestProcessor.java:855)

    at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)

    to oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$ 2.run(DefaultAgentTaskExecutor.java:82)

    at java.lang.Thread.run(Thread.java:662)

    This is CODE tab:


    Update HYP_INT. I _TRG_PRESUPUESTO_ESS_GENERAL $

    Set IND_UPDATE = 'U '.

    When there is)

    Select 'X '.

    of HYP_INT. TRG_PRESUPUESTO_ESS_GENERAL T

    where

    )

    We do not know why query created the interface has some missing statements when the sql is created. Do you think that a lack or settings or just something worng or a bug?

    The ODI client version is ODI_11.1.1.7.0_GENERIC_130128.1205


    You give us any suggestions to fix this?

    Any suggestions would be very helpful!


    Thank you


    Ivan Lemus

    Since you're using IKM of SQL incremental update, you must mark a logical key on the fields of your target.

    This key allows the comparison for insert and update.

  • ORA-00907 - "lack the right parenthesis.

    Hello

    I am trying to create a procedure to add table scores each month. This is my code:

    create or replace procedure add_partitions

    as

    v_partition all_tab_partitions.partition_name%type;

    v_limit varchar2 (50);

    LONG v_sql;

    Start

    Select to_char (trunc (add_months(sysdate,1), 'MM'), 'Mon_YYYY')

    in v_partition

    Double; -napr. 072014

    Select to_char (trunc (add_months(sysdate,2), 'MM'), 'DD-MM-YYYY')

    in v_limit

    Double; -napr. 08/01/2014

    v_sql: = ' ALTER TABLE CENTRUMADMIN. AUD$ _BACKUP ADD PARTITION '. v_partition | «VALUES LESS THAN (' |)» v_limit | ') tablespace BACKUP_AUDIT';

    immediately run v_sql;

    end;

    /

    The procedure is compiled without errors, but when I run it I get this error:

    ORA-00907 - "lack the right parenthesis.

    After some tests, I am sure that this problem is here: VALUES LESS THAN (' | v_limit |) (')... but I'cant understand whats wrong

    Any ideas? Thanks in advance

    Honza

    Hi Mika,

    Try

    VALUES LESS THAN ("' | v_limit |) (') - three times - 2 gives you a ' in your statement - the 3rd chain delimited

    concerning
    Kay

  • "ORA-13787: lack of profile SQL ' acceptance of profile sql error!

    Hi all.

    The oracle is 10.2.0.4 on solaris machine.

    I tried to use the profile of sql, but I got some errors when acceptiing "sql profile.

    I've done are as follwoings:

    ----------------------------------
    1 create a tuning task

    DECLARE
    l_sql_tune_task_id VARCHAR2 (100);
    BEGIN
    l_sql_tune_task_id: = DBMS_SQLTUNE. () CREATE_TUNING_TASK
    sql_id = > "1pyfat4wjj7t8"
    plan_hash_value = > null,
    scope = > 'GLOBAL ',.
    time_limit = > 60,
    Task_Name = > '1pyfat4wjj7t8_hoho',-replace TaskName
    Description = > 'Tuning report');
    Dbms_output.put_line ('l_sql_tune_task_id: ' | l_sql_tune_task_id);
    end;
    /

    2 the task of tuning

    BEGIN
    DBMS_SQLTUNE. EXECUTE_TUNING_TASK (task_name = > '1pyfat4wjj7t8_hoho');
    end;
    /

    3. report of the task of tuning

    THE VALUE OF 10000 LONG
    SET LONGCHUNKSIZE 10000
    SET LINESIZE 100
    SELECT DBMS_SQLTUNE. REPORT_TUNING_TASK ('1pyfat4wjj7t8_hoho') from DUAL;


    4 accept the tuning task

    DECLARE
    my_sqlprofile_name VARCHAR2 (30);
    BEGIN
    my_sqlprofile_name: = DBMS_SQLTUNE. () ACCEPT_SQL_PROFILE
    Task_Name = > "1pyfat4wjj7t8_hoho"
    force_match = > true,
    name = > '1pyfat4wjj7t8_lim');
    END;
    /

    DECLARE
    *
    ERROR on line 1:
    ORA-13787: lack of profile SQL of the statement '1' for task tuning "1pyfat4wjj7t8_hoho" object
    ORA-06512: at "SYS." DBMS_SQLTUNE_INTERNAL', line 7087
    ORA-06512: at "SYS." DBMS_SQLTUNE', line 5559
    ORA-06512: at line 4 level

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

    I got the error at the final stage of 4.

    What are my mistakes in step 4?

    Thanks in advance.
    Best regards.

    869578 wrote:
    Thanks for your reply.
    DECLARE
    *
    ERROR on line 1:
    ORA-13787: lack of profile SQL of the statement '1' for task tuning "1pyfat4wjj7t8_hoho" object
    ORA-06512: at "SYS." DBMS_SQLTUNE_INTERNAL', line 7087
    ORA-06512: at "SYS." DBMS_SQLTUNE', line 5559
    ORA-06512: at line 4 level

    Thank you.

    Hello

    Check the output of SELECT DBMS_SQLTUNE. REPORT_TUNING_TASK ('1pyfat4wjj7t8_hoho') from DUAL;

    Otherwise any recommendation that the error is thrown

    See you soon

Maybe you are looking for