Problem compiling PL/SQL code

I am having problmes compiling the following piece of pl/sql
code:
declare
v_servicekey services.servicekey%type;
v_tmodelkey tmodels.tmodelkey%type;
l_bindingid bindingtemplates.bindingid%type;
i_rowlimit number(28);
begin
select bindingid
into l_bindingid
from
(select b.bindingid as bindingid,
b.bindingkey,
nvl(b.accesspointurltype,''),
nvl(b.accesspointurl,''),
nvl(b.hostingredirector,''),
b.updated
from bindingtemplates b, services s
where s.serviceid=b.serviceid
and s.servicekey=v_servicekey
and (b.bindingid in (select i.bindingid
from instances
i,tmodels t
where
t.tmodelid=i.tmodelid
and
t.tmodelkey=v_tmodelkey)
or (b.hostingredirector is not
null
and b.hostingredirector in
(select bindingkey
from bindingtemplates
where bindingid in (select i.bindingid
from instances i,tmodels t
where t.tmodelid = i.tmodelid
and t.tmodelkey = v_tmodelkey))))
order by b.updated)
where rownum <= i_rowlimit;
end;
I get the compilation error
ERROR at line 30:
ORA-06550: line 30, column 27:
PLS-00103: Encountered the symbol "ORDER" when expecting one of
the following:
) * & = - + < / > in mod not rem with an exponent (**)
<> or != or ~= >= <= <> and or like between group having
intersect minus start union where connect is null is not ||
is dangling year DAY_
The symbol ")" was substituted for "ORDER" to continue.
ORA-06550: line 30, column 45:
PLS-00103: Encountered the symbol ")" when expecting one of the
following:
. ( , * @ % & - + ; / for mod rem an exponent (**) asc desc
||
Obviously there is only one SQL and it is complaining about the
ORDER BY clause. Please ignore the values for the host variables.
The same SQL when run from the SQL prompt with values
substituted for the host variables runs perfectly well. Am I
missing something or is there a catch with Oracle PL/SQL.
Please enlighten.
Thanks

see
http://forums.oracle.com/forums/message.jsp?id=500260
I want to know that if there is any PL/SQL commad for compiling the code?
My problem is, I am working in an environment where we are using a Database tool named TOAD of QUEST Software. Every body can look into the code. I just want to hide this code from others. A Quick reply in this regard will be really very helpful.

Similar Messages

  • Problems compiling PL/SQL code

    I am having problmes compiling the following piece of pl/sql
    code:
    declare
    v_servicekey services.servicekey%type;
    v_tmodelkey tmodels.tmodelkey%type;
    l_bindingid bindingtemplates.bindingid%type;
    i_rowlimit number(28);
    begin
    select bindingid
    into l_bindingid
    from
    (select b.bindingid as bindingid,
    b.bindingkey,
    nvl(b.accesspointurltype,''),
    nvl(b.accesspointurl,''),
    nvl(b.hostingredirector,''),
    b.updated
    from bindingtemplates b, services s
    where s.serviceid=b.serviceid
    and s.servicekey=v_servicekey
    and (b.bindingid in (select i.bindingid
    from instances
    i,tmodels t
    where
    t.tmodelid=i.tmodelid
    and
    t.tmodelkey=v_tmodelkey)
    or (b.hostingredirector is not
    null
    and b.hostingredirector in
    (select bindingkey
    from bindingtemplates
    where bindingid in (select i.bindingid
    from instances i,tmodels t
    where t.tmodelid = i.tmodelid
    and t.tmodelkey = v_tmodelkey))))
    order by b.updated)
    where rownum <= i_rowlimit;
    end;
    I get the compilation error
    ERROR at line 30:
    ORA-06550: line 30, column 27:
    PLS-00103: Encountered the symbol "ORDER" when expecting one of
    the following:
    ) * & = - + < / > in mod not rem with an exponent (**)
    <> or != or ~= >= <= <> and or like between group having
    intersect minus start union where connect is null is not ||
    is dangling year DAY_
    The symbol ")" was substituted for "ORDER" to continue.
    ORA-06550: line 30, column 45:
    PLS-00103: Encountered the symbol ")" when expecting one of the
    following:
    . ( , * @ % & - + ; / for mod rem an exponent (**) asc desc
    ||
    Obviously there is only one SQL and it is complaining about the
    ORDER BY clause. Please ignore the values for the host variables.
    The same SQL when run from the SQL prompt with values
    substituted for the host variables runs perfectly well. Am I
    missing something or is there a catch with Oracle PL/SQL.
    Please enlighten.
    Thanks

    "Order by" can not be used in the subqueries.
    Order by should always be specified in the outer query only.
    rajkiran

  • How to review implication of database character set change on PL/SQL code?

    Hi,
    We are converting WE8ISO8859P1 oracle db characterset to AL32UTF8. Before conversion, i want to check implication on PL/SQL code for byte based SQL functions.
    What all points to consider while checking implications on PL/SQL code?
    I could find 3 methods on google surfing, SUBSTRB, LENGTHB, INSTRB. What do I check if these methods are used in PL/SQL code?
    What do we check if SUBSTR and LENGTH functions are being used in PL/SQl code?
    What all other methods should I check?
    What do I check in PL/SQL if varchar and char type declarations exist in code?
    How do i check implication of database characterset change to AL32UTF8 for byte bases SQL function.
    Thanks in Advance.
    Regards,
    Rashmi

    There is no quick answer.  Generally, the problem with PL/SQL code is that once you migrate from a single-byte character set (like WE8ISO8859P1) to a multibyte character set (like AL32UTF8), you can no longer assume that one character is one byte. Traditionally, column and PL/SQL variable lengths are expressed in bytes. Therefore, the same string of Western European accented letters may no longer fit into a column or variable after migration, as it may now be longer than the old limit (2 bytes per accented letter compared to 1 byte previously). Depending on how you dealt with column lengths during the migration, for example, if you migrated them to character length semantics, and depending on how relevant columns were declared (%TYPE vs explicit size), you may need to adjust maximum lengths of variables to accommodate longer strings.
    The use of SUBSTR, INSTR, and LENGTH and their byte equivalents needs to be reviewed. You need to understand what the functions are used for. If the SUBSTR function is used to truncate a string to a maximum length of a variable, you may need to change it to SUBSTRB, if the variable's length constraint is still declared in bytes.  However, if the variable's maximum length is now expressed in characters, SUBSTR needs to be used.  However, if SUBSTR is used to extract a functional part of a string (e.g. during parsing), possibly based on result from INSTR, then you should use SUBSTR and INSTR independently of the database character set -- characters matter here, not bytes. On the other hand, if SUBSTR is used to extract a field in a SQL*Loader-like fixed-format input file (e.g. read with UTL_FILE), you may need to standardize on SUBSTRB to make sure that fields are extracted correctly based on defined byte boundaries.
    As you see, there is universal recipe on handling these functions. Their use needs to be reviewed and understood and it should be decided if they are fine as-is or if they need to be replaced with other forms.
    Thanks,
    Sergiusz

  • Help with SQL code

    Hi having a slight problem with some SQL code -
    We store a number of actions they get given a date_done, a Y if we Met_Customer, a Y if we had an Upsell_Apps , a Y if we Upsell_Other, a Y if there was a reference and a Y if there was an issue. The action must have a date, but can have none to any of the Y's
    We want SQL to report back the number of actions (so the count) broken down into the months of the date_done - so Aug 07, Sep 07 etc etc. And this again broken down for Met_customer, Upsell_apps, upsell_other, reference and issue.
    We want it to look something like this...
    Action Type-------------------- Oct06 | Nov06 | Dec06 | Jan07
    Met Customer--------------------12--------8-----------4----------2
    Upsell App-------------------------21--------0-----------1----------3
    Upsell Other-----------------------0---------1-----------3----------1
    Reference---------------------------2---------6----------7----------3
    Issue---------------------------------0----------0----------1----------0
    So if an action on 12-Oc-06 had a Y in Met_customer and Y in Upsell_app it would be counted twice in the above - whereas below it does not work like that...
    At the moment the code is producing something like the following...
    MET_CUST | USPELL_APP | UPSELL_OTHER | REFERENCE | ISSUE | Oct06 | Nov06
    ------Y------------------------------------------------------------------------------------------------------12--------2
    ------Y-------------------Y---------------------------------------------------------------------------------11--------0
    ---------------------------Y----------------------------------------------------------------------------------1---------3
    ------------------------------------------------------Y-------------------------------------------Y----------6---------0
    --------------------------------------------------------------------------------Y-----------------------------2---------1
    ---------------------------------------------------------------------------------------------------Y----------0----------1
    ---------------------------------------------------------------------------------------------------------------1---------1
    This is the code we're using
    SELECT
    ACTION_MET_CUSTOMER,
    ACTION_UPSELL_APPS,
    ACTION_UPSELL_OTHER,
    ACTION_REFERENCE,
    ACTION_ISSUE,
    SUM ( decode( substr(DATE_DONE,-3,1), '-', cnt, null ) ) TOTAL,
    SUM ( decode( substr(DATE_DONE,-6,6), 'OCT-06', cnt, null ) ) OCT06,
    SUM ( decode( substr(DATE_DONE,-6,6), 'NOV-06', cnt, null ) ) NOV06,
    SUM ( decode( substr(DATE_DONE,-6,6), 'DEC-06', cnt, null ) ) DEC06,
    SUM ( decode( substr(DATE_DONE,-6,6), 'JAN-07', cnt, null ) ) JAN07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'FEB-07', cnt, null ) ) FEB07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'MAR-07', cnt, null ) ) MAR07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'APR-07', cnt, null ) ) APR07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'MAY-07', cnt, null ) ) MAY07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'JUN-07', cnt, null ) ) JUN07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'JUL-07', cnt, null ) ) JUL07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'AUG-07', cnt, null ) ) AUG07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'SEP-07', cnt, null ) ) SEP07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'OCT-07', cnt, null ) ) OCT07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'NOV-07', cnt, null ) ) NOV07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'DEC-07', cnt, null ) ) DEC07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'JAN-08', cnt, null ) ) JAN08,
    SUM ( decode( substr(DATE_DONE,-6,6), 'FEB-08', cnt, null ) ) FEB08,
    SUM ( decode( substr(DATE_DONE,-6,6), 'MAR-08', cnt, null ) ) MAR08,
    SUM ( decode( substr(DATE_DONE,-6,6), 'APR-08', cnt, null ) ) APR08,
    SUM ( decode( substr(DATE_DONE,-6,6), 'MAY-08', cnt, null ) ) MAY08
    FROM
    (SELECT ACTION_MET_CUSTOMER, ACTION_UPSELL_APPS, ACTION_UPSELL_OTHER, ACTION_REFERENCE, ACTION_ISSUE, DATE_DONE, COUNT(*) CNT FROM ACTIONS, EMPLOYEE
    WHERE ACTION_OWNER = NAME
    GROUP BY ACTION_MET_CUSTOMER, ACTION_UPSELL_APPS, ACTION_UPSELL_OTHER, ACTION_REFERENCE, ACTION_ISSUE, DATE_DONE)
    GROUP BY
    ACTION_MET_CUSTOMER, ACTION_UPSELL_APPS, ACTION_UPSELL_OTHER, ACTION_REFERENCE, ACTION_ISSUE
    Any ideas to get it looking how id ideally like it?
    Cheers, would be a great help
    S

    select 'Met Customer' action_type,
    to_char(date_done,'MON-YY') date_done,
    action_owner,
    COUNT(1)
    from ff_actions
    where action_met_customer = 'Y'
    group by action_met_customer
    UNION
    select 'Upsell Apps' action_type,
    to_char(date_done,'MON-YY') date_done,
    action_owner,
    COUNT(1)
    from ff_actions
    where action_upsell_apps = 'Y'
    group by action_upsell_apps
    UNION
    select 'Upsell Other' action_type,
    to_char(date_done,'MON-YY') date_done,
    action_owner,
    COUNT(1)
    from ff_actions
    where action_upsell_other = 'Y'
    group by action_upsell_other
    UNION
    select 'Reference' action_type,
    to_char(date_done,'MON-YY') date_done,
    action_owner,
    COUNT(1)
    from ff_actions
    where action_reference = 'Y'
    group by action_reference
    UNION
    select 'Issue' action_type,
    to_char(date_done,'MON-YY') date_done,
    action_owner,
    COUNT(1)
    from ff_actions
    where action_issue = 'Y'
    group by action_issue
    now error...
    ORA-00979: not a GROUP BY expression

  • Code runs correctly when compiled by SQL developer but not SQL Plus

    I have a rather large package body I need to deploy and compile ... It's big and complex (I inherited the project). Our it dept is huge and scripts are deployed by the dba team and they seem to only use sql plus. My code deploys and runs fine when compiled in sql developer. Once I compile it from SQL plus it stops working. It runs and using debug statements I can see the values are correct but it no longer inserts the data into the proper tables. I get ZERO errors or warnings when this is compiled in SQL Plus and no errors are generated from the code at run time. I've diffed the extracts of the code from the DB after each deployment and the only difference is the blank lines which SQL Plus strips out when you load the file. Has anyone run into anything remotely similar and if so how did you solve it? I've tried modifying the code to no avail, adding in comments to preserve the white space makes no difference. The thing that really kills me is that there is no error at all.

    Ok this is the problem area.... vReplyMessage is a clob. I've replaced it in this section of processing with a varchar2(32000). And now it works. I still would like to know why though. Nothing is changed when I load it though sqlplus or sql developer but this line " update swn_recip_response_t set SWN_RECIP_RESPONSE = vTextReply where notification_id = v_notification_id; " would never execute with the clob. Logging showed that the clob had the correct value though. I am puzzled.
    begin
    call_SWNPost('http://www.sendwordnow.com/usps/getNotificationResults',vMessageText, vReplyMessage, v_status_code, v_status_phrase, '');
    exception
    when others then
    raise eJavaException;
    end;
    vTextReply := dbms_lob.substr( vReplyMessage, 32000, 1 );
    if (vDebug) then
    update PEMS_PROD_2.SWN_POST_LOG set response = 'notif_id == '|| v_notification_id || 'status code == '|| v_status_code|| ' '||vTextReply where log_pk = vLogPK;
    commit;
    end if;
    IF v_status_code = 200 then
    v_has_error := 'N';
    ELSE
    v_has_error := 'Y';
    END IF;
    -- we handle all exceptions below in case something goes wrong here.
    -- this area can die silently.
    vTextReply := replace(vTextReply,'<getNotificationResultsResponse xmlns="http://www.sendwordnow.com/usps">', '<getNotificationResultsResponse xmlns:xyz="http://www.sendwordnow.com/usps">');
    begin
    insert into swn_recip_response_t(notification_id) values (v_notification_id);
    exception
    when others then
    if (vDebug) then
    err_num := SQLCODE;
    err_msg := SUBSTR(SQLERRM, 1, 100);
    insert into PEMS_PROD_2.SWN_POST_LOG (LOG_PK, create_date, REQUEST, notification_id) values(pems_prod_2.swn_post_log_seq.nextval,sysdate,
    'err_num - '||to_char(err_num)|| ' error_msg - '|| err_msg, v_notification_id);
    commit;
    else
    null;
    end if;
    end;
    commit;
    begin
    update swn_recip_response_t
    set SWN_RECIP_RESPONSE = vTextReply
    where notification_id = v_notification_id;
    exception
    when others then
    if (vDebug) then
    err_num := SQLCODE;
    err_msg := SUBSTR(SQLERRM, 1, 100);
    insert into PEMS_PROD_2.SWN_POST_LOG (log_pk, create_date, REQUEST, notification_id) values(pems_prod_2.swn_post_log_seq.nextval,sysdate,
    'err_num - '||to_char(err_num)|| ' error_msg - '|| err_msg, v_notification_id);
    commit;
    else
    null;
    end if;
    end;
    commit;
    -- parse through the XML document and update the notification and recipient records
    -- parse the clob into an xml dom object
    begin
    vReplyMessage := vTextReply;
    ...

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

  • Sql code problem

    for example:
    update vv_om_temp_tl t
    set t.inventory_item_id =(select attribute6 from mtl_system_items_b
    where inventory_item_id = t.inventory_item_id
    and organization_id = p_organization_id)
    where exists
    (select 'X'
    from oe_order_lines_all ol
    where ol.price_list_id in (8118,8119)
    and ol.line_id = t.order_line_id);
    above example update table (vv_om_temp_tl ) through update function while i want to make the same result using one sql code.
    who can help me?
    thanks!

    select decode( t.inventory_item_id,...................) inventory_item_id
    from vv_om_temp_tl t,
    mtl_system_items_b b,
    where t.inventory_item_id = b.inventory_item_id
    how to write that pl/sql code?

  • 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

  • Multiple SQL queries in additional PL/SQL code in Report

    Hello gurus,
    I have a form in my portal populated some searching parameters and these parameters inserted into some temporary tables such as name_temp, addr_temp. And then I have a report that run based on these parameters, I have added additional PL/SQL code in the report at the time after the header was displayed. The code is as follows:
    declare
    checkname varchar2(40);
    checkaddr varchar2(100);
    begin
    select emp.name into checkname from emp
    where name = (select name from name_temp);
    select personnel.addr into checkaddr from personnel
    where addr = (select address from addr_temp);
    end;
    The problem I have is always the first SQL statement was executed, but not the second one, nor the third one. Does PL/SQL only supports one SQL statement per call? Please help. Is there a better way to handle this case?
    Thanks.
    Vince

    Hello gurus,
    I have a form in my portal populated some searching parameters and these parameters inserted into some temporary tables such as name_temp, addr_temp. And then I have a report that run based on these parameters, I have added additional PL/SQL code in the report at the time after the header was displayed. The code is as follows:
    declare
    checkname varchar2(40);
    checkaddr varchar2(100);
    begin
    select emp.name into checkname from emp
    where name = (select name from name_temp);
    select personnel.addr into checkaddr from personnel
    where addr = (select address from addr_temp);
    end;
    The problem I have is always the first SQL statement was executed, but not the second one, nor the third one. Does PL/SQL only supports one SQL statement per call? Please help. Is there a better way to handle this case?
    Thanks.
    Vince

  • How can one  read a Excel File and Upload into Table using Pl/SQL Code.

    How can one read a Excel File and Upload into Table using Pl/SQL Code.
    1. Excel File is on My PC.
    2. And I want to write a Stored Procedure or Package to do that.
    3. DataBase is on Other Server. Client-Server Environment.
    4. I am Using Toad or PlSql developer tool.

    If you would like to create a package/procedure in order to solve this problem consider using the UTL_FILE in built package, here are a few steps to get you going:
    1. Get your DBA to create directory object in oracle using the following command:
    create directory TEST_DIR as ‘directory_path’;
    Note: This directory is on the server.
    2. Grant read,write on directory directory_object_name to username;
    You can find out the directory_object_name value from dba_directories view if you are using the system user account.
    3. Logon as the user as mentioned above.
    Sample code read plain text file code, you can modify this code to suit your need (i.e. read a csv file)
    function getData(p_filename in varchar2,
    p_filepath in varchar2
    ) RETURN VARCHAR2 is
    input_file utl_file.file_type;
    --declare a buffer to read text data
    input_buffer varchar2(4000);
    begin
    --using the UTL_FILE in built package
    input_file := utl_file.fopen(p_filepath, p_filename, 'R');
    utl_file.get_line(input_file, input_buffer);
    --debug
    --dbms_output.put_line(input_buffer);
    utl_file.fclose(input_file);
    --return data
    return input_buffer;
    end;
    Hope this helps.

  • APEX,PDF's, BI Publisher and SQL Query returning SQL code..

    I don't know if I should be posting this in this Forum or the BI Publisher forum, so I am posting in BOTH forums..
    I love APEX, let me say that first.. And appreciate the support offered here by the group, but am running int a confusing issue when BI Publisher tries to build a report from the above type APEX report..
    Here is my dilemma:
    I have a number of reports that are part of a Oracle package. They return an SQL Query back to a reports region on a page. I am having to deal with the column names returned are col01, col02..
    The issue I have is, when building the Application Level query to download the XML sample from in building RTF layouts in Word, you can not use this code, you MUST use a standard SQL Select.
    I have taken the sql from the function returning sql, and copied into the application query, supplying the required data values for bind variables being used in the query.
    An XML file is produced, and I use this to build the RTF format file that I load back into APEX and try to use it for the PDF rendering of the report. I can view the output as a PDF in the Word add on, but when I try using it with the report, it is returning an empty PDF file.
    Can anyone tell me what error log files on the bi publisher side I can look at to see what error is happening?
    Thank you,
    Tony Miller
    UTMB/EHN
    Title adjusted to allow people to know what I am talking about...
    Message was edited by:
    Tony Miller

    Tony,
    You can find the log as follows:
    - go to http://[yourserver]:[yourport]/em
    - logon to OC4J EM: oc4jadmin/[yourpassword]
    - click on "logs" at the bottom of the page
    - in the hgrid/tree, expand OC4J->home->Application
    xmlpserver
    - click on view log icon
    You can also observe what's going on in BI Publisher
    by going to the command prompt from where you started
    it.
    Or, as a third option, you can locate the file on
    your file system, depending on your setup, the path
    would be something similar to this:
    \oracle\product\10.2.0\bip\j2ee\home\application-deplo
    yments\xmlpserver\application.log
    With that said though, I don't expect you'll find
    much in there that would help with your particular
    problem. I suspect you either get no rows in your XML
    at runtime, due to some session state issues, or your
    XML structure does in fact not match your RTF
    template.
    I'm not quite following your problem description,
    i.e. when did you do what and are you associating
    your report layout with a report query or report
    region. So just some general notes, your query needs
    to be parseable at design-time, when exporting the
    XML, so that you get the XML file with the proper
    column names derived from your query. If you want to
    use your RTF template with a standard report region,
    you must export the XML file first using the advanced
    XML structure option. And of course the column names
    in your report query need to match the column names
    in your report region.
    Perhaps this helps you further diagnose what's going
    on, if you have additional information that could
    help, let me know. And if you could stage this on
    apex.oracle.com, I'd be happy to take a look.
    Regards,
    MarcMarc,
    Thanks for looking at this issue. Below find my remarks to your questions..
    Re: your query needs
    to be parseable at design-time, when exporting the
    XML, so that you get the XML file with the proper
    column names derived from your query.At the start of this process, the query code was a function in a package. The function was returning an SQL select statement, for a report region on a page. I took the select statement, built an application query to build a sample of the xml for BI Publisher desktop (Add-on for Word). The code was producing the usual Col01, Col02.. since at design time that is were the column names.
    When I then took the xml from this and built the rtf for loading into my APEX application.
    When testing the Application Query with this RTF report layout, I am getting PDF's. When using it with the report region sending an xml feed to BI Publisher I am getting nothing back.
    I have since taken the sql code and moved it back into the report region, and set the region to have a type of straight SQL Query. I have even tried to hard-code the parameters I was getting from the page to limit data returned.
    Is it possible to see the xml being produced by the APEX page?
    Re: Stage this on apex.oracle.com.. I would love to, but we would have HIPPA issues if I posted the data on a public website.
    Can I send you the RTF file and the xml file that the application query is creating to see if there something weird about them?
    Thank you,
    Tony Miller
    UTMB/EHN

  • How to access APEX variables within compiled pl/sql function.

    Hi,
    My initial problem is to create pl/sql code returning column names for my custom calendar report.
    There are 7 columns for each day of the week and I want it to be on two rows - first the day of the week, such as 'Monday' and below it (with BR tag) the date, such as '18-08-2008'.
    What I want is to set additional tags for underline, italics, etc. on the column heading which date is currently selected for viewing (I have DATE item for this purpose).
    But as the code is getting quite complex, I decided to write a function in my schema that would return the column delimited values for the headings.
    What I can't do is the following.
    1) How do I reference an APEX item value, such as my DATE item? using v('P4_DATE') results in unknown function 'v'.
    2) How do I use char-date and vice versa conversion using the already set application format mask, available in APEX 3.1? So that when I change the date format mask within the application, it would still work.
    10x and I hope I'm not repeating s.o. else's question.

    Hi,
    I won't try to create the entire function here, just enough to point you in the right direction.
    Create a function something like:
    create or replace FUNCTION "GETHEADINGS" (inDATE IN VARCHAR2, inFORMAT IN VARCHAR2)
    RETURN VARCHAR2
    IS
    BEGIN
      DECLARE
        vTHISDATE DATE;
        vSTRING VARCHAR2(1000);
      BEGIN
        vTHISDATE := TO_DATE(inDATE, inFORMAT);
        vSTRING := TO_CHAR(vTHISDATE, inFORMAT);
        RETURN vSTRING;
      END;
    ENDinDate would receive the item's date value and inFORMAT receives the date format. vTHISDATE converts the date supplied into a date using the date format and vSTRING turns that into a string, again using the date format. Obviously, this example will just return the original date.
    To add styling to any column, just surround the column text with the appropriate tags whilst building up your string. For example:
    '&lt;i&gt;' || columnheading || '&lt;/i&gt;'Now, in your report's Report Attributes, change the Headings Type to PL/SQL and enter in something like:
    DECLARE
    vHEADINGS VARCHAR2(1000);
    BEGIN
    SELECT GETHEADINGS(:P1_DATE_FIELD, :PICK_DATE_FORMAT_MASK) INTO vHEADINGS FROM DUAL;
    RETURN vHEADINGS;
    END;When you've created the function you need, the string returned should be in the column headings delimited with colons.
    Andy

  • SQL Code not working in Forms Developer?

    Hi all,
    I'm using Oracle 10g and I have th following code running on iSQL+ but not working on Forms and I got the following erro
    The SQL code:
         select returningreason
            from (
                     select returningreason,
                     dense_rank() over (partition by 1 order by count(*) desc) as drnk
                     from returned_goods
                     group by returningreason)
           where drnk = 1;And the error happens near the word over to the right and the error statement is:
    Error 103 at line 18, column 19
       Encountered the symbol "(" when expecting one of the following:
             , formThanks in advance :)

    Triggers are compiled in forms so need to use only the features available to forms, which doesn't include all the new stuff in the database.
    select over partition
    NVL2They don't work in forms and reports too.
    Also if you use them in record Group
    Forms/SQL Compiler was not lined up to the database(10G).
    Meanwhile,for example. Pipelined TABLE and relative Select work in Reports AND Forms.

  • Performance tuning in PL/SQL code

    Hi,
    I am working on already existing PL/SQL code which is written by someone else on validation and conversion of data from a temporary table to base table. It usually has 3.5 million rows. and the procedure takes arount 2.5 - 3 hrs to complete.
    Can I enhance the PL/SQL code for better performance ? or, is this OK to take so long to process these many rows?
    Thanks!
    Yogini

    Can I enhance the PL/SQL code for better performance ? Probably you can enhance it.
    or, is this OK to take so long to process these many rows? It should take a few minutes, not several hours.
    But please provide some more details like your database version etc.
    I suggest to TRACE the session that executes the PL/SQL code, with WAIT events, so you'll see where and on what time is spent, you'll identify your 'problem statements very quickly' (after you or your DBA have TKPROF'ed the trace file).
    SQL> alter session set events '10046 trace name context forever, level 12';
    SQL> execute your PL/SQL code here
    SQL> exitWill give you a .trc file in your udump directory on the server.
    http://www.oracle-base.com/articles/10g/SQLTrace10046TrcsessAndTkprof10g.php
    Also this informative thread can give you more ideas:
    HOW TO: Post a SQL statement tuning request - template posting
    as well as doing a search on 10046 at AskTom, http://asktom.oracle.com will give you more examples.
    and reading Oracle's Performance Tuning Guide: http://www.oracle.com/pls/db102/to_toc?pathname=server.102%2Fb14211%2Ftoc.htm&remark=portal+%28Getting+Started%29

  • Problem compiling Abstract class

    Hi
    I have writting an abstract class Sort.java and another class BubbleSort.java. I am having problems compiling BubbleSort.java class.
    The following is the error message
    BubbleSort.java:8: missing method body, or declare abstract
         public int doSorting(int[] array);
    ^
    BubbleSort.java:11: return outside method
              return num;
    ^
    The following is the code
    public abstract class Sort
    public abstract int doSorting(int[] array);
    }// End of class
    public class BubbleSort extends Sort
    private int num = 2;
    public int doSorting(int[] array);
    num = num + 2;
    return num;
    } // end of class

    Remove the semi-colon.
    public int doSorting(int[] array); // <------- there

Maybe you are looking for

  • Alpha channel from Quicktime into AE - broken?

    This has been driving me nuts for some time. I am generating an animation w/alpha channel from my 3D software (FormZ.) It creates a proprietary .fan file containing the animation frames, which is then converted to Quicktime. I am using the animation

  • Does Oracle Data Masking pack work with MS SQL Server?

    And if so, are other OEM packs required (i.e. MS SQL Server system monitoring plug-in)? TIA

  • A simple project

    Hi All, I need to do a simple project like 1.Using DBMS_JOB package read some data from the table and output the result into a flat file at definite intervals. 2.Now submit another dbms_job to read that flat file and store the contents into another t

  • Remove special characters in xml

    hi all, i have a problem with special char. in my data few records have special char like ' or " because of that xml file gives error. let me know the solution to this . thanks in advance Edited by: 836924 on Mar 8, 2011 1:41 AM

  • "Sharpen" effect produces white rectangle around the frame?

    I've been noticing this behaviour in CC 7.1. When you place "Sharpen" and some third party plugin (Sapphire, NewBlue, BorisFX, ...) the 1 pixel wide rectangle starts to appear around the frame. Is it a bug?