Error in Pl/sql code

create or replace
PACKAGE BODY SF_CSD_CreateOrder
AS
G_PKG_NAME CONSTANT VARCHAR2(30) :='SF_CSD_CreateOrder';
PROCEDURE Create_Order
p_api_version_number IN NUMBER,
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
p_commit IN VARCHAR2 := FND_API.G_FALSE,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_order_rec IN ORDER_HDR_REC,
p_order_lines IN ORDER_LINE_REC_TBL )
IS
l_api_name CONSTANT VARCHAR2(30) := 'Create_Order';
l_api_version_number CONSTANT NUMBER := 1.0;
lx_incident_id NUMBER(10);
lx_incident_number VARCHAR2(50);
lx_return_status VARCHAR2(1);
lx_msg_count NUMBER(10);
lx_msg_data VARCHAR2(2000);
l_incident_id NUMBER;
l_repair_line_id NUMBER;
l_repair_number NUMBER;
xx_ro_status VARCHAR2(1);
xl_return_status VARCHAR2(1);
xl_msg_count NUMBER;
xl_msg_data VARCHAR2(2000);
l_order_line_id NUMBER;
l_order_header_id NUMBER;
xx_return_status VARCHAR2(1);
xx_msg_count NUMBER;
xx_msg_data VARCHAR2(2000);
l_order_line ORDER_LINE_REC_TBL;
l_createsr_rec SF_CSD_CREATEORDER_UTIL.CREATESR_REC;
l_sr_notes_tbl cs_servicerequest_pub.notes_table;
l_order_lines SF_CSD_CreateOrder.ORDER_LINE_REC_TBL;
CURSOR c_get_rma(p_repair_line_id NUMBER) IS
SELECT cpt.order_line_id,
cpt.ORDER_HEADER_ID
FROM csd_product_transactions cpt,
csd_repairs cr
WHERE cpt.repair_line_id=p_repair_line_id
AND cr.repair_line_id= cpt.repair_line_id
AND cpt.action_type='RMA';
BEGIN
-- Standard Start of API savepoint
SAVEPOINT Create_Order;
-- Standard call to check for call compatibility.
IF NOT FND_API.Compatible_API_Call(l_api_version_number, p_api_version_number, l_api_name,G_PKG_NAME) THEN
RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
END IF;
-- Initialize message list if p_init_msg_list is set to TRUE.
IF FND_API.to_Boolean(p_init_msg_list) THEN
FND_MSG_PUB.initialize;
END IF;
-- Initialize API return status to success
x_return_status := FND_API.G_RET_STS_SUCCESS;
-- call SF_CSD_CREATEORDER_UTIL.Create_SR
-- this outputs incident_id (l_incident_id)
l_createsr_rec.party_id :=p_order_rec.party_id;
l_createsr_rec.cust_account_id :=p_order_rec.cust_account_id;
SF_CSD_CREATEORDER_UTIL.create_sr (
P_createsr_rec =>l_createsr_rec,
P_sr_notes_tbl =>l_sr_notes_tbl,
X_incident_id =>lx_incident_id,
X_incident_number =>lx_incident_number,
X_return_status =>lx_return_status,
X_msg_count =>lx_msg_count,
X_msg_data =>lx_msg_data
l_incident_id :=lx_incident_id;
FOR I IN l_order_line
LOOP
--- Use the incidentid returned by the above call (l_incident_id)
-- Create RO
l_createro_rec :=SF_CSD_CREATEORDER_UTIL.CREATERO_REC;
l_createro_rec.INVENTORY_ITEM_ID :=p_order_lines.inventory_item_id;
l_createro_rec.SERIAL_NUMBER :=p_order_lines.serial_number;
l_createro_rec.PROBLEM_DESCRIPTION :=p_order_lines.PROBLEM_DESCRIPTION;
SF_CSD_CREATEORDER_UTIL.create_ro (
p_CREATERO_REC =>l_createro_rec,
x_repair_line_id =>l_repair_line_id,
x_repair_number =>l_repair_number,
x_ro_status => xx_ro_status,
x_return_status => xl_return_status,
x_msg_count => xl_msg_count,
x_msg_data =>xl_msg_data
-- Call SF_CSD_CREATEORDER_UTIL.Create_repair_order
--- This outputs repair line id.(l_repair_line_id)
l_repair_line_id :=lx_repair_line_id;
l_auto_rcv :=SF_CSD_CREATEORDER_UTIL.AUTORCV_REC;
l_order_line_id :=null;
l_order_header_id :=null;
OPEN c_get_rma(l_auto_rcv.REPAIR_LINE_ID);
FETCH c_get_rma INTO l_order_line_id, l_order_header_id;
CLOSE c_get_rma;
l_auto_rcv.REPAIR_LINE_ID :=l_repair_line_id;
l_auto_rcv.ORDER_LINE_ID := l_order_line_id;
l_auto_rcv.ORDER_HEADER_ID := l_order_header_id;
SF_CSD_CREATEORDER_UTIL.auto_receive (
p_autorcv_tbl => l_auto_rcv,
x_return_status => xx_return_status,
x_msg_count => xx_msg_count,
x_msg_data => xx_msg_data );
-- Get the order line id for the RMA created above. use query to select from csd_product_txns table.
-- Select order_line_id from csd_product_txns where repair_line_Id = l_repair_line_id and action_type = 'RMA'
--- Call SF_CSD_CREATEORDER_UTIL.Auto_receive to receive the item for the rma created above
END LOOP;
END;
END SF_CSD_CreateOrder;
Error(27,11): PLS-00323: subprogram or cursor 'CREATE_ORDER' is declared in a package specification and must be defined in the package body
Error(52,91): PLS-00371: at most one declaration for 'G_PKG_NAME' is permitted
Error(79,10): PLS-00456: item 'L_ORDER_LINE' is not a cursor

The error message
"subprogram or cursor 'CREATE_ORDER' is declared in a package specification and must be defined in the package body"
Is telling you that the procedure you have coded in the package body is not in the header ... that means not just the name ... but the name and parameters. Compare them and find the discrepancy. They must match.

Similar Messages

  • FK error in PL/SQL code.

    I have a application with the following code.
    Declare
    v_num_req varchar2(100); --Recebe o codigo da requisição
    v_cont number; --Conta a quantidade de aparições
    BEGIN
    --Busca o codigo da requisição
    select cod_requisicao
    into v_num_req
    from requisicao
    where cod = :p72_cod_requisicao;
    --Conta o numero de vezes em que aparece a requisição
    select count(numero_documento)
    INTO v_cont
    from amx_documento
    where numero_documento = v_num_req;
    --Se não aparecer nenhuma requisição
    IF (v_cont = 0) then
    BEGIN
    --Insere a movimentação
    INSERT INTO AMX_MOVIMENTACAO_MATERIAL(COD, NUM_GUIA, NUM_EMPENHO,DT_EMISSAO_EMPENHO ,DESTINO, DT_MOVIMENTACAO, COD_TIPO_MOVIMENTACAO, COD_ALMOXARIFADO, COD_STATUS)
    VALUES (AMX_MOVIMENTACAO_MATERIAL_SEQ.NEXTVAL ,to_char(sysdate, 'YYYY/DDMM-SSSSS'),'123SIS',sysdate,175120,sysdate,301,AMX_ALMOXARIFADO_PADRAO(:app_user),2);
    --Insere o documento
    Insert into amx_documento(cod,cod_movimentacao,cod_tipo_documento,valor_documento,numero_documento)
    values(amx_documento_seq.nextval,amx_movimentacao_material_seq.currval,261,0000,v_num_req);
    --inicia o cursor com os materiais.
    for c_item_req in(
    SELECT
    a.cod cod_mat,
    a.qtd_fornecida
    FROM
    item_requisicao a
    INNER JOIN requisicao e on a.cod_requisicao = e.cod
    INNER JOIN AMX_MATERIAL b ON a.cod_material=b.cod
    LEFT JOIN AMX_ESTOQUE c ON a.cod_material=c.cod_material
    AND c.cod_almoxarifado = :p72_almoxarifado
    WHERE
    a.cod_requisicao = :p72_cod_requisicao
    LOOP
    --Insere os items do documento.
    insert into amx_documento_item(cod,quantidade,valor_total,cod_material,cod_documento)
    values(AMX_MOVIMENTACAO_ITEM_SEQ.nextval,c_item_req.qtd_fornecida,00,c_item_req.cod_mat,amx_documento_seq.currval);
    END LOOP;
    END;
    end if;
    end;
    When run, return a error because of the FK cod_material in still new in the PL/SQL world, so please help me.

    post also the complete returned error message.

  • ORA-01007 - variable not in select list error in pl\sql code

    Hi,
    When I tried to run this program I am getting below error:
    ORA-01007 - variable not in select list.Please help to resolve.
    Code:
    create or replace procedure "XX_BPM_DATA_P" (P_PROCESS_ID IN VARCHAR2)
    is
    TYPE l_entity_type IS TABLE OF xx_BPM_data.ENTITY%TYPE INDEX BY PLS_INTEGER;
    TYPE l_data_type IS TABLE OF XX_BPM_DATA.DATA%TYPE INDEX BY PLS_INTEGER;
    TYPE l_count_type IS TABLE OF XX_BPM_DATA.count%TYPE INDEX BY PLS_INTEGER;
    l_Entity_v l_Entity_type;
    l_data_v l_data_type;
    l_count_v l_count_type;
    l_security_group_id number;
    app_id number(20);
    l_Actual_value XX_BPM_DATA.DATA%TYPE;
    cursor BPM_CUR is select id,process_id , sequence, to_char(query) query,report_num from xx_test_bpm_dynamic
    where
        process_id = p_process_id
           and report_num=1
    order by process_id, sequence;
    BEGIN
    --delete xx_bpm_data where process_id = p_process_id;
    for bpm_rec in bpm_cur
    loop
    delete xx_bpm_data
    where process_id = bpm_rec.process_id
    and sequence = bpm_rec.sequence
    and report_num = bpm_rec.report_num;
    l_security_group_id := apex_custom_auth.get_session_id_from_cookie;
    --dbms_output.put_line(l_security_group_id);
    execute immediate bpm_rec.query BULK COLLECT INTO l_ENTITY_v,l_DATA_v,l_count_v;
    if (bpm_rec.report_num=2) then
    app_id:= 108;--NV('APP_ID');
    FORALL i IN l_ENTITY_v.FIRST..L_ENTITY_V.LAST
    INSERT INTO XX_BPM_DATA
        (EnTITY,
    value,data,count,
    Process_ID,
    Sequence,report_num)
    VALUES(l_entity_v(i),
    l_data_v(i),
    '<A HREF="f?p='||app_id||':301:'||':APP_SESSION'||'::::P301_process_id,p301_sequence,p301_id,p301_entity:'||bpm_rec.process_id||','||bpm_rec.sequence||','||bpm_rec.id||','||l_entity_v(i)||':">'||l_data_v(i)||'</A>',
        l_count_v(i),bpm_rec.process_id,
    BPM_rec.sequence,
    bpm_rec.report_num);
    else
    FORALL i IN l_ENTITY_v.FIRST..L_ENTITY_V.LAST
    INSERT INTO XX_BPM_DATA(EnTITY,data,
        count,
    Process_ID,
    Sequence,report_num)
    VALUES(l_entity_v(i),
    l_data_v(i),
        l_count_v(i),
        bpm_rec.process_id,
    BPM_rec.sequence,
    bpm_rec.report_num);
    end if;
    select round(avg(value),2) into l_actual_value from xx_bpm_data where process_id=bpm_rec.process_id and sequence=bpm_rec.sequence and report_num=bpm_rec.report_num;
    update xx_test_bpm_dynamic set value=l_actual_value where process_id=bpm_rec.process_id and sequence=Bpm_rec.sequence and report_num= bpm_rec.report_num;
    end loop;
    Commit;
    END;

    When I tried to run this program I am getting below error:
    ORA-01007 - variable not in select list.Please help to resolve.
    You likely would not need any help in you wrote and tested your code using standard best practices.
    Your code has NO exception handler and you are NOT identifying each step in the code so that the exception handler could print/log a message telling you EXACTLY which step raised the exception.,
    v_step NUMBER;
    -- before step 1
    v_step := 1;
    -- before step 2
    v_step := 2;
    Then in the exception handler the value of 'v_step' will tell you which step raised the exception.
    The exception you posted refers to a 'select list' so examine ALL of the select lists in your code. If you do that you will see that the primary query being run is obtained from a database table and then executed using dynamic SQL
    execute immediate bpm_rec.query BULK COLLECT INTO l_ENTITY_v,l_DATA_v,l_count_v;
    We have no way of knowing what query is in 'bpm_rec.query' when the exception happens or what columns that query returns. For all we know the query returns 2 columns and you are trying to load 3 collections. Or maybe the query returns 8 columns and you are trying to load 3 collections.
    Why don't you print out the query and execute it manually so you can see exactly what the result set looks like?
    dbms_output.put_line(bpm_rec.query);
    And don't even get us started on why you are using such security-prone dynamic sql to perform this processing instead of using ordinary SQL statements. Or why you are using associative arrays for the BULK COLLECT instead of nested tables.
    In short your code could blow up in several places and, because you have NO logging statements, control statements or exception handlers, anyone having to troubleshoot that code would have absolutely no idea what part of it may be the problem.

  • Error with PL/SQL code

    i am getting multiple errors when trying to insert data into a table through pl/sql declaration
    here are the errors:
    --Procedure to insert the values into section table(ex1.sql)
    declare
    v_section %type;
    begin
    v_section.SECTIONNO:=&no;
    v_section. DESCRIPTION:='&desc';
    v_section.SECTION_HEAD_EMPNO:=&empno
    insert into section values v_section;
    end;
    /When i execute the above pl/sql program i am getting errors:
    SQL> @ex1
    Enter value for no: 10
    old   4: v_section.SECTIONNO:=&no;
    new   4: v_section.SECTIONNO:=10;
    Enter value for desc: Sales
    old   5: v_section. DESCRIPTION:='&desc';
    new   5: v_section. DESCRIPTION:='Sales';
    Enter value for empno: 1005
    old   6: v_section.SECTION_HEAD_EMPNO:=&empno
    new   6: v_section.SECTION_HEAD_EMPNO:=1005
    v_section %type;
    ERROR at line 2:
    ORA-06550: line 2, column 12:
    PLS-00103: Encountered the symbol "%" when expecting one of the following:
    constant exception <an identifier>
    <a double-quoted delimited-identifier> table LONG_ double ref
    char time timestamp interval date binary national character
    nchar
    The symbol "<an identifier>" was substituted for "%" to continue.
    ORA-06550: line 7, column 1:
    PLS-00103: Encountered the symbol "INSERT" when expecting one of the following:
    * & = - + ; < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like
    between || multiset member SUBMULTISET_
    The sBTW,*section* table is:
    SQL> desc section;
    Name                                                              Null?    Type
    SECTIONNO                                                         NOT NULL NUMBER(2)
    DESCRIPTION                                                                VARCHAR2(30)
    SECTION_HEAD_EMPNO                                                         NUMBER(4)Kindly,correct me where i am doing wrong
    Thanks in advance!!

    Hi,
    where is the semicolon after v_section.DESCRIPTION :=&empno ?
    ---it should be section%rowtype not simply %rowtype
    Just copy paste the below code. It will work.
    DECLARE
      v_section   SECTION%ROWTYPE;
    BEGIN
      v_section.SECTIONNO := &NO;
      v_section.DESCRIPTION := '&desc';
      v_section.SECTION_HEAD_EMPNO := &empno;
      INSERT INTO SECTION
      VALUES v_section;
    END;
    /Test
    SQL> CREATE TABLE SECTION
      2  (
      3    SECTIONNO            NUMBER (2) NOT NULL,
      4    DESCRIPTION          VARCHAR2 (30),
      5    SECTION_HEAD_EMPNO   NUMBER (4)
      6  );
    Table created.
    SQL> DECLARE
      2    v_section   SECTION%ROWTYPE;
      3  BEGIN
      4    v_section.SECTIONNO := &NO;
      5    v_section.DESCRIPTION := '&desc';
      6    v_section.SECTION_HEAD_EMPNO := &empno;
      7 
      8    INSERT INTO SECTION
      9    VALUES v_section;
    10  END;
    11  /
    Enter value for no: 10
    old   4:   v_section.SECTIONNO := &NO;
    new   4:   v_section.SECTIONNO := 10;
    Enter value for desc: sales
    old   5:   v_section.DESCRIPTION := '&desc';
    new   5:   v_section.DESCRIPTION := 'sales';
    Enter value for empno: 1005
    old   6:   v_section.SECTION_HEAD_EMPNO := &empno;
    new   6:   v_section.SECTION_HEAD_EMPNO := 1005;
    PL/SQL procedure successfully completed.
    SQL> select * from section;
    SECTIONNO DESCRIPTION                    SECTION_HEAD_EMPNO
            10 sales                                        1005
    SQL> G.
    Edited by: Ganesh Srivatsav on Apr 8, 2011 2:54 PM

  • Cursor open error SQLSTT - 72000, SQL code - 969

    We have purchased a product called Access Manager for DB2 and installed it on our AS400. This gives us the connectivitiy to Oracle server with which we do the Warehouse management software interface using our legacy system on AS400.
    I have written several programs in SQLRPGLE and not quite sure as to how I can handle errors coming out of Oracle server.
    As per my knowledge in my programs, I do
    declare cursor
    open cursor
    fetch
    dow look for sqlstate
    fetch next row
    enddo
    close cursor
    I am also new to this much of SQL.
    Now, my programs are running in production and works just fine if we don;t have any issues with oracle server (database server down etc.).
    My question is if the database server goes down for any reason, my SQLRPGLE progam starts giving me cursor not open errors, the actual error is as follows:
    Connection to relational database HJAWCD1 already exists.
    ARDUPAR: ARDUPAR: rc=-1(OCI_ERROR) from OCIStmtExecute when asking for
    Describe-Info
    ARDUPAR(1): ORA-03114: not connected to ORACLE
    ARDAROC: rc = -1 from parse
    SQLSTATE class unknown - SQLSTATE 72000, SQLCODE -969.
    Cursor SEHOST not open.
    Cursor SEHOST not open.
    Cursor SEHOST not open.
    So although, the connection exist between the AS400 and Oracle server as suggested from first statement, but then the cursor is giving me problems of not opening.
    what I would like to know is how do I check in my SQL statement the error and somehow reconnect and open the cursor again.
    Please help in this regard, since I am not finding any help from iseries world becuase no one seems to have knowledge about this product that we have installed and I don;t have too mcuh of documentation on the product nor do I have any sample handling messages program using RPGLE between oracle and AS400 using the product.
    Regards
    Farhan Qadri

    It's been over a decade since I worked on an AS/400 (iSeries), but I've seen an ORA-03114 is thrown from the OCI when you've attempted an illegal statement. That error typically means you are no longer connected to the database. I'd guess that your new application has a defective RPG error management routine.
    Good luck, Michael

  • Rectify the error in PL/SQL code

    CMW_BC_CALC_OF_FIN_YR_SDATE is a function which returns financial start date and CMW_BC_CALC_OF_FIN_YR_EDATE returns financial end date.
    I/P: 2004, 01-jan-2003
    O/P: A
    1 CREATE OR REPLACE FUNCTION CMW_BC_A_C_R
    2 (
    3 D IN VARCHAR2, RD IN DATE
    4 ) RETURN VARCHAR2 is
    5 SDATE DATE;
    6 EDATE DATE;
    7 TYPE VARCHAR2;
    8 BEGIN
    9 SDATE:=CMW_BC_CALC_OF_FIN_YR_SDATE(D);
    10 EDATE:=CMW_BC_CALC_OF_FIN_YR_EDATE(D);
    11 If RD<EDATE and RD>SDATE
    12 then TYPE:='C';
    13 end if;
    14 If RD>EDATE
    15 then TYPE:='A';
    16 end if;
    17 If RD<SDATE
    18 then TYPE:='R';
    19 end if;
    20 return(TYPE);
    21* END;
    SQL> /
    Warning: Function created with compilation errors.
    SQL> show error;
    Errors for FUNCTION CMW_BC_A_C_R:
    LINE/COL ERROR
    0/0 PL/SQL: Compilation unit analysis terminated
    4/11 PLS-00498: illegal use of a type before its declaration
    SQL>

    Hi,
    Use
    SELECT * FROM V$RESERVED_WORDS
    to know all the reserve words.
    Regards

  • Getting error while compiling this pl/sql code

    Hi,
    I am trying to execute the below block of pl/sql code and i encountering an error. i tried all possible combination of paranthesis and quotes. still giving error. can someone please help?
    IF inserting THEN
    pk_imdb_audit.p_ins_characteristic_a_t
    (in_'||rpad(column_name,35,' ')||'=> pk_imdb_audit.v_action_inserting,'
    WHEN max_col = column_id THEN
    in_'||rpad(column_name,35,' ')||'=> '||lower(in_col_value)||');'
    ELSE
    ' in_'||rpad(column_name,35,' ')||'=> '||lower(in_col_value)||','
    END text,
    table_name,
    column_id,
    2 disp_ord
    error snapshot:-
    ORA-06550: line 14, column 14:
    PLS-00103: Encountered the symbol "||rpad(column_name,35," when expecting one of the following:
    . ( ) , * @ % & | = - + < / > at in is mod remainder not
    range rem => .. <an exponent (**)> <> or != or ~= >= <= <>
    and or like LIKE2_ LIKE4_ LIKEC_ as between from using ||
    multiset member SUBMULTISET_
    The symbol "( was inserted before "||rpad(column_name,35," to continue.
    ORA-06550: line 15, column 13:
    PLS-00103: Encountered the symbol "WHEN" when expecting one of th

    Hi,
    here is a 'parseable' version of your query, but there is numerous ways to improve what you want to do (not sure even if the query is giving you what you're expecting from it):
    SELECT text
    FROM   (SELECT (CASE
                       WHEN min_col = max_col THEN    'CREATE OR REPLACE TRIGGER '
                                                   || SUBSTR(column_name,
                                                             1,
                                                             4
                                                   || 'aud
    AFTER INSERT
    OR UPDATE
    OF '
                                                   || column_name
                                                   || ',
    OR DELETE ON imdb.'
                                                   || table_name
                                                   || '
    FOR EACH ROW'
                       ELSE(CASE
                               WHEN min_col = column_id THEN    'CREATE OR REPLACE TRIGGER '
                                                             || SUBSTR(column_name,
                                                                       1,
                                                                       4
                                                             || 'aud
    AFTER INSERT
    OR UPDATE
    OF '
                                                             || column_name
                                                             || ','
                               ELSE(CASE
                                       WHEN max_col = column_id THEN    ' '
                                                                     || column_name
                                                                     || '
    OR DELETE ON imdb.'
                                                                     || table_name
                                                                     || '
    FOR EACH ROW'
                                       ELSE(CASE
                                               WHEN column_id IS NULL THEN    'CREATE OR REPLACE TRIGGER '
                                                                           || SUBSTR
                                                                                 (column_name,
                                                                                  1,
                                                                                  4
                                                                           || 'aud
    AFTER INSERT
    OR UPDATE
    OR DELETE ON imdb.'
                                                                           || table_name
                                               ELSE    ' '
                                                    || column_name
                                                    || ','
                                            END
                                    END
                            END
                    END
                   ) text,
                   table_name1 table_name,
                   column_id,
                   1 disp_ord
            FROM   (SELECT LOWER(REPLACE(column_name,
                                         'O_',
                                        )) column_name,                   /*changing O to O_*/
                           LOWER(REPLACE(t.table_name,
                                         '_A_',
                                        )) table_name,
                           LOWER(t.table_name) table_name1,
                           c.column_id,
                           MIN(column_id) OVER(PARTITION BY c.table_name) min_col,
                           MAX(column_id) OVER(PARTITION BY c.table_name) max_col
                    FROM   all_tab_columns c,
                           (SELECT object_name table_name
                            FROM   all_objects
                            WHERE  TRUNC(created) = TRUNC(SYSDATE)
                            AND    object_name = 'CHARACTERISTIC_A_T') t
    --AND object_name LIKE 'IMDB/_A/_%' ESCAPE '/') t /*commented this line for testing*/
                    WHERE  c.table_name(+) = t.table_name
                    AND    SUBSTR(column_name(+),
                                  1,
                                  2
                                 ) = 'O_'))
              /*changed the substring condition to match new changes*/
    UNION ALL
    SELECT (CASE
               WHEN min_col = column_id THEN    'DECLARE
    BEGIN
    IF inserting THEN
    pk_imdb_audit.p_ins_characteristic_a_t
    (in_'
                                             || RPAD(column_name,
                                                     35,
                                             || '=> pk_imdb_audit.v_action_inserting,'
               ELSE(CASE
                       WHEN max_col = column_id THEN    'in_'
                                                     || RPAD(column_name,
                                                             35,
                                                     || '=> '
                                                     || LOWER(in_col_value)
                                                     || ');'
                       ELSE    ' in_'
                            || RPAD(column_name,
                                    35,
                            || '=> '
                            || LOWER(in_col_value)
                            || ','
                    END
            END
           ) text /*,
           table_name,
           column_id,
           2 disp_ord*/
    FROM   (SELECT table_name,
                   column_name,
                   column_id,
                   min_col,
                   max_col,
                   in_col_value,
                   trg_header,
                      'in_'
                   || RPAD(column_name,
                           35,
                   || '=> '
                   || LOWER(in_col_value)
                   || ',' in_col
            FROM   (SELECT   LOWER(c.column_name) column_name,
                             LOWER(c.table_name) table_name,
                             c.column_id,
                             (CASE
                                 WHEN SUBSTR(column_name,
                                             1,
                                             2
                                            ) = 'N_' THEN
                                   /*changed the substring condition to match the new change*/
                                                            ':NEW.'
                                                         || REPLACE
                                                               (column_name,
                                                                'N_',
                                                                'N_'
                                            /*changed the condition to match new requirement*/
                                 WHEN SUBSTR(column_name,
                                             1,
                                             2
                                            ) = 'O_' THEN
                                   /*changed the substring condition to match the new change*/
                                                         'NULL'
                                 ELSE    ':NEW.'
                                      || REPLACE(column_name,
                                                 '_A_',
                              END
                             ) in_col_value,
                             LOWER(SUBSTR(column_name,
                                          1,
                                          3
                                         )) trg_header,
                             MIN(column_id) OVER(PARTITION BY c.table_name) min_col,
                             MAX(column_id) OVER(PARTITION BY c.table_name) max_col
                    FROM     all_tab_columns c
                    WHERE    c.table_name IN(
                                SELECT object_name
                                FROM   all_objects
                                WHERE  TRUNC(created) = TRUNC(SYSDATE)
                                AND    object_name = 'CHARACTERISTIC_A_T')
                    ORDER BY c.table_name,
                             c.column_id))

  • Am facing this error sqlcode :-6502 while running sql code in plsql block

    Am facing this error sqlcode :-6502 while running sql code in plsql block.
    am using query :
    SELECT SUBSTR('123456DE789KL|987654321|B',1,INSTR('123456DE789KL|987654321|B','|')-1) FROM DUAL;
    CAN any body tell me why.

    BD_Fayez wrote:
    I've tried the following, but don't get any error.As I mentioned, most likely variable is too short:
    SQL> declare
      2  strSub varchar2(2);
      3  begin
      4  SELECT SUBSTR('123456DE789KL|987654321|B',1,INSTR('123456DE789KL|987654321|B','|')-1) into strSub FROM DUAL;
      5  dbms_output.put_line(strSub);
      6  end;
      7  /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 4
    SQL> SY.

  • ERROR in inserting values in table  PL/SQL code

    Hello Friends,
    I am facing a peculiar logical error in my PL/SQL code. PFB the code for your reference -
    for k in (select account_no from mirror_lookup_accnt_hierarchy where mdate = sys_date) LOOP
    dbms_output.put_line(' SYSDATE :!! '||sys_date||' '||k.account_no);
    insert into sfdc_account select * from mirror_sfdc_account where sap_account_id__c=k.account_no;
    commit;
    end loop;
    Just to elaborate on the code functionality......
    The outer FOR loop on the table has the records in the order i want to populate in the final sfdc_account table.
    Now, i compare the account_no of the table mirror_sfdc_account table with the account_no of the FOR LOOP and INSERT that record in the final sfdc_account table. So, it is entered according to the order i want to have.
    The problem is, this code runs fine for the first time, but then on it does not popuate the values in the right order according to the FOR LOOP values.
    I have tried deleting data and running again, but the error persists. It enters the records but NOT IN ORDER according to the condition i have given!!
    Kindly Help.....what can be the problem!!
    Thanks and Regards,

    Hi friend,
    The thing is that we need to populate the final
    table based on a hierarchy,the relation between
    parent and child fieldNo. The thing is.... that Oracle is a relational database. That means that the data is stored in a relational manner, not in an ordered manner, such as you get with COBOL and it's flat file format.
    You CANNOT rely on the database to store data in an ordered manner.
    If you require the data in some sort of order when you retrieve it then you MUST store information against the data which can be used to determine that order and you MUST specify an ORDER BY clause on your query that retrieves the data.
    Internally Oracle will not maintain the order of the data for you automatically.
    This is a simple truth.

  • Uncompiled PL/SQL Code error in Reports 6i

    I have made a report using Report 6i. Have compiled, saved & run it several times. Very often, when I run it, I get the error message: "Uncompiled PL/SQL code".
    Can anyone help me to get rid of this error?

    hello,
    there are some restrictions on calling specific packages from the database via a remote procedure call. DBMS_SQL is one of them. there is a built-in package called EXEC_SQL that enables you to manage dynamic SQL. use this instead of the database-packages ... for further information on the use of DBMS_* packages see the application developers guide of the database.
    regards,
    the oracle reports team

  • Got the following reply from db-kernel: SQL-Code :-903

    Dear Experts,
    I am having a problem running MaxDB Data backup on Netbackup.... Please se log below and suggest.
    2011-04-11 13:30:38
    Using environment variable 'TEMP' with value 'C:\Windows\TEMP' as directory for temporary files and pipes.
    Using connection to Backint for MaxDB Interface.
    2011-04-11 13:30:39
    Checking existence and configuration of Backint for MaxDB.
        Using configuration variable 'BSI_ENV' = 'C:\Netbackup_Script\bsi_backint_daily.env' as path of the configuration file of Backint for MaxDB.
        Setting environment variable 'BSI_ENV' for the path of the configuration file of Backint for MaxDB to configuration value 'C:\Netbackup_Script\bsi_backint_daily.env'.
        Reading the Backint for MaxDB configuration file 'C:\Netbackup_Script\bsi_backint_daily.env'.
            Found keyword 'BACKINT' with value 'D:\sapdb\KGP\db\bin\backint.exe'.
            Found keyword 'INPUT' with value 'E:\sapdb\data\wrk\KGP\backint.input'.
            Found keyword 'OUTPUT' with value 'E:\sapdb\data\wrk\KGP\backint.output'.
            Found keyword 'ERROROUTPUT' with value 'E:\sapdb\data\wrk\KGP\backint.error'.
            Found keyword 'PARAMETERFILE' with value 'C:\Netbackup_Script\backint_parameter_daily.txt'.
        Finished reading of the Backint for MaxDB configuration file.
        Using 'D:\sapdb\KGP\db\bin\backint.exe' as Backint for MaxDB program.
        Using 'E:\sapdb\data\wrk\KGP\backint.input' as input file for Backint for MaxDB.
        Using 'E:\sapdb\data\wrk\KGP\backint.output' as output file for Backint for MaxDB.
        Using 'E:\sapdb\data\wrk\KGP\backint.error' as error output file for Backint for MaxDB.
        Using 'C:\Netbackup_Script\backint_parameter_daily.txt' as parameter file for Backint for MaxDB.
        Using '300' seconds as timeout for Backint for MaxDB in the case of success.
        Using '300' seconds as timeout for Backint for MaxDB in the case of failure.
        Using 'E:\sapdb\data\wrk\KGP\dbm.knl' as backup history of a database to migrate.
        Using 'E:\sapdb\data\wrk\KGP\dbm.ebf' as external backup history of a database to migrate.
        Checking availability of backups using backint's inquire function.
    Check passed successful.
    2011-04-11 13:30:39
    Checking medium.
    Check passed successfully.
    2011-04-11 13:30:39
    Preparing backup.
        The environment variable 'BSI_ENV' has already the value 'C:\Netbackup_Script\bsi_backint_daily.env'.
        Setting environment variable 'BI_CALLER' to value 'DBMSRV'.
        Setting environment variable 'BI_REQUEST' to value 'NEW'.
        Setting environment variable 'BI_BACKUP' to value 'FULL'.
        Constructed Backint for MaxDB call 'D:\sapdb\KGP\db\bin\backint.exe -u KGP -f backup -t file -p C:\Netbackup_Script\backint_parameter_daily.txt -i E:\sapdb\data\wrk\KGP\backint.input -c'.
        Created temporary file 'E:\sapdb\data\wrk\KGP\backint.output' as output for Backint for MaxDB.
        Created temporary file 'E:\sapdb\data\wrk\KGP\backint.error' as error output for Backint for MaxDB.
        Writing 'D:\sapdb\pipe2 #PIPE' to the input file.
    Prepare passed successfully.
    2011-04-11 13:30:39
    Starting database action for the backup.
        Requesting 'SAVE DATA QUICK TO 'D:\sapdb\pipe2' PIPE BLOCKSIZE 8 NO CHECKPOINT MEDIANAME 'BACKDBFULL'' from db-kernel.The database is working on the request.
    2011-04-11 13:30:39
    Waiting until database has prepared the backup.
        Asking for state of database.
        2011-04-11 13:30:39 Database is still preparing the backup.
        Waiting 1 second ... Done.
        Asking for state of database.
        2011-04-11 13:30:41 Database has finished preparation of the backup.
    The database has prepared the backup successfully.
    2011-04-11 13:30:41
    Starting Backint for MaxDB.
        Starting Backint for MaxDB process 'D:\sapdb\KGP\db\bin\backint.exe -u KGP -f backup -t file -p C:\Netbackup_Script\backint_parameter_daily.txt -i E:\sapdb\data\wrk\KGP\backint.input -c >>E:\sapdb\data\wrk\KGP\backint.output 2>>E:\sapdb\data\wrk\KGP\backint.error'.
        Process was started successfully.
    Backint for MaxDB has been started successfully.
    2011-04-11 13:30:41
    Waiting for end of the backup operation.
        2011-04-11 13:30:41 The backup tool is running.
        2011-04-11 13:30:41 The database is working on the request.
        2011-04-11 13:30:43 The database has finished work on the request.
        Receiving a reply from the database kernel.
        Got the following reply from db-kernel:
            SQL-Code              :-903
        2011-04-11 13:30:43 The backup tool is running.
        2011-04-11 13:30:44 The backup tool process has finished work with return code 2.
    The backup operation has ended.
    2011-04-11 13:30:44
    Filling reply buffer.
        Have encountered error -24920:
            The backup tool failed with 2 as sum of exit codes. The database request failed with error -903.
        Constructed the following reply:
            ERR
            -24920,ERR_BACKUPOP: backup operation was unsuccessful
            The backup tool failed with 2 as sum of exit codes. The database request failed with error -903.
    Reply buffer filled.
    2011-04-11 13:30:44
    Cleaning up.
        Copying output of Backint for MaxDB to this file.
    Begin of output of Backint for MaxDB (E:\sapdb\data\wrk\KGP\backint.output)----
            Reading parameter file C:\Netbackup_Script\backint_parameter_daily.txt.
            Using D:\sapdb\KGP\db\bin\backint.exe as Backint for Oracle.
            Using C:\Netbackup_Script\nt_initKGPdaily.utl as parameterfile of Backint for Oracle.
            Using E:\sapdb\data\wrk\KGP\backinthistory.log as history file.
            Using E:\sapdb\data\wrk\KGP\backintoracle.in as input of Backint for Oracle.
            Using E:\sapdb\data\wrk\KGP\backintoracle.out as output of Backint for Oracle.
            Using E:\sapdb\data\wrk\KGP\backintoracle.err as error output of Backint for Oracle.
            Using staging area D:\sapdb\Stage1 with a size of 2147483648 bytes.
            Reading input file E:\sapdb\data\wrk\KGP\backint.input.
            Backing up pipe D:\sapdb\pipe2.
            Found 1 entry in the input file.
            Starting the backup.
            Starting pipe2file program(s).
            Waiting for creation of temporary files.
            1 temporary file is available for backup.
            Calling Backint for Oracle at 2011-04-11 13:30:43.
            Calling 'D:\sapdb\KGP\db\bin\backint.exe -u KGP -f backup -t file -p C:\Netbackup_Script\nt_initKGPdaily.utl -i E:\sapdb\data\wrk\KGP\backintoracle.in -c' .
            Backint for Oracle ended at 2011-04-11 13:30:43 with return code 2.
            Backint for Oracle output: Reading parameter file C:\Netbackup_Script\nt_initKGPdaily.utl.
            Backint for Oracle output: Using E:\sapdb\data\wrk\KGP\backint4oracle.in as input of Backint for Oracle.
            Backint for Oracle output: Using E:\sapdb\data\wrk\KGP\backint4oracle.out as output of Backint for Oracle.
            Backint for Oracle output: Using E:\sapdb\data\wrk\KGP\backint4oracle.err as error output of Backint for Oracle.
            Backint for Oracle output: Using staging area D:\sapdb\Stage1 with a size of 2147483648 bytes.
            Backint for Oracle output: Using E:\sapdb\data\wrk\KGP\backinthistory.log as history file.
            Backint for Oracle output: Using D:\sapdb\KGP\db\bin\backint.exe as Backint for Oracle.
            Backint for Oracle output:
            Backint for Oracle output: Reading input file E:\sapdb\data\wrk\KGP\backintoracle.in.
            Backint for Oracle output: Backing up file D:\sapdb\Stage1.0.
            Backint for Oracle output: Found 1 entry in the input file.
            Backint for Oracle output:
            Backint for Oracle output: Starting the backup.
            Backint for Oracle output: Starting pipe2file program(s).
            Backint for Oracle output:
            Backint for Oracle output: Calling Backint for Oracle at 2011-04-11 13:30:43.
            Backint for Oracle output: Calling 'D:\sapdb\KGP\db\bin\backint.exe -u KGP -f backup -t file -i E:\sapdb\data\wrk\KGP\backint4oracle.in -c' .
            Backint for Oracle output: Backint for Oracle ended at 2011-04-11 13:30:43 with return code 2.
            Backint for Oracle output: Backint for Oracle output: Reading parameter file .
            Backint for Oracle output: Backint for Oracle output:
            Backint for Oracle output: Backint for Oracle output:
            Backint for Oracle output: Backint for Oracle error output: No staging area is defined in the parameter file.
            Backint for Oracle output: Backint for Oracle error output: The path of Backint for Oracle is not defined in the parameter file.
            Backint for Oracle output: Backint for Oracle error output: The name of the history file is not defined in the parameter file.
            Backint for Oracle output: Backint for Oracle error output: The name of the input file of Backint for Oracle is not defined in the parameter file.
            Backint for Oracle output: Backint for Oracle error output: The name of the output file of Backint for Oracle is not defined in the parameter file.
            Backint for Oracle output: Backint for Oracle error output: The name of the error output file of Backint for Oracle is not defined in the parameter file.
            Backint for Oracle output: Backint for Oracle error output:
            Backint for Oracle output:
            Backint for Oracle output: Finished the backup unsuccessfully.
            Backint for Oracle output:
            Backint for Oracle output: #ERROR D:\sapdb\Stage1.0
            Backint for Oracle output:
            Backint for Oracle error output: Backint for Oracle was unsuccessful.
            Backint for Oracle error output:
            Finished the backup unsuccessfully.
            #ERROR D:\sapdb\pipe2
    End of output of Backint for MaxDB (E:\sapdb\data\wrk\KGP\backint.output)----
        Removed Backint for MaxDB's temporary output file 'E:\sapdb\data\wrk\KGP\backint.output'.
        Copying error output of Backint for MaxDB to this file.
    Begin of error output of Backint for MaxDB (E:\sapdb\data\wrk\KGP\backint.error)----
            Backint for Oracle was unsuccessful.
    End of error output of Backint for MaxDB (E:\sapdb\data\wrk\KGP\backint.error)----
        Removed Backint for MaxDB's temporary error output file 'E:\sapdb\data\wrk\KGP\backint.error'.
        Removed the Backint for MaxDB input file 'E:\sapdb\data\wrk\KGP\backint.input'.
    Have finished clean up successfully.

    >     Requesting 'SAVE DATA QUICK TO 'D:\sapdb\pipe2' PIPE BLOCKSIZE 8 NO CHECKPOINT MEDIANAME 'BACKDBFULL'' from db-kernel.The database is working on the request.
    This seems to be your problem, the pipe is wrongly defined. On Windows it looks like
    \\.\pipe1
    see
    http://msdn.microsoft.com/en-us/library/aa365783.aspx
    Markus

  • REPORT WITH PL/SQL  CODE

    DECLARE
    SQ VARCHAR2(100);
    BEGIN
    SQ := 'SELECT * FROM EMP WHERE EMPNO=7788';
    RETURN SQ;
    END
    THE ABOVE PL/SQL CODE WORKING FINE
    BUT I NEED CONDITION BASED ON ENAME
    SQ:='SELECT * FROM EMP WHERE ENAME=''SCOTT'';
    IT IS GIVEING ERROR
    WHAT TO DO?

    Hi,
    You're missing the final quote - you have the quotes for SCOTT but not the one to close the SQ string:
    DECLARE
    SQ VARCHAR2(100);
    BEGIN
    SQ := 'SELECT * FROM EMP WHERE EMPNO=''SCOTT''';
    RETURN SQ;
    ENDAndy

  • PL/SQL Code not working without debug statements

    Hi Guys,
    I have a pl/sql code in a procedure, logic iterates through almost 40K records, conditional delete and update.
    When I execute this code, I dont see the deletes and updates happening, though procedure executes for 8 minutes and exits wihtout any error, execption.
    In same procedure when I write some debug statements like dbms_output, then everything seems to be working fine.
    I know this scenario happens in Oracle Forms, wehre we use SYNCHRONIZE.
    But this is plain pl/sql procedure.
    any thoughts on this?
    Av.

    COMMIT ?
    Aside from that, no idea what your procedure looks like, what it does, what version of Oracle you are using, how you are determining "I dont see the deletes and updates happening". etc...
    You'd need to provide a slew of information for anyone to give you any meaningful help.
    I can only assure you that DBMS_OUTPUT doesn't do magic :)

  • 4.7 Enterprise install error in catproc.sql phase(RedHat5- Oracle 10.2.0.4)

    Hi,
    I am installing SAP 4.7 Enterprise on Red Hat 5.3 and Oracle 10.2.0.4. When I install 4.7 Enterpirse I have an error in catproc.sql phase like below: -
    ERROR 2009-06-02 18:42:34
    CJS-00084  SQL statement or script failed.<br>DIAGNOSIS: Error message: ORA-955 for defaultdestSQL> Rem     bnainani   11/29/00  - specify compatible=8.0 for create_queue_tableSQL> Rem     liwong     10/20/00  - add def$_destination.flagSQL> Rem     bnainani   11/15/00  - specify compatible=8.0 for queue tableSQL> Rem     narora     09/13/00  - add comment on new def$_destination columnsSQL> Rem     liwong     09/01/00  - add master w/o quiesce: fixesSQL> Rem     liwong     07/12/00  - add total_prop_time_latSQL> Rem     liwong     06/29/00  - add total_txn_count, total_prop_timeSQL> Rem     liwong     05/17/00  - add_master_db w/o quiesceSQL> Rem     jstamos    05/17/00  - add_master_db w/o quiesceSQL> Rem     elu        01/24/00  - add column apply_init to def$_destinationSQL> Rem     alakshmi   12/02/99  - Bug 979398: Before-row insert trigger onSQL> Rem                            def$_propagatorSQL> Rem     wesmith    10/31/98 -  change shape of table def$_pushed_transactionsSQL> Rem     jnath      02/23/98 -  bug 601972: split anonymous pl/sql blocksSQL> Rem     wesmith    01/21/98 -  create def$_pushed_transactions table forSQL> Rem                            server-side RepAPISQL> Rem     nbhatt     07/27/97 -  change create_queuetable -> create_queue_tableSQL> Rem     nbhatt     04/21/97 -  change 'TRACKING' in CREATE_QUEUE to 'DEPENDENCYSQL> Rem     nbhatt     04/21/97 -  change syntax of create_queueSQL> Rem     liwong     04/16/97 -  Alter view system.AQ$DEF$_AQ{CALL,ERROR}SQL> Rem     liwong     04/11/97 -  Fixing defaultdest_primary typoSQL> Rem     jstamos    04/10/97 -  remove unneeded indexesSQL> Rem     nbhatt     04/08/97 -  change create_qtable to create_queuetableSQL> Rem     jstamos    04/04/97 -  tighter AQ integrationSQL> Rem     liwong     04/02/97 -  Add schema_name, package_name in def$_calldestSQL> Rem     ato        03/31/97 -  create_qtable interface changeSQL> Rem     liwong     03/25/97 -  remove batch_no from def$_tranorderSQL> Rem     liwong     02/24/97 -  pctversion --> 0 for def$_aqcall, def$_aqerrorSQL> Rem     liwong     02/22/97 -  Remove dropping view aq$def$_aqcallSQL> Rem     ademers    02/07/97 -  Remove constraint def$_calldest_callSQL> Rem     liwong     01/11/97 -  drop and create aq$def$_aqcall (temporary)SQL> Rem     liwong     01/10/97 -  Alter view aq$def$_aqcallSQL> Rem     liwong     01/07/97 -  Alter default value for batch_noSQL> Rem     jstamos    12/23/96 -  change temp$nclob colSQL> Rem     jstamos    11/21/96 -  nchar supportSQL> Rem     sjain      11/11/96 -  Remove dummy buffer # commentSQL> Rem     asgoel     11/05/96 -  Disable misc_tracking in def$_aqerrorSQL> Rem     sjain      11/06/96 -  deferror changesSQL> Rem     vkrishna   10/28/96 -  change STORED IN to STORE AS for lobSQL> Rem     sjain      10/02/96 -  Aq conversionSQL> Rem     sbalaram   09/24/96 -  ARPC performance - add foreign key indexSQL> Rem     jstamos    09/06/96 -  rename temp$lob and temporarily change nclobSQL> Rem     sjain      09/03/96 -  AQ conversonSQL> Rem     ademers    08/02/96 -  queue_batch default in def_destinationSQL> Rem     ademers    07/29/96 -  queue_batch default in def_callSQL> Rem     ademers    07/29/96 -  queue_batch defaultSQL> Rem     jstamos    07/24/96 -  add system.temp$lobSQL> Rem     sbalaram   07/22/96 -  create def$_aqcall and def$_aqerror tablesSQL> Rem     jstamos    06/12/96 -  LOB support for deferred RPCsSQL> Rem     ldoo       06/28/96 -  Comment out queue_table from def_tranorderSQL> Rem     ademers    05/30/96 -  create def_originSQL> Rem     ademers    05/28/96 -  fix def_destination col namesSQL> Rem     ldoo       05/09/96 -  New security modelSQL> Rem     sjain      05/01/96 -  add seq col to def_destinationSQL> Rem     ademers    04/29/96 -  add batch_no, dep_scn to def_callSQL> Rem     jstamos    12/04/95 -  324303: use index to avoid sorting the queueSQL> Rem     jstamos    08/17/95 -  code review changesSQL> Rem     jstamos    08/16/95 -  add comments to tablesSQL> Rem     wmaimone   01/04/96 -  7.3 mergeSQL> Rem     hasun      01/31/95 -  Modify tables.<br>SOLUTION: See ora_sql_results.log and the Oracle documentation for details.
    Also  some error lines in ora_sql_results.log file like below:
    Connected to an idle instance.
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux-x86_64 Error: 2: No such file or directory
    Disconnected
    DOC>     The following statement will cause an "ORA-01722: invalid number"
    DOC>     error and terminate the SQLPLUS session if the user is not SYS.
    DOC>     Disconnect and reconnect with AS SYSDBA.
    ERROR at line 1:
    ORA-01432: public synonym to be dropped does not exist
    ERROR at line 1:
    ORA-00942: table or view does not exist
    DOC>     The following PL/SQL block will cause an ORA-20000 error and
    DOC>     terminate the current SQLPLUS session if the user is not SYS.
    DOC>     Disconnect and reconnect with AS SYSDBA.
    ERROR at line 1:
    ORA-01921: role name 'EXP_FULL_DATABASE' conflicts with another user or role
    name
    ERROR at line 1:
    ORA-01434: private synonym to be dropped does not exist
    ERROR at line 1:
    ORA-04043: object DIANA does not exist
    ERROR at line 1:
    ORA-04043: object DIUTIL does not exist
    ERROR at line 1:
    ORA-04043: object DIUTIL does not exist
    ERROR at line 1:
    ORA-04043: object SUBPTXT2 does not exist
    ERROR at line 1:
    ORA-04043: object CREATE_TABLE_COST_COLUMNS does not exist
    ERROR at line 1:
    ORA-01434: private synonym to be dropped does not exist
    And ora_sql.log  file is:
    connect  /  as sysdba ;
    SHUTDOWN ABORT;
    exit;
    Executed successfully.
    connect  /  as sysdba ;
    SHUTDOWN IMMEDIATE;
    exit;
    Executed with error.
    connect  /  as sysdba ;
    STARTUP NOMOUNT;
    exit;
    Executed successfully.
    connect  /  as sysdba ;
    CREATE DATABASE MDP CONTROLFILE REUSE  MAXLOGFILES 255 MAXLOGMEMBERS 3 MAXLOGHISTORY 1000 MAXDATAFILES 254 MAXINSTANCES 50 NOARCHIVELOG CHARACTER SET UTF8 NATIONAL CHARACTER SET UTF8 DATAFILE '/oracle/MDP/sapdata1/system_1/system.data1' SIZE 350M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M EXTENT MANAGEMENT LOCAL DEFAULT TEMPORARY TABLESPACE PSAPTEMP TEMPFILE '/oracle/MDP/sapdata1/temp_1/temp.data1' SIZE 1750M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M UNDO TABLESPACE PSAPUNDO DATAFILE '/oracle/MDP/sapdata1/undo_1/undo.data1' SIZE 700M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M SYSAUX DATAFILE '/oracle/MDP/sapdata1/sysaux_1/sysaux.data1' SIZE 1000M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M
    LOGFILE GROUP 1 ('/oracle/MDP/origlogA/log_g11m1.dbf',
    '/oracle/MDP/mirrlogA/log_g11m2.dbf') SIZE 50M  REUSE ,
    GROUP 2 ('/oracle/MDP/origlogB/log_g12m1.dbf',
    '/oracle/MDP/mirrlogB/log_g12m2.dbf') SIZE 50M  REUSE ,
    GROUP 3 ('/oracle/MDP/origlogA/log_g13m1.dbf',
    '/oracle/MDP/mirrlogA/log_g13m2.dbf') SIZE 50M  REUSE ,
    GROUP 4 ('/oracle/MDP/origlogB/log_g14m1.dbf',
    '/oracle/MDP/mirrlogB/log_g14m2.dbf') SIZE 50M  REUSE
    exit;
    Executed successfully.
    connect  /  as sysdba ;
    set newpage 0
    set space 0
    set pagesize 0
    set linesize 32767
    set markup HTML off
    set heading off
    set verify off
    set feedback off
    set trimspool on
    set sqlprompt SQL>
    set termout on
    set verify off
    set echo off
    spool ora_query3_tmp0_1.res
    SELECT STATUS FROM V$INSTANCE;
    spool off
    exit;
    Executed successfully.
    connect  /  as sysdba ;
    @@/oracle/MDP/102_64/rdbms/admin/catalog.sql
    exit;
    Executed successfully.
    connect  /  as sysdba ;
    set newpage 0
    set space 0
    set pagesize 0
    set linesize 32767
    set markup HTML off
    set heading off
    set verify off
    set feedback off
    set trimspool on
    set sqlprompt SQL>
    set termout on
    set verify off
    set echo off
    spool ora_query3_tmp0_1.res
    SELECT STATUS FROM V$INSTANCE;
    spool off
    exit;
    Executed successfully.
    connect  /  as sysdba ;
    @@/oracle/MDP/102_64/rdbms/admin/catblock.sql
    exit;
    Executed successfully.
    connect  /  as sysdba ;
    set newpage 0
    set space 0
    set pagesize 0
    set linesize 32767
    set markup HTML off
    set heading off
    set verify off
    set feedback off
    set trimspool on
    set sqlprompt SQL>
    set termout on
    set verify off
    set echo off
    spool ora_query3_tmp0_1.res
    SELECT STATUS FROM V$INSTANCE;
    spool off
    exit;
    Executed successfully.
    connect  /  as sysdba ;
    @@/oracle/MDP/102_64/rdbms/admin/catproc.sql
    exit;
    Executed with error.
    connect  /  as sysdba ;
    set newpage 0
    set space 0
    set pagesize 0
    set linesize 32767
    set markup HTML off
    set heading off
    set verify off
    set feedback off
    set trimspool on
    set sqlprompt SQL>
    set termout on
    set verify off
    set echo off
    spool ora_query3_tmp0_1.res
    SELECT STATUS FROM V$INSTANCE;
    spool off
    exit;
    Executed successfully.
    connect  /  as sysdba ;
    @@/oracle/MDP/102_64/rdbms/admin/catproc.sql
    exit;
    Executed with error.
    connect  /  as sysdba ;
    set newpage 0
    set space 0
    set pagesize 0
    set linesize 32767
    set markup HTML off
    set heading off
    set verify off
    set feedback off
    set trimspool on
    set sqlprompt SQL>
    set termout on
    set verify off
    set echo off
    spool ora_query3_tmp0_1.res
    SELECT STATUS FROM V$INSTANCE;
    spool off
    exit;
    Executed successfully.
    connect  /  as sysdba ;
    @@/oracle/MDP/102_64/rdbms/admin/catproc.sql
    exit;
    Executed with error.
    connect  /  as sysdba ;
    set newpage 0
    set space 0
    set pagesize 0
    set linesize 32767
    set markup HTML off
    set heading off
    set verify off
    set feedback off
    set trimspool on
    set sqlprompt SQL>
    set termout on
    set verify off
    set echo off
    spool ora_query3_tmp0_1.res
    SELECT STATUS FROM V$INSTANCE;
    spool off
    exit;
    Executed successfully.
    connect  /  as sysdba ;
    @@/oracle/MDP/102_64/rdbms/admin/catproc.sql
    exit;
    Executed with error.
    connect  /  as sysdba ;
    set newpage 0
    set space 0
    set pagesize 0
    set linesize 32767
    set markup HTML off
    set heading off
    set verify off
    set feedback off
    set trimspool on
    set sqlprompt SQL>
    set termout on
    set verify off
    set echo off
    spool ora_query3_tmp0_1.res
    SELECT STATUS FROM V$INSTANCE;
    spool off
    exit;
    Executed successfully.
    connect  /  as sysdba ;
    @@/oracle/MDP/102_64/rdbms/admin/catproc.sql
    exit;
    Executed with error.
    The errors are like these. How can I correct these errors and continue to installation? Is the oracle version 10.2.0.4  not correct version to install 4.7 enterprise on Red Hat Linux 5.3?
    Best regards,

    Hi Markus,
    I found 5 ERROR. There are different lines.
    First one:
          <fld name="STATUS">
            <strval><![CDATA[ERROR]]>
    Second one:
    CASE (= 'AUTOALLOCATE') RETURN (' AUTOALLOCATE '),
                    CASE (DEFAULT) RETURN (' ERROR ' + (tTablespaces.extMgmtAllocMode 
    Third one:
    CASE (= 'DICTIONARY') RETURN (' DICTIONARY '),
                  CASE (DEFAULT) RETURN (' ERROR ' + (tTablespaces.extMgmtMode 
    Fourth one:
    CASE (= 'AUTOALLOCATE') RETURN (' AUTOALLOCATE '),
                    CASE (DEFAULT) RETURN (' ERROR ' + (tTablespaces.extMgmtAllocMode 
    Fifth one:
    CASE (= 'DICTIONARY') RETURN (' DICTIONARY '),
                  CASE (DEFAULT) RETURN (' ERROR ' + (tTablespaces.extMgmtMode 
    Which one will I change to OK? Must all off them change to OK?
    Also is this problem about only these oracle error in your oppinion? For example in first line of ora_sql_results.log I have an error like below:
    CJS-00084 SQL statement or script failed
    Connected to an idle instance.
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    But ORACLE_HOME and ORACLE_SID environment variable are ok. Also I can connect and start and stop database manually. There is no problem about it.
    I installed anly Oracle patch 10.2.0.4. I didn't install any oracle interim patch. Should I have install oracle interim patch for Oracle 10.2.0.4?
    Best regards,

  • XML Parsing error in PL/SQL

    Hello,
    I have some problem in parsing Mircrosoft OpenXML file using Oracle 10g Release2 XML Parser for PL/SQL.
    I use dbms_xmlparser, dbms_xmldom, dbms_xslprocessor packages
    OpenXML file use "w:" as namespace, so every element has prefix "w:" like
    <w:wordDocument ..>
    <w:body..>
    <w:p..>
    <w:r..>
    <w:t..>
    My job is to read OpenXML file inside PL/SQL code, parse it, and load it into the corresponding table.
    Here is my PL/SQL code.
    DECLARE
    doc dbms_xmldom.DOMDocument;
    node_list dbms_xmldom.DOMNodeList;
    l_node dbms_xmldom.DOMNode;
    one_element dbms_xmldom.DOMElement;
    PROCEDURE p (msg VARCHAR2, nl BOOLEAN := TRUE) IS
    BEGIN
    dbms_output.put_line (msg);
    IF nl THEN dbms_output.put(CHR(10)); END IF;
    END:
    BEGIN
    doc := xml.parse(BFileName('XML_DIR','OpenXMLFile.xml'));
    node_list := xpath.selectNodes(doc, '/w:wordDocument/w:body/w:p/w:r/w:t');
    FOR j IN 0..dbms_xmldom.getLength(node_list)-1
    LOOP
    p( xpath.valueOf(dbms_xmldom.item(node_list, j), '.'), nl=>FALSE );
    END LOOP;
    Here is the error message.
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: '/w:wordDocument/w:body/w:p/w:r/w:t
    [starts-with(., "!")]'
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 900
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 928
    ORA-06512: at "SYSTEM.XPATH", line 173
    ORA-06512: at "SYSTEM.XPATH", line 179
    ORA-06512: at line 38
    I really don't know why I got this error message nor how to solve it. If I remove "w:" manually within open xml file, then parsing works well. I guess XML parser for PL/SQL doesn't recognize ":" or maybe doesn't support namespace?
    My question is
    1. In oracle 10g release2, XML Parser for PL/SQL can recognize ":" in the element name? or does it support namespace? If not, is there any workaround for solving this problem?
    2. How can I make XML Parser recognize ":" in the element name in the xml file or How can I declare namespace in the PL/SQL code so that PL/SQL xml parser can recognize namespace like "w:"?
    In fact, I don't use XML DB and what I want to do is just to load XML file into the relational table and some parts of whole XML file will be inserted into the CLOB in the table.
    Should I really use XML DB to do the above job?
    Any comment or suggestions will be greatly appreciated.

    This works correctly. I added prefixes to your extract path. (I had to add the xmlns:xsi to your root node also.)
    declare
      -- Local variables here
       doc_in       dbms_xmldom.DOMDocument;
       aNodeList    dbms_xmldom.DOMNodeList;
    begin
      -- Test statements here
      doc_in := dbms_xmldom.newdomdocument(
    '<?xml version="1.0" encoding="UTF-8"?>' ||
    '<ap:Collection xmlns:ap="http://www.abc.com/ap" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.abc.com/ap template.xsd"> ' ||
    '<ap:info>' ||
    '<ap:data name="Barbie" age="3">' ||
    '</ap:data>' ||
    '</ap:info>' ||
    '</ap:Collection>');
      aNodeList := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(doc_in),
                                                 '/ap:Collection/ap:info',
                                                 'xmlns:ap="http://www.abc.com/ap"');  
      dbms_output.put_line('length of aNodeList = '|| dbms_xmldom.getLength(aNodeList) );
    end;

Maybe you are looking for