PL/SQL block returning error

Hi All,
I have used PL/SQL block in my custom report to search table heading. Basically I have two select list (LOV), user select the parameter from the list and click on go, it displays the report fine when record exists.
I am using following PL/SQL block -
>
DECLARE
v_sql VARCHAR2(4000);
BEGIN
IF :P126_PARK_NAME IS NOT NULL THEN
v_sql := 'select P.OLIC_KEY1, PA.NAME, C.TRADING_NAME, L.LIC_TYPE, P.'|| :P126_PARK_NAME ||', C.COP_ID, L.OLIC_ID Olic_id '
||' from RTT_OP_PARKS_TEMP P, RTT_COMMERCIAL_OPERATORS C , RTT_PARTIES PA, RTT_OP_LICENCES L'
||' where '|| :P126_PARK_NAME || ' IS NOT NULL '
||' AND PA.PAR_ID =C.PAR_ID '
||' AND P.COP_ID =C.COP_ID '
||' AND L.OLIC_KEY1=P.OLIC_KEY1 '
||' AND :P126_QUERY = ''Y'''
||' ORDER BY PA.NAME ';
END IF;
/* debugging */
IF :DEBUG = 'YES' THEN
htp.preopen;
htp.p(v_sql);
htp.preclose;
END IF;
RETURN (v_sql);
END;
>
Now, I want to use like condition to display all the records by checking the parameters in text field. I have created a new text field and modified the query as follows but it does not work -
>
DECLARE
v_sql VARCHAR2(4000);
BEGIN
IF :P126_PARK_NAME IS NOT NULL THEN
v_sql := 'select P.OLIC_KEY1, PA.NAME, C.TRADING_NAME, L.LIC_TYPE, P.'|| :P126_PARK_NAME ||', C.COP_ID, L.OLIC_ID Olic_id '
||' from RTT_OP_PARKS_TEMP P, RTT_COMMERCIAL_OPERATORS C , RTT_PARTIES PA, RTT_OP_LICENCES L'
||' where '|| :P126_PARK_NAME || ' IS NOT NULL '
||' AND PA.PAR_ID =C.PAR_ID '
||' AND P.COP_ID =C.COP_ID '
||' AND L.OLIC_KEY1=P.OLIC_KEY1 '
||' AND :P126_QUERY = ''Y'''
||' ORDER BY PA.NAME ';
END IF;
IF :P126_MARINE_PARK != -1 THEN
v_sql := 'select distinct L.OLIC_KEY1, PA.NAME, C.TRADING_NAME, L.LIC_TYPE, M.'|| :P126_MARINE_PARK ||', C.COP_ID '
||' from RTT_OP_MARINE_PARKS M, RTT_COMMERCIAL_OPERATORS C , RTT_PARTIES PA, RTT_OP_LICENCES L'
||' where '|| :P126_MARINE_PARK || ' IS NOT NULL '
||' M.'||:P126_MARINE_PARK||' IS LIKE :P126_MARINE_PARK||'%' '
||' AND PA.PAR_ID =C.PAR_ID '
||' AND M.COP_ID =C.COP_ID '
||' AND L.OLIC_KEY1=M.OLIC_KEY1 '
||' AND :P126_QUERY = ''Y'''
||' ORDER BY PA.NAME ';
END IF;
/* debugging */
IF :DEBUG = 'YES' THEN
htp.preopen;
htp.p(v_sql);
htp.preclose;
END IF;
RETURN (v_sql);
END;
>
Can anybody tell me what I am doing wrong here?
Thanks in advance
Regards,
M Tajuddin

Hi Andy,
Thanks for pointing the quotation however it does not work either. Now I am getting -
>
failed to parse SQL query:
ORA-00933: SQL command not properly ended
>
Now my query is like below -
>
DECLARE
v_sql VARCHAR2(4000);
BEGIN
IF :P126_ZONE_NAME IS NOT NULL THEN
v_sql := 'select distinct L.OLIC_KEY1, PA.NAME, C.TRADING_NAME, L.LIC_TYPE, M.'|| :P126_ZONE_NAME ||', C.COP_ID '
||' from RTT_OP_MARINE_PARKS M, RTT_COMMERCIAL_OPERATORS C , RTT_PARTIES PA, RTT_OP_LICENCES L'
||' where '|| :P126_ZONE_NAME || ' IS NOT NULL '
||' AND PA.PAR_ID =C.PAR_ID '
||' AND M.COP_ID =C.COP_ID '
||' AND L.OLIC_KEY1=M.OLIC_KEY1 '
||' AND :P126_QUERY = ''Y'''
||' ORDER BY PA.NAME ';
END IF;
IF :P126_MARINE_PARK IS NOT NULL THEN
v_sql := 'select distinct L.OLIC_KEY1, PA.NAME, C.TRADING_NAME, L.LIC_TYPE, M.'|| :P126_MARINE_PARK ||', C.COP_ID '
||' from RTT_OP_MARINE_PARKS M, RTT_COMMERCIAL_OPERATORS C , RTT_PARTIES PA, RTT_OP_LICENCES L'
||' where ' || :P126_MARINE_PARK || ' IS NOT NULL '
*||' M.' || :P126_MARINE_PARK || ' IS LIKE ''' || :P126_MARINE_PARK || '%'' '*
||' AND PA.PAR_ID =C.PAR_ID '
||' AND M.COP_ID =C.COP_ID '
||' AND L.OLIC_KEY1=M.OLIC_KEY1 '
||' AND :P126_QUERY = ''Y'''
||' ORDER BY PA.NAME ';
END IF;
/* debugging */
IF :DEBUG = 'YES' THEN
htp.preopen;
htp.p(v_sql);
htp.preclose;
END IF;
RETURN (v_sql);
END;
>
Can you tell me how can I display dynamic multiple column in my query? Say in the LIKE condition if user type M in the parameter field and click on go, it must return more than one column starting column name M but in my current query it will only display one column, am I right?
Thanks again for your suggestion.
Kind regards,
M Tajuddin
http://tajuddin.whitepagesbd.com

Similar Messages

  • Pl/sql block returning sql query.

    Hello,
    I am using oracle 10g apex 3.2 version.
    I am using the following return statement inside my report which is pl/sql block returning sql query.
    declare
    pid varchar2(100);
    begin
    return 'select patient_id_code from t_files_data_exp where patient_id_code not in pid';
    end;
    How am i suppose to mention the pid inside the return stmt i mean with any quotes or anything? because the above return stmt gives error
    "1 error has occurred
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. The query can not be parsed, the cursor is not yet open or a function returning a SQL query returned without a value."
    Thanks

    Hello,
    I did exactly the way u told
    declare
    pid varchar2(100) := '(61092,61093)';
    begin
    return 'select patient_id_code from t_files_data_exp where patient_id_code not in ' || pid;
    end;
    patient_id_code is varchar2(100) only in table.
    For this i am getting "invalid number error".
    Thanks

  • PL/SQL block query error when going to a remote system with 1 parameter.

    Hi,
    I am getting the error:
    Invalid function body condition: ORA-01460: unimplemented or unreasonable conversion requested ORA-02063: preceding line from HANSEN_REMOTE
    The issue appears to result from opening a cursor that is a select statement is in some way accessing records via a dblink and the 'where' clause is has more then one session parameter in it. Here is the smallest pl/sql block that results with an error:
    DECLARE
    CURSOR c_GetPay IS
    SELECT PERSON_ID
    FROM CASH_PERSON@HANSEN_REMOTE
    WHERE LAST_NAME = :P320_HANSEN_LAST_NAME
    AND FIRST_NAME = :P320_HANSEN_FIRST_NAME;
    BEGIN
    OPEN c_GetPay ;
    CLOSE c_GetPay ;
    RETURN TRUE;
    END ;
    If I remove 'AND FIRST_NAME = :P320_HANSEN_FIRST_NAME' from the curser, there is no problem. This block of pl/sql is in a On Load: Before Header
    on a page branch. This issue remains consistent in our 1.6.1.00.02 instance of HTMLDB with an Oracle database version 10.1.0.3.0. This instance is
    a fresh install of the 10g and HTMLDB.
    Does any one have any ideas of why I am getting this error message. I really need to get it resolve soon as we are trying to get an application up by the end of August and there is still alot of coding needing to be done.
    Thanks for the help.
    Lanie

    Scott, I have tried everything that this point except copy the whole table from the remote system.
    Here is a short version of what I have tried...
    -- hard coded condition...timing was not an issue here...it was quick.
    declare
    v_in_PersonId number(9);
    cursor c_GetPay
    IS select PERSON_ID --, first_name, LAST_NAME
         from HANSEN_CONTACT
              where first_name like 'LANIE'
              AND last_name LIKE 'MOORE'
    BEGIN
    OPEN c_GetPay;
    FETCH c_GetPay INTO v_in_PersonId;
    CLOSE c_GetPay;
    RETURN TRUE;
    END           
    -- this is an internal variable set to the string literal...does not as the v function was not called.
    declare
    V_TEST VARCHAR2(150);
    V_TEST2 VARCHAR2(150);
    v_in_PersonId number(9);
    cursor c_GetPay
    IS select PERSON_ID --, first_name, LAST_NAME
         from HANSEN_CONTACT
              where first_name like :V_TEST
              AND last_name LIKE :V_TEST2
    BEGIN
    V_TEST := 'LANIE';
    V_TEST2 := 'MOORE';
    OPEN c_GetPay;
    FETCH c_GetPay INTO v_in_PersonId;
    CLOSE c_GetPay;
    RETURN TRUE;
    END
    -- this has the v function called in the cursor since no matter what I do, I have to call it so I don't get my original error. This takes over a minute to return, and it is using hard coded values...if I use session variables where I place the information from the user, it takes even longer.
    declare
    V_TEST VARCHAR2(150);
    V_TEST2 VARCHAR2(150);
    v_in_PersonId number(9);
    cursor c_GetPay
    IS select PERSON_ID --, first_name, LAST_NAME
         from HANSEN_CONTACT
              where first_name like V(:V_TEST)
              AND last_name LIKE V(:V_TEST2)
    BEGIN
    V_TEST := 'LANIE';
    V_TEST2 := 'MOORE';
    OPEN c_GetPay;
    FETCH c_GetPay INTO v_in_PersonId;
    CLOSE c_GetPay;
    RETURN TRUE;
    END
    It does not appear to be an issue if I am looking at a view going to the remote system or the table it's self. The slowness issue takes place. (In short I have tried replacing HANSEN_CONTACT which is a view with the direct table link of imsv7.contact@HANSEN_REMOTE and that did not solve the timing issue).
    Any ideas?

  • SQL code returns error

    I'm trying to retrieve data from two different databases in the same server, the code return error. please help me.
    select a.segment3, b.descr, b.leader, a.Sum(period_activity_a) from payman.dbo.snp_op_detail a
    inner join hrman.dbo.organisation_t b
    on a.segment3 = b.org_member_id
    where a.segment3 between 4000 and 5999 and
    a.segment2 != 6651 and
    a.segment2 between 5400 and 8999 and
    a.period_name in ('JAN-11', 'FEB-11', 'MAR-11', 'APR-11', 'MAY-11', 'JUN-11', 'JUL-11', 'AUG-11', 'SEP-11','OCT-11','NOV-11')
    group by rollup (a.segment3,b.descr);
    Edited by: OlaTunde on 19-Jan-2012 01:13

    Please, whenever you post a question stating "the code return error", then post the complete error stack you get. How can we help if we do not know what error?
    Your syntax for accessing other databases looks like MS/SQL syntax to me? That will not work in Oracle. You need a [url http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_5005.htm#i2061505]database link.
    When you have the database link, you access data from the other database using something like:
    select column_names from schema_name.table_name@dblink_name;(I assume it is two Oracle databases you wish to get data from - otherwise you need to look into heterogenous gateway ;-) )

  • Pl/Sql block returning too many values

    Hi
    Below is simple pl/sql block.while excecuting this i'm getting too many values exception
    declare
    attrib QW_ACCT_ATTR%ROWTYPE;
    begin
    SELECT ATTR_END_DATE, ATTR_NM, ATTR_VAL INTO attrib FROM (SELECT ATTR_END_DATE, ATTR_NM, ATTR_VAL FROM QW_ACCT_ATTR where CUST_ACCT_ID='5158660414' AND ATTR_NM = 'SS' ORDER BY ATTR_END_DATE DESC) where rownum = 1;
    DBMS_OUTPUT.PUT_LINE('end daate is...'||attrib.ATTR_END_DATE);
    end;
    could anybody please help me how to rewrite this qwery to get only one record.
    we are not supposed to use cursors here,
    thanks

    I am just changing your logic,
    declare
    attrib QW_ACCT_ATTR%ROWTYPE;
    begin
    SELECT ATTR_END_DATE, ATTR_NM, ATTR_VAL INTO attrib FROM (SELECT ATTR_END_DATE, ATTR_NM, ATTR_VAL FROM QW_ACCT_ATTR where CUST_ACCT_ID='5158660414' AND ATTR_NM = 'SS' ORDER BY ATTR_END_DATE DESC where rownum = 1) ;
    DBMS_OUTPUT.PUT_LINE('end daate is...'||attrib.ATTR_END_DATE);
    end;

  • Pl/sql block returning multiple rows

    Hi,
    I've created a plsql block which obtains an id from a name and then uses this id in another sql statement. The select statement to get the id works fine and the correct id is placed into the variable awardID.
    when i try to use this variable in another select statement it returns multiple rows. but when i just use the id in the select statement it works fine.
    select AwardID into awardID
    from award_objtabA
    where Name = awardName;
    this returns the correct id '5999'
    select Points into award_points
    from award_objtabA
    where AwardID = awardID;
    this returns multiple rows
    select Points into award_points
    from award_objtabA
    where AwardID = 5999;
    this works fine
    can anybody help with this confusing error?
    Cheers

    select AwardID
      into awardID               <= the same column
      from award_objtabA
    where Name = awardName;
    this returns the correct id '5999'
    select Points
      into award_points
      from award_objtabA
    where AwardID = awardID;    <= the same column
    this returns multiple rows
    to solve use different name not exactly the same as that of the column name
    select AwardID
      into vAwardID        
      from award_objtabA
    where Name = awardName;
    select Points
      into award_points
      from award_objtabA
    where AwardID = vAwardID;as Alex and Kamal have suggested use different name for your variable.

  • SQL query returning error in 1 db and not in other db

    database1
    Select AMT_OFF,
    COMMENT_TXT,
    COOP_AMT_OFF,
    DEAL_NO,
    DETAIL_ID,
    DETAIL_TYPE,
    MAX_QTY,
    MIN_QTY,
    PACK_QTY,
    PACK_TYPE,
    PCT_OFF,
    SEQ_NO,
    SITE_NO,
    VENDOR_ITEM
    From dealdtl
    WHERE (deal_no, site_no, seq_no) IN
    (select deal_no, site_no, seq_no
    from deal_sku
    where sku_no = 29747
    and apply_site_no = 1201
    and deal_no = dealdtl.deal_no
    and site_no = dealdtl.site_no
    and seq_no = dealdtl.seq_no)
    and min_qty <= decode(pack_type, 'P',1,'U',10)
    and (site_no, deal_no) IN
    (select site_no, deal_no
    from dealhdr
    where vendor_id = 'VNMIKE'
    --and site_no = dealdtl.site_no
    --and deal_no = dealdtl.deal_no 
    and start_dt <= to_date('12-SEP-08', tmxgbl.date_format)
    and stop_dt >= to_date('12-SEP-08', tmxgbl.date_format)
    query produces an error on to_date function ORA-01858 non numeric character found where numeric expected
    all the tables have no data in them
    i.e. if i do a
    select site_no, deal_no
    from dealhdr --0 rows
    select deal_no, site_no, seq_no
    from deal_sku--0 rows
    Select AMT_OFF,
    COMMENT_TXT,
    COOP_AMT_OFF,
    DEAL_NO,
    DETAIL_ID,
    DETAIL_TYPE,
    MAX_QTY,
    MIN_QTY,
    PACK_QTY,
    PACK_TYPE,
    PCT_OFF,
    SEQ_NO,
    SITE_NO,
    VENDOR_ITEM
    From dealdtl--o rows
    However, when the same query is executed in a different database, it does not bring up an error, same data condition 0 rows on all three tables.
    On both databases tmxgbl.date_format returns the same 'mm/dd/rr' formaty mask
    can somebody explain the reason for this please?
    Thanks
    Vijay

    still no error on the database that doesn not throw an error
    Select AMT_OFF,
    COMMENT_TXT,
    COOP_AMT_OFF,
    DEAL_NO,
    DETAIL_ID,
    DETAIL_TYPE,
    MAX_QTY,
    MIN_QTY,
    PACK_QTY,
    PACK_TYPE,
    PCT_OFF,
    SEQ_NO,
    SITE_NO,
    VENDOR_ITEM
    From dealdtl
    WHERE (deal_no, site_no, seq_no) IN
    (select deal_no, site_no, seq_no
    from deal_sku
    where sku_no = 29747
    and apply_site_no = 1201
    and deal_no = dealdtl.deal_no
    and site_no = dealdtl.site_no
    and seq_no = dealdtl.seq_no)
    and min_qty <= decode(pack_type, 'P',1,'U',10)
    and (site_no, deal_no) IN
    (select site_no, deal_no
    from dealhdr
    where vendor_id = 'VNMIKE'
    --and site_no = dealdtl.site_no
    --and deal_no = dealdtl.deal_no 
    and start_dt <= to_date('09/12/08', chr(39)||tmxgbl.date_format||chr(39))
    and stop_dt >= to_date('09/12/08', chr(39)||tmxgbl.date_format||chr(39))
    --and start_dt <= to_date('12-SEP-08', 'CRAP')
    --no error                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Convert PL/SQL block returning html to a plugin - render function

    I have a PL/SQL region that uses htp.p('...') to output HTML. It's dynamic in that it uses a page value to call data from the database. I'd like this region to appear on every page in my application, but also to have the ability to update it once rather than having to update a copy on every page.
    From my limited understanding of ApEx the best way to achieve this is to convert my PL/SQL region to a Plugin. I've copied my PL/SQL code into the plugin's source and set the plugin's type to "region" but when I try to load a page that I've added it to, it displays the error "No render function has been defined for plug-in [PLUGIN NAME]".
    How do I define a render function? Or is there a better way to achieve what I'm after?

    Hi 925454,
    have a look at the "Render Function Name" attribute in the region "Callbacks" of your plug-in definition. You just have to specify the name of the function you used in the plug-in source.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • PL SQL block - Check for empty file

    Hello,
    I need help in writing pl sql code to check a file to verify if it has 0 records (file size = zero kb.) In a preceding pl sql block, I am performing a SELECT on data and writing it to a file. If that file is empty/has no records, then I would like to stop the process from continuing on to my next pl sql block which performs an update function.
    Summary:
    1) Create file from SELECT
    2) Check file for zero data, if true, trigger error, if false, continue to next pl sql block.
    3) Run update on records if data exists in the file.
    Thanks in advance!

    Thanks John,
    You've been of great help so far and a really appreciate it. I'm so close to getting this, I just need help with how to create an error when the file shows no data. I will be running this as an Oracle Apps Concurrent request. I'd like for the job to end in error when no data exists for the file. In unix, I can enter "EXIT 1" and it signals to the concurrent manager to put end the job with an error status. How can I do something similar using pl sql? Here is my code so far, with the missing piece. Thanks!
    DECLARE
      vFile UTL_FILE.FILE_TYPE;
      vrecs BOOLEAN := FALSE;
      vnodata EXCEPTION;
    BEGIN
      vFile := UTL_FILE.FOPEN('/devlop, 'norecs.txt', 'w', 32767);
    FOR x IN (
    SELECT
         node_name AS txt
    FROM
         applsys.fnd_nodes
    WHERE
         node_name = 'blahblahblah'
    LOOP
            vrecs := TRUE;
            UTL_FILE.PUT_LINE (vFile, x.txt);
    END LOOP;
            UTL_FILE.FCLOSE(vFile);
            IF NOT vrecs THEN
                RAISE vnodata;
            END IF;     
    EXCEPTION
           WHEN vnodata THEN
        *<what can I put here to cause the pl sql block to error???>*
    END;
    /

  • DDL in pl/sql block???

    Hi,
    begin
    create table sample_test ( x number);
    end;
    gives an error, but
    begin
    execute immediate 'create table sample_test(x number)';
    end
    very much works, is there any specific reason to why the first way of doing a DDL statement is restricted or avoided???
    cheere

    Hi,
    begin
    create table sample_test ( x number);
    end;
    you can not issue DDL like above in a PL/SQL Block, hence error
    gives an error, but
    begin
    execute immediate 'create table sample_test(x
    (x number)';
    end
    You Issued DDL in PL/SQL Block using Native Dynamic SQL, hence worked !!
    Message was edited by:
    biswabijay

  • Exception error  in PL/SQL block

    Hi,
    do the following conditions in a PL/SQL block cause an exception error to occur ?
    A- Select statement does not return a row.
    B- Select statement returns more than one row.
    Thank you.

    If you're talking about SELECT INTO then yes:
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    Connected as cmza
    SQL> set serveroutput on
    SQL>
    SQL> declare
      2    v_text varchar2(4000);
      3  begin
      4    -- question 1
      5    select banner
      6      into v_text
      7      from v$version;
      8  end;
      9  /
    declare
      v_text varchar2(4000);
    begin
      -- question 1
      select banner
        into v_text
        from v$version;
    end;
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at line 6
    SQL> declare
      2    v_text varchar2(4000);
      3  begin
      4    -- question 2
      5    select banner
      6      into v_text
      7      from v$version
      8     where 1 = 2;
      9  end;
    10  /
    declare
      v_text varchar2(4000);
    begin
      -- question 2
      select banner
        into v_text
        from v$version
       where 1 = 2;
    end;
    ORA-01403: no data found
    ORA-06512: at line 6
    SQL>

  • Error in PL/SQL Block of Trigger

    Hi all,
    I have written a trigger whose PL/SQL block contains a simple select statment among many other statements.
    Now I find that, if the select statement returns no rows the trigger does not continue its operation further and aborts there itself. And if the select statement returns some rows, then it works fine.
    I tried to execute a simplified PL/SQL block of the trigger in SQL*Plus and following were the results:
    declare
    tempdate date;
    begin
    select trdt into tempdate from inv_trans;
    if sql%notfound then
    null;
    end if;
    end;
    When no data is present in inv_trans table, the result was:
    declare
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at line 4
    And when the table inv_trans had data, the result was:
    PL/SQL procedure successfully completed.
    Why is the piece of code flashing an error when I have already given a treatment if no data is found.
    Why is it taking "No Data in table" as an abnormal condition and not normal?
    THanks in advance
    Warm Regards
    Manu

    In your case you have to use a cursor:
    declare
      cursor c_cur is
        select trdt from inv_trans;
      r_cur   c_cur%rowtype;
    begin
      open c_cur;
      fetch c_cur into r_cur;
      if c_cur%notfound then
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • While executing the following pl/sql block   Iam getting  following error

    While executing the following pl/sql block
    Iam getting following error
    ORA-06550: line 5, column 11:
    PLS-00320: the declaration of the type of this expression is incomplete or malformed
    ORA-06550: line 5, column 11:
    PL/SQL: Item ignored
    declare
    TYPE t_customer_details IS REF CURSOR;
    o_customer_details t_customer_details;
    v_rec o_customer_details%ROWTYPE;
    begin
    o_customer_details:=pkg_search.fngetcustdetails( 2727,1000841, NULL,NULL,119105329);
    LOOP
    FETCH o_customer_details INTO rec ;
    EXIT WHEN o_customer_details%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(' print' );
    END LOOP;
    CLOSE o_customer_details;
    end;

    sorry
    declare
    TYPE t_customer_details IS REF CURSOR;
    o_customer_details t_customer_details;
    begin
    o_customer_details:= pkg_search.fngetcustdetails( 2727,1000841, NULL,NULL,119105329);
    FOR v_rec IN o_customer_details
    LOOP
      DBMS_OUTPUT.PUT_LINE(' print' );
    END LOOP;
    END;I changed code,
    Can you say , o_customer_details:= pkg_search.fngetcustdetails( 2727,1000841, NULL,NULL,119105329); is it right?
    pkg_search.fngetcustdetails return ref cursor??

  • Oracle giving Block corruption errors when using CDC for sending the data to SQL Server 2012

    Hello Friends,
    We are facing an error while using CDC with Oracle. It is a "Block corruption" error, which indicates at some level of data corruption. We ran RMAN validate command to scan the database for corruption but it returned with no errors, however he
    Alert Log in Oracle is still coming up with the following error. Has anyone experienced this error when using Oracle Standard Edition and SQL 2012 ?
    Trace file e:\app\pulse-ad\diag\rdbms\orcl\orcl\trace\orcl_ora_5992.trc
    Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
    Windows Server 2003 Version V5.2 Service Pack 2
    CPU                 : 4 - type 8664, 4 Physical Cores
    Process Affinity    : 0x0000000000000000
    Memory (Avail/Total): Ph:6782M/24575M, Ph+PgF:12203M/30844M
    Instance name: orcl
    Redo thread mounted by this instance: 1
    Oracle process number: 151
    Windows thread id: 5992, image: ORACLE.EXE (SHAD)
    *** 2013-12-12 03:04:33.655
    *** SESSION ID:(1281.3832) 2013-12-12 03:04:33.655
    *** CLIENT ID:() 2013-12-12 03:04:33.655
    *** SERVICE NAME:(orcl) 2013-12-12 03:04:33.655
    *** MODULE NAME:(xdbcdcsvc.exe) 2013-12-12 03:04:33.655
    *** ACTION NAME:() 2013-12-12 03:04:33.655
    Lost-write detected for sequence 70856. The lost-write starts occurring in block 11193. The current block being validating is 12930.
    Block dump of the first lost-write block:
    Flag: 0x1 Format: 0x22 Block: 0x00002bb9 Seq: 0x000114bf Beg: 0x94 Cks:0x68ee
    Dump of memory from 0x0000000598D06C00 to 0x0000000598D06E00
    598D06C00 00002201 00002BB9 000114BF 68EE8094  [."...+.........h]
    598D06C10 00085BF1 0023BDA1 000DE19C 000DE19C  [.[....#.........]
    598D06C20 0000000C 00000000 2209160A 5BF10000  [..........."...[]
    598D06C30 3EB10502 00C0F5CA 0031BDA1 00010205  [...>......1.....]
    598D06C40 02B22C6A 038A6D69 00000001 00000000  [j,..im..........]
    598D06C50 4D554407 30373230 35BB0206 001100AE  [.DUM0270...5....]
    598D06C60 0001040A 000D000E 038A6D69 56B25735  [........im..5W.V]
    598D06C70 729C0003 E19C0001 000C0006 000D0006  [...r............]
    598D06C80 02BB0502 00C0F5CD 0023BDA1 000A0002  [..........#.....]
    598D06C90 00C00013 000000D0 00030201 56B25736  [............6W.V]
    598D06CA0 03890001 00000000 00000000 002E0105  [................]
    598D06CB0 FFFF0003 00C0F5CD 56B25736 3EB10003  [........6W.V...>]
    598D06CC0 FFFF0024 0014000C 000C0018 00120014  [$...............]
    598D06CD0 09CC0058 E75B0022 0009000F 00085BF1  [X...".[......[..]
    598D06CE0 0024BDA1 000DE19D 000DE19D 0000000C  [..$.............]
    598D06CF0 00000000 2309160A 5BF10000 3EB10502  [.......#...[...>]
    598D06D00 00C0F5CD 0020BDA1 00010205 02B22C72  [...... .....r,..]
    598D06D10 03900974 00000019 00000000 3030300A  [t............000]
    598D06D20 33303030 06323132 AE35BB02 0B441100  [0003212...5...D.]
    598D06D30 0001040A 000D000E 03900974 56B25736  [........t...6W.V]
    598D06D40 729C0003 E19D0011 000C0006 000D0006  [...r............]
    598D06D50 02BB0502 00C0F5CD 0024BDA1 00EA0002  [..........$.....]
    598D06D60 00270016 000001FC 00032C01 56B25736  [..'......,..6W.V]
    598D06D70 00000001 00000000 30393007 002E0105  [.........090....]
    598D06D80 FFFF0003 00C0F5CD 56B25736 00000003  [........6W.V....]
    598D06D90 FFFF0025 00140052 000C0018 00070035  [%...R.......5...]
    598D06DA0 0003000A 00070003 0001001D 00030001  [................]
    598D06DB0 00010001 00010001 00010001 00010001  [................]
    598D06DC0 00010001 00010001 00010001 00010001  [................]
    598D06DD0 00010001 00000001 00010001 00010001  [................]
    598D06DE0 00010001 00000014 09720174 00000022  [........t.r."...]
    598D06DF0 0009000F 00085BF1 0025BDA1 000DE19A  [.....[....%.....]
    Block dump of the current block being validating:
    Flag: 0x1 Format: 0x22 Block: 0x00003282 Seq: 0x000114c8 Beg: 0x0 Cks:0x312a
    Dump of memory from 0x0000000598DDFE00 to 0x0000000598DE0000
    598DDFE00 00002201 00003282 000114C8 312A8000  [."...2........*1]
    598DDFE10 50424703 31303607 34353335 69745319  [.GBP.6015354.Sti]
    598DDFE20 6E696C72 72502067 6375646F 4C207374  [rling Products L]
    598DDFE30 4E206474 C3025650 0380013D 0457454E  [td NPV..=...NEW.]
    598DDFE40 4E1E09C2 1E09C204 10C2024E 1E09C204  [...N....N.......]
    598DDFE50 09C2044E C2024E1E 03C30510 021B0929  [N....N......)...]
    598DDFE60 C3053DC3 0F192602 2602C305 C3050F19  [.=...&.....&....]
    598DDFE70 0C1A6203 5102C105 C2041F4E 044E1E09  [.b.....QN.....N.]
    598DDFE80 4E1E09C2 0410C202 4E1E09C2 1E09C204  [...N.......N....]
    598DDFE90 10C2024E 2903C305 78071B09 011D0B71  [N......)...xq...]
    598DDFEA0 BF020101 1FBF0215 4E018001 53014E01  [...........N.N.S]
    598DDFEB0 0723002C 0B0C7178 0A3C3C18 30303030  [,.#.xq...<<.0000]
    598DDFEC0 33373030 4D033337 47034255 36075042  [007373.MUB.GBP.6]
    598DDFED0 38333936 4E113331 2065776B 74616C50  [693813.Nkwe Plat]
    598DDFEE0 6D756E69 56504E20 0B0AC303 4E038001  [inum NPV.......N]
    598DDFEF0 C2045745 0459512E 59512EC2 5253C203  [EW...QY...QY..SR]
    598DDFF00 512EC204 2EC20459 C2035951 C3055253  [...QY...QY..SR..]
    598DDFF10 1B092903 0B0AC303 3C04C305 C3053239  [.).........<92..]
    598DDFF20 32393C04 4F08C305 C105114F 1F4E5102  [.<92...OO....QN.]
    598DDFF30 512EC204 2EC20459 C2035951 C2045253  [...QY...QY..SR..]
    598DDFF40 0459512E 59512EC2 5253C203 2903C305  [.QY...QY..SR...)]
    598DDFF50 78071B09 01190A71 C0030101 C0034709  [...xq........G..]
    598DDFF60 8001330A 4E014E01 002C5301 71780723  [.3...N.N.S,.#.xq]
    598DDFF70 3C180B0C 30300A3C 30303030 33373337  [...<<.0000007373]
    598DDFF80 42554D03 50424703 31304207 344C5131  [.MUB.GBP.B011QL4]
    598DDFF90 6F725020 63657073 614A2074 206E6170  [ Prospect Japan ]
    598DDFFA0 646E7546 64724F20 44535520 30302E30  [Fund Ord USD0.00]
    598DDFFB0 04C30331 03800133 0557454E 5B1603C3  [1...3...NEW....[]
    598DDFFC0 03C30521 04215B16 1F4004C3 1603C305  [!....[!...@.....]
    598DDFFD0 C305215B 215B1603 4004C304 03C3051F  [[!....[!...@....]
    598DDFFE0 031B0929 043304C3 4D245AC2 245AC204  [).....3..Z$M..Z$]
    598DDFFF0 02C3054D 040A1A18 494002C1 1603C305  [M.........@I....]
    *** 2013-12-12 03:05:07.984
    ** LOGMINER WARNING - Invalidated 6 LCRs **
    Complete dump of first invalid START LCR follows:
    ++  LCR Dump Begin: 0x0000000532C004E0 - CANNOT_SUPPORT
         op: 255, Original op: 3, baseobjn: 0, objn: 233316, objv: 1
         DF: 0x00000002, DF2: 0x00000000, MF: 0x00000000, MF2: 0x00000000
         PF: 0x40000001, PF2: 0x00002000
         MergeFlag: 0x00, FilterFlag: 0x00
         Id: 0, iotPrimaryKeyCount: 3, numChgRec: 4
         NumCrSpilled: 0
         RedoThread#: 1, rba: 0x0114c8.0001c6ce.00d4
         scn: 0x0003.56b593be, xid: 0x0008.00c.00100d85, pxid: 0x0008.00c.00100d85
         ncol: 0newcount: 0, oldcount: 0
         LUBA: 0x3.c109c0.c.15.38f64
    Thanks
    Dee

    Hi Dee,
    Thank you for your question.
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
    Thank you for your understanding and support.
    Regards,
    Mike Yin
    TechNet Community Support

  • How to report an error from anonymous PL/SQL blocks

    Hello,
    The following SQL*Plus script
    WHENEVER OSERROR EXIT FAILURE
    WHENEVER SQLERROR EXIT FAILURE
    DECLARE
    EXIST_INDEXES BOOLEAN := FALSE;
    BEGIN
    FOR INDEX IN (SELECT * FROM INDEXES)
    LOOP
    EXIST_INDEXES := TRUE;
    DBMS_OUTPUT.PUT_LINE(INDEX.SCHEMA || '.' || INDEX.NAME);
    END LOOP;
    IF EXIST_INDEXES THEN
    RAISE_APPLICATION_ERROR(-20000,'Before proceeding, it is recommended to drop the indexes listed above');
    END IF;
    END;
    -- Here go SQL statements that should be executed if no indexes were found
    produces this output when there is an entry in table/view INDEXES:
    SCHEMA_1.INDEX_1
    DECLARE
    ERROR at line 1:
    ORA-20000: Before proceeding, it is recommended to drop the indexes listed above
    ORA-06512: at line 13
    When there are entries in table/view INDEXES, how to:
    - suppress the 'DECLARE' and '*' lines from appearing in the script output;
    - skip executing the SQL statements after the PL/SQL block;
    - have the script return a non-zero code?
    Regards,
    Angel Tsankov

    1 You want the rest of the code not to execute, SO all code should be in one anonymous block.
    The scope of exceptions is one block.
    2 If you want to suppress
    - suppress the 'DECLARE' and '*' lines from appearing in the script output;you should not use raise_application_error, because this is how raise_application_error works.
    - whenever you raise an exception, the return code will be non-zero.
    The code you posted is really very poor, and inefficient, but as it is unclear what you are up to (you seem to want to skip executing everything when there are any indexes, if so you can just count them), it is not possible to provide working code.
    If you want to skip the rest of the code, you can declare your own exceptions, and you should just raise your own exception and the block will abort.
    Hth
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • Problems with soundoutput on internal speakers with Macbook 13"...!

    Receiving my Macbook today 13" Alu...beautiful One problem: Whatever sound comes out of the book on the internal speakers, its overlayed by a v. loud "pink noise"... I mean every sound...when u turn up the volume, the volume of the pink noise is not

  • FIM 2010 R2 - Error 3000: " Some or all identity References could not be translated"

    Hi Everyone, I installedFIMPassword Resetand RegistrationService, butwhen I try tologinto the portal. I getthe following error. I followed the steps in "TestLab"and alsofollowed the instructionson the requirements ofFIMself-servicePasswordReset.  Gre

  • GR BASED INVOICE

    hi sir, can i maintain gr based invoice through Scduling agreement like purchase order NB.it is possible or not

  • Itunes store won't connect, but i can use everything else

    for some reason my itunes store wont' connect anymore, and i have no idea how to get it to work (not really mac savvy). everything else connects fine including safari so i'm kinda confused i think it might be my firewall, but i have no clue how the s

  • Problems with downloading update 4.4 for lightroom

    I own a Nikon D7100 and have tried downloading the b4.4 update for Lightroom but it does not seem to apply itself to the program after the download time is complete. I am not used to the way Adobe downloads work, what am I donig wrong?