ORA-20104: create_collection_from_query - WORKAROUND FOUND!

I have found a workaround for this problem.
Idea is to silent all exceptions and tried twice same operations-delete and create collection!!
--"ORA-20104: create_collection_from_query"
BEGIN
  APEX_COLLECTION.DELETE_COLLECTION (p_collection_name=>'HIST_ONE_SEGMENT_COLL');
EXCEPTION
  WHEN OTHERS THEN
    NULL;
END;
BEGIN
  APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY (
        p_collection_name => 'HIST_ONE_SEGMENT_COLL',
        p_query => 'SELECT * FROM ... '
EXCEPTION
  WHEN OTHERS THEN
    BEGIN
      APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY (
            p_collection_name => 'HIST_ONE_SEGMENT_COLL',
            p_query => 'SELECT * FROM ... '
    EXCEPTION
      WHEN OTHERS THEN
        NULL;
    END;
END;In mine case this works on 11g as well as 10g databases with Apex 4.02.

<b>Apex process (before header):</b>
BEGIN
  APEX_COLLECTION.DELETE_COLLECTION (p_collection_name=>'HIST_ONE_SEGMENT_COLL');
EXCEPTION
  WHEN OTHERS THEN
    NULL;
END;
BEGIN
  APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY (
        p_collection_name => 'HIST_ONE_SEGMENT_COLL',
        p_query => 'SELECT * FROM TABLE( db_size_pkg.grow_hist_one_segment_pr ('''||:G_OWNER||''', '''||:G_SEGMENT_NAME||''',''' ||:G_SEGMENT_TYPE||'''))'
EXCEPTION
  WHEN OTHERS THEN
    BEGIN
      APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY (
            p_collection_name => 'HIST_ONE_SEGMENT_COLL',
            p_query => 'SELECT * FROM TABLE( db_size_pkg.grow_hist_one_segment_pr ('''||:G_OWNER||''', '''||:G_SEGMENT_NAME||''',''' ||:G_SEGMENT_TYPE||'''))'
    EXCEPTION
      WHEN OTHERS THEN
        NULL;
   END;
END;<b>Pipelined function defined in package db_size_pkg but here is extracted code</b>
FUNCTION grow_hist_one_segment_pr (p_owner IN VARCHAR2,
                                   p_segment_name IN VARCHAR2,
                                   p_segment_type IN VARCHAR2 DEFAULT 'TABLE'
         ) RETURN DB_SIZE_HIST_SET_T PIPELINED IS
  CURSOR grow_hist_pr_c  (cp_OWNER IN VARCHAR,cp_SEGMENT_NAME IN VARCHAR2, cp_SEGMENT_TYPE IN VARCHAR2) IS
    with q as (
       SELECT
             PERIOD,
             SUM (NR_BYTES) db_share_x,
             SUM (NR_RECORDS) db_rec_share_x
         FROM DB_SIZE
       GROUP BY PERIOD
    select
          OWNER,
          SEGMENT_NAME,
          SEGMENT_TYPE,
          q.period,
          SIZE_MB/(db_share_x/1048576)*100 DB_SHARE,
          RECORDS/db_rec_share_x*100 DB_REC_SHARE,
          SIZE_MB,
          DECODE (LAG(SIZE_MB,1,0) OVER (ORDER BY q.period),0,0,SIZE_MB-LAG(SIZE_MB,1,0) OVER (ORDER BY q.period)) mb_hist,
          DECODE (LAG(SIZE_MB,1,0) OVER (ORDER BY q.period),0,0,(SIZE_MB-LAG(SIZE_MB,1,0) OVER (ORDER BY q.period))/LAG(SIZE_MB,1,0) OVER (ORDER BY q.period)*100) mb_hist_perc,
          DECODE (LAG(SIZE_MB,1,0) OVER (ORDER BY q.period),0,0,(SIZE_MB-FIRST_VALUE (SIZE_MB) OVER (ORDER BY q.period))/FIRST_VALUE (SIZE_MB) OVER (ORDER BY q.period)*100) mb_cumul_perc,
          RECORDS REC,
          DECODE (LAG(RECORDS,1,0) OVER (ORDER BY q.period),0,0,RECORDS-LAG(RECORDS,1,0) OVER (ORDER BY q.period)) rec_hist,
          DECODE (LAG(RECORDS,1,0) OVER (ORDER BY q.period),0,0,(RECORDS-LAG(RECORDS,1,0) OVER (ORDER BY q.period))/LAG(RECORDS,1,0) OVER (ORDER BY q.period)*100) rec_hist_perc,
          DECODE (FIRST_VALUE (RECORDS) OVER (ORDER BY q.period),0,0,(RECORDS-FIRST_VALUE (RECORDS) OVER (ORDER BY q.period))/FIRST_VALUE (RECORDS) OVER (ORDER BY q.period)*100) rec_cumul_perc
    from (
           SELECT period,
                  OWNER,
                  SEGMENT_NAME,
                  SEGMENT_TYPE,
                  SUM (NR_BYTES)/1048576 SIZE_MB ,
                  SUM (NR_RECORDS) RECORDS
             FROM db_size
             WHERE OWNER=cp_OWNER AND SEGMENT_NAME=cp_SEGMENT_NAME AND SEGMENT_TYPE=cp_SEGMENT_TYPE
            GROUP BY PERIOD, OWNER, SEGMENT_NAME, SEGMENT_TYPE
          ) l, q
    WHERE q.period=l.period
BEGIN
  FOR grow_hist_r IN grow_hist_pr_c (p_owner,p_segment_name,p_segment_type) LOOP
    PIPE ROW(DB_SIZE_HIST_T(p_owner,p_segment_name,p_segment_type,grow_hist_r.period,
                            grow_hist_r.DB_SHARE, grow_hist_r.DB_REC_SHARE,
                            grow_hist_r.size_mb ,grow_hist_r.mb_hist ,grow_hist_r.mb_hist_perc ,grow_hist_r.mb_cumul_perc,
                            grow_hist_r.rec,grow_hist_r.rec_hist,grow_hist_r.rec_hist_perc,grow_hist_r.rec_cumul_perc)
  END LOOP;
END;<b>db_size table defined as:</b>
DROP TABLE TOOLS.DB_SIZE CASCADE CONSTRAINTS;
CREATE TABLE TOOLS.DB_SIZE
  PERIOD           VARCHAR2(8 CHAR)             NOT NULL,
  OWNER            VARCHAR2(30 CHAR)            NOT NULL,
  SEGMENT_NAME     VARCHAR2(81 CHAR)            NOT NULL,
  SEGMENT_TYPE     VARCHAR2(30 CHAR)            NOT NULL,
  TABLESPACE_NAME  VARCHAR2(32 CHAR)            NOT NULL,
  PART_NAME        VARCHAR2(81 CHAR)            NOT NULL,
  NR_BYTES         INTEGER                      NOT NULL,
  NR_BLOCKS        INTEGER                      NOT NULL,
  NR_EXTENTS       INTEGER                      NOT NULL,
  NR_RECORDS       INTEGER                      NOT NULL,
  PARENT_ID        INTEGER,
  ID               INTEGER,
  CONSTRAINT DB_SIZE_PK
  PRIMARY KEY
  (PERIOD, OWNER, SEGMENT_NAME, SEGMENT_TYPE, TABLESPACE_NAME, PART_NAME)
ORGANIZATION INDEX
LOGGING
TABLESPACE TOOLS
PCTFREE    0
INITRANS   2
MAXTRANS   255
CREATE UNIQUE INDEX TOOLS.DB_SIZE_UQX ON TOOLS.DB_SIZE
(ID)
LOGGING
TABLESPACE TOOLS
PCTFREE    0
INITRANS   2
MAXTRANS   255
CREATE OR REPLACE TRIGGER TOOLS."DB_SIZE_TGBI"
BEFORE INSERT
ON TOOLS.DB_SIZE REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
begin
  IF :NEW.ID IS NULL THEN
    FOR c1 IN (SELECT DB_SIZE_SEQ.NEXTVAL next_val FROM dual) LOOP
      :NEW.ID :=  c1.next_val;
    END LOOP;
  END IF;
end;
CREATE OR REPLACE PUBLIC SYNONYM DB_SIZE FOR TOOLS.DB_SIZE;<b>DB_SIZE_HIST_SET_T and DB_SIZE_HIST_T types defined as</b>
CREATE OR REPLACE TYPE TOOLS."DB_SIZE_HIST_T"                                          as OBJECT (
OWNER            VARCHAR2(30) ,
SEGMENT_NAME     VARCHAR2(81)  ,
SEGMENT_TYPE     VARCHAR2(30)   ,
PERIOD           VARCHAR2(8),              
DB_SHARE         NUMBER,
DB_REC_SHARE     NUMBER,
SIZE_MB          NUMBER,
TREND_MB         NUMBER,
TREND_SIZE_PERC  NUMBER,
CUMUL_SIZE_PERC  NUMBER,
RECORDS          NUMBER,
TREND_REC        NUMBER,
TREND_REC_PERC   NUMBER,
CUMUL_REC_PERC   NUMBER
CREATE OR REPLACE TYPE TOOLS."DB_SIZE_HIST_SET_T"                                          as TABLE OF DB_SIZE_HIST_T;
/<b>In Apex, report is defined as:</b>
select * from HIST_ONE_SEGMENT_VW<b>and view is defined as</b>
CREATE OR REPLACE FORCE VIEW HIST_ONE_SEGMENT_VW (
   OWNER,
   SEGMENT_NAME,
   SEGMENT_TYPE,
   PERIOD,
   DB_SHARE,
   DB_REC_SHARE,
   SIZE_MB,
   TREND_MB,
   TREND_SIZE_PERC,
   CUMUL_SIZE_PERC,
   RECORDS,
   TREND_REC,
   TREND_REC_PERC,
   CUMUL_REC_PERC,
   REC_IN_MB
AS
   SELECT C001 OWNER,
          C002 SEGMENT_NAME,
          C003 SEGMENT_TYPE,
          C004 PERIOD,
          TO_NUMBER (C005) DB_SHARE,
          TO_NUMBER (C006) DB_REC_SHARE,
          TO_NUMBER (C007) SIZE_MB,
          TO_NUMBER (C008) TREND_MB,
          TO_NUMBER (C009) TREND_SIZE_PERC,
          TO_NUMBER (C010) CUMUL_SIZE_PERC,
          TO_NUMBER (C011) RECORDS,
          TO_NUMBER (C012) TREND_REC,
          TO_NUMBER (C013) TREND_REC_PERC,
          TO_NUMBER (C014) CUMUL_REC_PERC,
          DECODE (TO_NUMBER (C007),
                  0, 0,
                  TO_NUMBER (C011) / TO_NUMBER (C007))
             REC_IN_MB
     FROM apex_collections
    WHERE collection_name = 'HIST_ONE_SEGMENT_COLL';Hope this is all you asked ... if not please let me know.
Rg,
Damir

Similar Messages

  • Create_collection_from_query: ORA-01403: no data found

    Hi All,
    I am trying to create a collection from a query that queries another collection in an anonymous block/process that executes upon page load in APEX. Right now my query is set up as such:
    v_Query := 'Select * from apex_collections where collection_name = ''NAME'' and c002= ''' || v_Variable || '''';
    v_Variable is passed in the URL that links the page and will be used to create a dynamically generated tree. I have verified that data exists in the source collection that satisfies this query, and that the query that spits out is formatted so that it looks like:
    Select * from apex_collections where collection_name = 'NAME' and c002 = 'Criteria'
    Much to my chagrin, however, I always get a "ORA-01403: no data found" error. I have done all of my testing in the APEX SQLWorkshop with zero luck so far getting it to work. Any help is appreciated. The entire block of code that im running is below:
    Thanks!!
    Sean
    DECLARE
    v_detail TsaOrgEntity_type;
    v_entity TsaOrgEntity_type;
    v_i number;
    v_multi MultiString_type;
    v_name varchar2(4000);
    v_text varchar2(4000);
    v_type varchar2(4000);
    v_Parent varchar2(4000);
    v_Prefix varchar2(4000);
    v_First varchar2(4000);
    v_Second varchar2(4000);
    v_id varchar2(4000);
    v_pid varchar2(4000);
    v_org TsaOrgEntity_type;
    v_code varchar2(4000);
    BEGIN
    v_prefix := '<a href="f?p=1000:6:' || :app_session || ':::6:P6_OrgEntity,P6_OrgName:';
    apex_collection.create_or_truncate_collection('ORGCODES');
    apex_collection.add_member('ORGCODES','TSA','TA5000000000000000','','');
    v_org := tsaorgentity_type('organization');
    v_org.search(v_prefix);
    FOR i IN 1..apex_collection.collection_member_count('ORGENTITY_RESULTSET') LOOP
      SELECT c002 INTO v_Name FROM apex_collections where collection_name = 'ORGENTITY_RESULTSET' AND seq_id = i;
      SELECT c011 INTO v_Code FROM apex_collections where collection_name = 'ORGENTITY_RESULTSET' AND seq_id = i;
      SELECT c001 into v_Type FROM apex_collections where collection_name = 'ORGENTITY_RESULTSET' AND seq_id = i;
      v_parent := ParentOrgID(v_Code);
      apex_collection.add_member('ORGCODES',v_Name,v_Code,v_Type,v_Parent);
    END LOOP;
    v_org := tsaorgentity_type('department');
    v_org.search(v_prefix);
    FOR i IN 1..apex_collection.collection_member_count('ORGENTITY_RESULTSET') LOOP
      SELECT c003 INTO v_Name FROM apex_collections where collection_name = 'ORGENTITY_RESULTSET' AND seq_id = i;
      SELECT c011 INTO v_Code FROM apex_collections where collection_name = 'ORGENTITY_RESULTSET' AND seq_id = i;
      SELECT c001 into v_Type FROM apex_collections where collection_name = 'ORGENTITY_RESULTSET' AND seq_id = i;
      v_parent := ParentOrgID(v_Code);
      apex_collection.add_member('ORGCODES',v_Name,v_Code,v_Type,v_Parent);
    END LOOP;
    v_org := tsaorgentity_type('subdpt');
    v_org.search(v_prefix);
    FOR i IN 1..apex_collection.collection_member_count('ORGENTITY_RESULTSET') LOOP
      SELECT c003 INTO v_Name FROM apex_collections where collection_name = 'ORGENTITY_RESULTSET' AND seq_id = i;
      SELECT c011 INTO v_Code FROM apex_collections where collection_name = 'ORGENTITY_RESULTSET' AND seq_id = i;
      SELECT c001 into v_Type FROM apex_collections where collection_name = 'ORGENTITY_RESULTSET' AND seq_id = i;
      v_parent := ParentOrgID(v_Code);
      apex_collection.add_member('ORGCODES',v_Name,v_Code,v_Type,v_Parent);
    END LOOP;
    v_org := tsaorgentity_type('port');
    v_org.search(v_prefix);
    FOR i IN 1..apex_collection.collection_member_count('ORGENTITY_RESULTSET') LOOP
      SELECT c002 INTO v_Name FROM apex_collections where collection_name = 'ORGENTITY_RESULTSET' AND seq_id = i;
      SELECT c008 INTO v_Code FROM apex_collections where collection_name = 'ORGENTITY_RESULTSET' AND seq_id = i;
      SELECT c001 into v_Type FROM apex_collections where collection_name = 'ORGENTITY_RESULTSET' AND seq_id = i;
      v_parent := ParentOrgID(v_Code);
      apex_collection.add_member('ORGCODES',v_Name,v_Code,v_Type,v_Parent);
    END LOOP;
    END;
    DECLARE
      v_detail  TsaOrgEntity_type;
      v_entity  TsaOrgEntity_type;
      v_i       number;
      v_multi   MultiString_type;
      v_name    varchar2(4000);
      v_text    varchar2(4000);
      v_type    varchar2(4000);
      v_Parent  varchar2(4000);
      v_Prefix  varchar2(4000);
      v_First   varchar2(4000);
      v_Second  varchar2(4000);
      v_id      varchar2(4000);
      v_pid     varchar2(4000);
      v_org     TsaOrgEntity_type;
      v_code    varchar2(4000);
    BEGIN
    v_entity := TsaOrgEntity_type('department', 'Security Technology');
    v_entity.detail(v_detail);
    v_Pid := ParentOrgID(v_detail.multistring2varchar(v_detail.get_organizationcode));
    v_ID := v_detail.multistring2varchar(v_detail.get_organizationcode);
    v_First := 'Select * from apex_collections where collection_name = ''ORGCODES'' and c002 = ''TA6200000000000000'' ';
    v_Second := 'Select * from apex_collections where collection_name = ''ORGCODES'' and c004 = ''TA6202000000000000'' ';
    IF apex_collection.collection_exists('FIRST') = TRUE THEN
      apex_collection.delete_collection('FIRST');
    END IF;
    IF apex_collection.collection_exists('SECOND') = TRUE THEN
      apex_collection.delete_collection('SECOND');
    END IF;
    apex_collection.create_collection_from_query_b('FIRST',v_First);
    apex_collection.create_collection_from_query_b('SECOND',v_Second);
    apex_collection.create_or_truncate_collection('BLUETREE');
    IF apex_collection.collection_member_count('FIRST') > 0 THEN
      FOR i in 1..apex_collection.collection_member_count('FIRST') LOOP
        SELECT c001 INTO v_Name from apex_collections where collection_name = 'FIRST' and seq_id = i;
        SELECT c003 INTO v_Type from apex_collections where collection_name = 'FIRST' and seq_id = i;
        SELECT c002 INTO v_ID from apex_collections where collection_name = 'FIRST' and seq_id = i;
        SELECT c004 INTO v_ID from apex_collections where collection_name = 'FIRST' and seq_id = i;
        v_Name := '<a href=f?p=1000:6:'||':::6:P6_OrgEntity,P6_OrgName:'
    || v_Type
    ||','
    || v_Name
    || '">'
    || v_Name
    || '</a>';
    apex_collection.add_member('BLUETREE',v_Name,v_ID,v_PID);
    END LOOP;
    END IF;
    IF apex_collection.collection_member_count('SECOND') > 0 THEN
    FOR i in 1..apex_collection.collection_member_count('SECOND') LOOP
    SELECT c001 INTO v_Name from apex_collections where collection_name = 'FIRST' and seq_id = i;
    SELECT c003 INTO v_Type from apex_collections where collection_name = 'FIRST' and seq_id = i;
    SELECT c002 INTO v_ID from apex_collections where collection_name = 'FIRST' and seq_id = i;
    SELECT c004 INTO v_ID from apex_collections where collection_name = 'FIRST' and seq_id = i;
    v_Name := '<a href="f?p=1000:6:'
    ||':::6:P6_OrgEntity,P6_OrgName:'
    || v_Type
    ||','
    || v_Name
    || '">'
    || v_Name
    || '</a>';
    apex_collection.add_member('BLUETREE',v_Name,v_ID,v_PID);
    END LOOP;
    END IF;
    apex_collection.add_member('BLUETREE',v_detail.get_cn(),v_detail.multistring2varchar(v_detail.get_organizationcode),ParentOrgID(v_detail.multistring2varchar(v_detail.get_Organizationcode)));
    apex_collection.add_member('BLUETREE','TSA','TA5000000000000000','','');
    dbms_output.put_line(v_First);
    dbms_output.put_line(V_Second);
    END;

    Hi Ricardo,
    You appear to be missing a comma after the column
    nome_objeto in your query string.
    Regards
    AndreHi Andre
    Thank you for your help.
    I copied the source wrong. The error is the same. I read an example in book EASY HTMLDB where i can create a region using a select on apex_collections table. I want to do this.
    Regards
    Ricardo

  • PL/SQL function body returning SQL - report error:ORA-01403: no data found

    Hi,
    I am working on Application Express 4.0.2.00.06, and 11G database.
    I have a problem with classic report area of type - PL/SQL function body returning SQL query. Query works if I define region area as - Use Generic Column Names (parse query at runtime only), and does not when I define it - Use Query-Specific Column Names and Validate Query.
    I am getting error:
    report error:ORA-01403: no data found
    This is my query that is returned from function, and displayed with htp.p, and it works ok and returns data in SQL Developer and SQL Workshop (in Apex).
    <code>
    /* select 1 from dual */ SELECT SIFPRO, NAZIV, VODITELJ, DATPZA,SUM(DECODE(TJEDAN,'2010/46',BRDJEL,null)) as "2010/46" ,SUM(DECODE(TJEDAN,'2010/49',BRDJEL,null)) as "2010/49" ,SUM(DECODE(TJEDAN,'2010/50',BRDJEL,null)) as "2010/50" ,SUM(DECODE(TJEDAN,'2010/51',BRDJEL,null)) as "2010/51" ,SUM(DECODE(TJEDAN,'2010/52',BRDJEL,null)) as "2010/52" ,SUM(DECODE(TJEDAN,'2011/01',BRDJEL,null)) as "2011/01" ,SUM(DECODE(TJEDAN,'2011/02',BRDJEL,null)) as "2011/02" ,SUM(DECODE(TJEDAN,'2011/03',BRDJEL,null)) as "2011/03" ,SUM(DECODE(TJEDAN,'2011/04',BRDJEL,null)) as "2011/04" ,SUM(DECODE(TJEDAN,'2011/05',BRDJEL,null)) as "2011/05" ,SUM(DECODE(TJEDAN,'2011/06',BRDJEL,null)) as "2011/06" ,SUM(DECODE(TJEDAN,'2011/07',BRDJEL,null)) as "2011/07" ,SUM(DECODE(TJEDAN,'2011/08',BRDJEL,null)) as "2011/08" ,SUM(DECODE(TJEDAN,'2011/09',BRDJEL,null)) as "2011/09" ,SUM(DECODE(TJEDAN,'2011/10',BRDJEL,null)) as "2011/10" FROM (SELECT * FROM PMV_PLAN_TVRTKA) GROUP BY SIFPRO, NAZIV, VODITELJ, DATPZA ORDER BY SIFPRO, NAZIV, VODITELJ, DATPZA
    </code>
    As you can see, I even tried with workaround that I found on the previous post on the forum, and that is to put /* select 1 from dual */ to start query.
    Any help would be appriciated.

    /* select 1 from dual */ SELECT SIFPRO, NAZIV, VODITELJ, DATPZA,SUM(DECODE(TJEDAN,'2010/46',BRDJEL,null)) as "2010/46" ,SUM(DECODE(TJEDAN,'2010/49',BRDJEL,null)) as "2010/49" ,SUM(DECODE(TJEDAN,'2010/50',BRDJEL,null)) as "2010/50" ,SUM(DECODE(TJEDAN,'2010/51',BRDJEL,null)) as "2010/51" ,SUM(DECODE(TJEDAN,'2010/52',BRDJEL,null)) as "2010/52" ,SUM(DECODE(TJEDAN,'2011/01',BRDJEL,null)) as "2011/01" ,SUM(DECODE(TJEDAN,'2011/02',BRDJEL,null)) as "2011/02" ,SUM(DECODE(TJEDAN,'2011/03',BRDJEL,null)) as "2011/03" ,SUM(DECODE(TJEDAN,'2011/04',BRDJEL,null)) as "2011/04" ,SUM(DECODE(TJEDAN,'2011/05',BRDJEL,null)) as "2011/05" ,SUM(DECODE(TJEDAN,'2011/06',BRDJEL,null)) as "2011/06" ,SUM(DECODE(TJEDAN,'2011/07',BRDJEL,null)) as "2011/07" ,SUM(DECODE(TJEDAN,'2011/08',BRDJEL,null)) as "2011/08" ,SUM(DECODE(TJEDAN,'2011/09',BRDJEL,null)) as "2011/09" ,SUM(DECODE(TJEDAN,'2011/10',BRDJEL,null)) as "2011/10" FROM (SELECT * FROM PMV_PLAN_TVRTKA) GROUP BY SIFPRO, NAZIV, VODITELJ, DATPZA ORDER BY SIFPRO, NAZIV, VODITELJ, DATPZA

  • ORA-01403: no data found ---- FRM-40735: WHEN-VALIDATE-ITEM trigger raised

    Scenario: I have one Master Detail form. after entering values in master Form, Navigate to Detail form, there I have to enter more that 5000 lines, it's very tough for user to enter huge amount of data.
    Workaround: Give one button on Master form and written a cursor to populate all the 5000(relavent) number of record on detail block.
    Issue: while populating detail data block after around 3000 record detail form start showing Error as
    ORA-01403: no data found
    FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06502.
    Need suggestion
    Code Written on find button as below
    BEGIN
              --XX customized
              if (:ADJ_IP_CTRL.DUE_DT_FROM is null OR :ADJ_IP_CTRL.DUE_DT_TO is null) then
              fnd_message.set_string('Due Date from and Due Date To Must be entered.');
              fnd_message.Show;
              raise form_trigger_failure;
              end if;
         BEGIN     
              go_block('ADJ_INV_PAY');
    clear_block(no_validate);
         for inv_rec in (
                             SELECT v.invoice_num,
              v.invoice_id,
              v.invoice_type,
              v.pay_alone,
              v.exclusive_payment_flag,
              v.payment_num,
              v.amount_remaining,
              --TO_CHAR (v.amount_remaining,fnd_currency.get_format_mask(v.currency_code, 42)) char_amount_remaining,
              TO_CHAR (v.amount_remaining,'FM999G999G999G999G999G999G999G999G990D00') char_amount_remaining,
              ap_payment_schedules_pkg.get_discount_available (
              v.invoice_id,
              v.payment_num,
              :pay_sum_folder.check_date,
              :pay_sum_folder.currency_code)
              discount_available,
              /*TO_CHAR (ap_payment_schedules_pkg.get_discount_available (
              v.invoice_id,
              v.payment_num,
              :pay_sum_folder.check_date,
              :pay_sum_folder.currency_code),
              fnd_currency.get_format_mask (v.currency_code, 42))*/
              TO_CHAR (ap_payment_schedules_pkg.get_discount_available (
              v.invoice_id,
              v.payment_num,
              :pay_sum_folder.check_date,
              :pay_sum_folder.currency_code),'FM999G999G999G999G999G999G999G999G990D00')
              char_discount_available,
              ap_payment_schedules_pkg.get_discount_date (
              v.invoice_id,
              v.payment_num,
              :pay_sum_folder.check_date)
              disc_date,
              v.always_take_disc_flag,
              v.discount_amount_available,
              v.discount_date,
              v.second_discount_date,
              v.second_disc_amt_available,
              v.third_discount_date,
              v.third_disc_amt_available,
              v.gross_amount,
              v.description,
              v.accts_pay_code_combi_id,
              v.due_date,
              v.REMIT_TO_SUPPLIER_NAME,
              v.REMIT_TO_SUPPLIER_ID,
              v.REMIT_TO_SUPPLIER_SITE,
              v.REMIT_TO_SUPPLIER_SITE_ID,
              v.RELATIONSHIP_ID,
              v.external_bank_account_id,
              ieba.bank_account_num external_bank_account_num,
              ieba.bank_account_name external_bank_account_name
              FROM ap_invoices_ready_to_pay_v v, iby_ext_bank_accounts ieba
              WHERE v.party_id = :pay_sum_folder.party_id /* and v.invoice_num like :adj_inv_pay.invoice_num||'%' */
              AND ( (:pay_sum_folder.payment_type_flag =
              'M')
              OR (:pay_sum_folder.payment_type_flag =
              'R'
              AND v.invoice_type IN
              ('CREDIT',
              'STANDARD',
              'DEBIT',
              'EXPENSE REPORT',
              'MIXED',
              'AWT'))
              OR /*Bug5948003, Bug6069211*/
              (:pay_sum_folder.payment_type_flag =
              'Q'
              /*AND (v.vendor_site_id =
              :pay_sum_folder.vendor_site_id
              OR v.invoice_type =
              'PAYMENT REQUEST')*/
              AND ( (:SYSTEM.LAST_RECORD =
              'TRUE'
              AND :SYSTEM.cursor_record =
              '1')
              OR (NVL (
              v.exclusive_payment_flag,
              'N') =
              'N'
              AND NVL (
              :parameter.pay_alone,
              'N') =
              'N'))))
              AND v.currency_code = :pay_sum_folder.currency_code
              AND v.payment_method_code = :pay_sum_folder.payment_method_code
              AND NVL (v.payment_function, 'PAYABLES_DISB') =
              NVL (:pay_sum_folder.payment_function, 'PAYABLES_DISB')
              AND v.set_of_books_id = :pay_sum_folder.set_of_books_id
              AND NVL (v.future_dated_payment_ccid, -1) =
              DECODE (:parameter.manual_fdp_site_acct_src_flag,
              'Y', NVL (:parameter.site_fdp_account_ccid, -1),
              NVL (v.future_dated_payment_ccid, -1))
              AND v.external_bank_account_id = ieba.ext_bank_account_id(+)
              AND v.due_date BETWEEN :ADJ_IP_CTRL.DUE_DT_FROM and :ADJ_IP_CTRL.DUE_DT_TO
                                  ORDER BY v.due_date, UPPER (invoice_num)          
                        --added 08apr2012 (end)
              removed 08apr2012 ORDER BY UPPER (invoice_num)
              ) loop
                   :ADJ_INV_PAY.INVOICE_NUM := inv_rec.INVOICE_NUM;
    :ADJ_INV_PAY.INVOICE_ID := inv_rec.INVOICE_ID;
    :ADJ_INV_PAY.INVOICE_TYPE := inv_rec.INVOICE_TYPE;
    :ADJ_INV_PAY.EXCLUSIVE_PAYMENT_FLAG := inv_rec.EXCLUSIVE_PAYMENT_FLAG;
    :ADJ_INV_PAY.PAYMENT_NUM := inv_rec.PAYMENT_NUM;
    :ADJ_INV_PAY.AMOUNT_REMAINING := inv_rec.AMOUNT_REMAINING;
    :ADJ_INV_PAY.DISCOUNT_AVAILABLE:= inv_rec.DISCOUNT_AVAILABLE;
    :ADJ_INV_PAY.DISC_DATE := inv_rec.DISC_DATE;
    :ADJ_INV_PAY.ALWAYS_TAKE_DISC_FLAG := inv_rec.ALWAYS_TAKE_DISC_FLAG;
    :ADJ_INV_PAY.DISCOUNT_AMOUNT_AVAILABLE := inv_rec.DISCOUNT_AMOUNT_AVAILABLE;
    :ADJ_INV_PAY.SECOND_DISCOUNT_DATE := inv_rec.SECOND_DISCOUNT_DATE;
    :ADJ_INV_PAY.SECOND_DISC_AMT_AVAILABLE:= inv_rec.SECOND_DISC_AMT_AVAILABLE;
    :ADJ_INV_PAY.THIRD_DISCOUNT_DATE:= inv_rec.THIRD_DISCOUNT_DATE;
    :ADJ_INV_PAY.THIRD_DISC_AMT_AVAILABLE := inv_rec.THIRD_DISC_AMT_AVAILABLE;
    :ADJ_INV_PAY.GROSS_AMOUNT := inv_rec.GROSS_AMOUNT;
    :ADJ_INV_PAY.ACCTS_PAY_CODE_COMBINATION_ID := inv_rec.ACCTS_PAY_CODE_COMBI_ID;
    :ADJ_INV_PAY.DUE_DATE := inv_rec.DUE_DATE;
    :ADJ_INV_PAY.REMIT_TO_SUPPLIER_NAME := inv_rec.REMIT_TO_SUPPLIER_NAME;
    :ADJ_INV_PAY.REMIT_TO_SUPPLIER_ID := inv_rec.REMIT_TO_SUPPLIER_ID;
    :ADJ_INV_PAY.REMIT_TO_SUPPLIER_SITE := inv_rec.REMIT_TO_SUPPLIER_SITE;
    :ADJ_INV_PAY.REMIT_TO_SUPP_SITE_ID := inv_rec.REMIT_TO_SUPPLIER_SITE_ID;
    :ADJ_INV_PAY.APS_EXTERNAL_BANK_ACCOUNT_ID := inv_rec.EXTERNAL_BANK_ACCOUNT_ID;               
    --               go_item ('ADJ_INV_PAY.INVOICE_NUM');
    --               EXECUTE_TRIGGER('WHEN-VALIDATE-ITEM');
              validate(record_scope);
              if form_success then
              next_record;
              end if;
              end loop;
              first_record;
         exception
                   when others then
                   raise form_trigger_failure;
              END;
    synchronize;
    END;
    Thanks
    -Krishn

    Hello Krishn,
    Welcome to the Oracle Forums. Please take a few minutes to review the following:
    <ul>
    <li>Oracle Forums FAQ
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>How to ask questions the smart way
    </ul>
    Following these simple guidelines will ensure you have a positive experience in any forum; not just this one!
    user12266683 wrote:
    Scenario: I have one Master Detail form. after entering values in master Form, Navigate to Detail form, there I have to enter more that 5000 lines, it's very tough for user to enter huge amount of data.
    Workaround: Give one button on Master form and written a cursor to populate all the 5000(relavent) number of record on detail block.
    Issue: while populating detail data block after around 3000 record detail form start showing Error as
    ORA-01403: no data found
    FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06502.
    Need suggestion
    ORA-01403: no data found clearly indicate that you have SQL Select statement in WHEN-VALIDATE-ITEM trigger and does not handled EXCEPTION
    add exception in your select statement.
    Hope it's clear..
    Hamid
    If someone's response is helpful or correct, please mark it accordingly.*

  • APEX 5 Bug? Change Col order ends in Error processing update. ORA-01403: no data found

    Hi ,
    i have successfully migrated my 5 apps to apex 5 yeah. Wow, Migration was complted in 15 mins !
    But now i have  Problem: I have a classic report and want to chage the column order.
    But i always get  a
    Error processing update.
    ORA-01403: no data found
    Any Workarounds ?
    Thanks
    Marco

    Hi Patrick,
    the Copy App crashes with
    ORA-06550: line 79, column 18: PLS-00103: Encountered the symbol "WHERE" when expecting one of the following: ) , * & = - + < / > at in is mod remainder not rem => <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between || multiset member submultiset
    Execution  of the statement was unsuccessful. ORA-06550: line 79, column 18: PLS-00103: Encountered the symbol "WHERE" when expecting one of the following:  ) , * & = - + < / > at in is mod remainder not rem => <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between || multiset member submultiset
    begin  wwv_flow_api.create_list_of_values(  p_id=>wwv_flow_api.id(23215926281374548)
    Thanks for help !
    Marco

  • I am getting ORA-01403: no data found error while calling a stored procedur

    Hi, I have a stored procedure. When I execute it from Toad it is successfull.
    But when I call that from my java function it gives me ORA-01403: no data found error -
    My code is like this -
    SELECT COUNT(*) INTO L_N_CNT FROM TLSI_SI_MAST WHERE UPPER(CUST_CD) =UPPER(R_V_CUST_CD) AND
    UPPER(ACCT_CD)=UPPER(R_V_ACCT_CD) AND UPPER(CNSGE_CD)=UPPER(R_V_CNSGE_CD) AND
    UPPER(FINALDEST_CD)=UPPER(R_V_FINALDEST_CD) AND     UPPER(TPT_TYPE)=UPPER(R_V_TPT_TYPE);
         IF L_N_CNT >0 THEN
              DBMS_OUTPUT.PUT_LINE('ERROR -DUPlicate SI-1');
              SP_SEL_ERR_MSG(5,R_V_ERROR_MSG);
              RETURN;
         ELSE
              DBMS_OUTPUT.PUT_LINE('BEFORE-INSERT');
              INSERT INTO TLSI_SI_MAST
                   (     CUST_CD, ACCT_CD, CNSGE_CD, FINALDEST_CD, TPT_TYPE,
                        ACCT_NM, CUST_NM,CNSGE_NM, CNSGE_ADDR1, CNSGE_ADDR2,CNSGE_ADDR3,
                        CNSGE_ADDR4, CNSGE_ATTN, EFFECTIVE_DT, MAINT_DT,
                        POD_CD, DELVY_PL_CD, TRANSSHIP,PARTSHIPMT, FREIGHT,
                        PREPAID_BY, COLLECT_BY, BL_REMARK1, BL_REMARK2,
                        MCC_IND, NOMINATION, NOTIFY_P1_NM,NOTIFY_P1_ATTN , NOTIFY_P1_ADDR1,
                        NOTIFY_P1_ADDR2, NOTIFY_P1_ADDR3, NOTIFY_P1_ADDR4,NOTIFY_P2_NM,NOTIFY_P2_ATTN ,
                        NOTIFY_P2_ADDR1,NOTIFY_P2_ADDR2, NOTIFY_P2_ADDR3, NOTIFY_P2_ADDR4,
                        NOTIFY_P3_NM,NOTIFY_P3_ATTN , NOTIFY_P3_ADDR1,NOTIFY_P3_ADDR2, NOTIFY_P3_ADDR3,
                        NOTIFY_P3_ADDR4,CREATION_DT, ACCT_ATTN, SCC_IND, CREAT_BY, MAINT_BY
                        VALUES(     R_V_CUST_CD,R_V_ACCT_CD,R_V_CNSGE_CD,R_V_FINALDEST_CD,R_V_TPT_TYPE,
                        R_V_ACCT_NM,R_V_CUST_NM ,R_V_CNSGE_NM, R_V_CNSGE_ADDR1,R_V_CNSGE_ADDR2, R_V_CNSGE_ADDR3,
                        R_V_CNSGE_ADDR4,R_V_CNSGE_ATTN,     R_V_EFFECTIVE_DT ,SYSDATE, R_V_POD_CD,R_V_DELVY_PL_CD,R_V_TRANSSHIP ,R_V_PARTSHIPMT , R_V_FREIGHT,
                        R_V_PREPAID_BY ,R_V_COLLECT_BY ,R_V_BL_REMARK1 ,R_V_BL_REMARK2,R_V_MCC_IND,
                        R_V_NOMINATION,R_V_NOTIFY_P1_NM, R_V_NOTIFY_P1_ATTN, R_V_NOTIFY_P1_ADD1, R_V_NOTIFY_P1_ADD2,
                        R_V_NOTIFY_P1_ADD3, R_V_NOTIFY_P1_ADD4, R_V_NOTIFY_P2_NM, R_V_NOTIFY_P2_ATTN, R_V_NOTIFY_P2_ADD1,
                        R_V_NOTIFY_P2_ADD2, R_V_NOTIFY_P2_ADD3, R_V_NOTIFY_P2_ADD4, R_V_NOTIFY_P3_NM, R_V_NOTIFY_P3_ATTN,
                        R_V_NOTIFY_P3_ADD1, R_V_NOTIFY_P3_ADD2, R_V_NOTIFY_P3_ADD3, R_V_NOTIFY_P3_ADD4,
                        SYSDATE,R_V_ACCT_ATTN,R_V_SCC_IND,R_V_USER_ID,R_V_USER_ID
                        DBMS_OUTPUT.PUT_LINE(' SI - REC -INSERTED');
         END IF;

    Hi,
    I think there is a part of the stored procedure you did not displayed in your post. I think your issue is probably due to a parsed value from java. For example when calling a procedure from java and the data type from java is different than expected by the procedure the ORA-01403 could be encountered. Can you please show the exact construction of the call of the procedure from within java and also how the procedure possible is provided with an input parameter.
    Regards, Gerwin

  • HELP!! Create source system failed in BW ( ORA-01403: no data found)

    Hi,
    I cannot create Oracle DB as a source system in my BW (7.01).
    In system log, I got the following information.
    ============================
    Database error 1403 at CON
    > ORA-01403: no data found
    ============================
    How can I fix this issue?
    It's kind of urgent.
    Thanks!
    Regards,
    Steven
    Edited by: Wen Steven on Sep 30, 2011 6:09 PM

    Hi Steven,
    Please check the below thread
    SQL/Buffer trace RC=1403
    Regards,
    Venkatesh

  • Forms application returns "ORA-01403 no data found" exception on Windows 7

    Hi everyone,
    I am currently involved in an application compatibility project for an O/S migration from Windows XP to Windows 7.
    We have a legacy Oracle Dev6i P18 Forms application that has been working perfectly on Windows XP for the last decade or so. When we installed the same application on Windows 7, it returned a pop-up error message with the text: "ORA-01403 no data found" when performing a certain operation (clicking on a Submit button in a specific form). The same operation works successfully on Windows XP displaying the message "Submit has been successful".
    This error is well documented and the solution involves adding an exception handler to the faulting SQL statement(s) in order to handle the ORA-01403 exception. Unfortunately, the application is composed of compiled forms (.FMX) and we no longer have the source code so I can't implement this solution.
    I ran a file comparison utility (WinDiff from the Windows SDK) and confirmed that all the files in the application folder and the Oracle Dev6i P18 folder are identical on both the Windows XP and Windows 7 systems.
    I enabled tracing in SQLNet.ORA by configuring TRACE_LEVEL_CLIENT=SUPPORT (I know, too verbose) and other related settings on both systems and have uploaded the traces to my SkyDrive for public viewing:
    http://sdrv.ms/10BNYtI
    The traces show that the "ORA-01403" exception occurs many times on both Windows XP and Windows 7 systems as a result of various SQL statements being executed, for instance:
    SELECT TASK_ID,TASK_DETAIL_STATUS,ASSIGNED_DATE FROM TASK_DETAILS WHERE TASK_ID = :b1 AND TASK_DETAIL_STATUS = (SELECT ID FROM V_TASK_STATUS WHERE ABBREVIATION = 'PLANNED' ) FOR UPDATE OF TASK_DETAIL_STATUS,ASSIGNED_DATE
    UPDATE TASK_DETAILS SET ASSIGNED_DATE=NTMS_UTIL.GET_SERVER_DATE,TASK_DETAIL_STATUS=(SELECT ID FROM V_TASK_STATUS WHERE ABBREVIATION = 'ASSIGNED' ) WHERE ROWID = :b1
    ORA-01403: no data found.
    So the same error happens on both Windows XP and Windows 7.
    On Windows XP, the error is somehow handled, and does not cause the "Submit" operation to fail.
    On Windows 7, however, the error bubbles to the surface and is displayed to the user, thus halting the "Submit" operation.

    Thank you. I'm well aware that adding an exception handler is the classic solution to the ORA-01403 error. However, like I mentioned in my original post, I don't have the source code. All I have are the compiled .FMX forms so I can't implement such a solution:
    From my original post:
    This error is well documented and the solution involves adding an exception handler to the faulting SQL statement(s) in order to handle the ORA-01403 exception. Unfortunately, the application is composed of compiled forms (.FMX) and we no longer have the source code so I can't implement this solution.

  • REP-1401: Fatal PL/SQL error occurred. ORA-01403: no data found

    Hi guys,
    I am getting error 'REP-1401: Fatal PL/SQL error occurred. ORA-01403: no data found ' when run the report
    and i m also use formula column in my report.
    can any body help me why it's coming.
    following code is used in formula column plz check and verify:
    function CF_3Formula return Char is
    T1 VARCHAR2(100);
    begin
    SELECT
         VAT_REG_NO INTO T1
    FROM
         JA_IN_HR_ORGANIZATION_UNITS JIHOU,
         HR_LOCATIONS HL--,
         --MTL_TXN_REQUEST_HEADERS MTLH
    WHERE
    JIHOU.ORGANIZATION_ID=HL.INVENTORY_ORGANIZATION_ID AND
    JIHOU.LOCATION_ID=HL.LOCATION_ID AND
    --Jihou.ORGANIZATION_ID = Mtlh.Organization_Id AND
    -- Hl.INVENTORY_ORGANIZATION_ID =Mtlh.Organization_Id AND
    -- MTLH.ATTRIBUTE10=SUBSTR(HL.LOCATION_CODE,1,3) AND
    SUBSTR(HL.LOCATION_CODE,1,3)= :TO_ORG1 ;
    RETURN (T1);
    end;
    plz help me out.

    Hi;
    What is EBS version? Is it custom report or not?
    See below which is mention similar errors
    Autoinvoice Error: ORA-1403: no data found [ID 1209403.1]
    APXIIMPT - Payable Open Interface Import Fails on "REP-1401: 'cf_source_nameformula': Fatal PL/SQL error occurred. ORA-01403: no data found" [ID 222058.1]
    Regard
    Helios

  • PLSQL function body returning an sql report returns ORA-01403 No Data Found

    I am on APEX 3.1.2.00.02 and Oracle 10g.
    I am developing a report with SQL Query (PL/SQL function body returning SQL query) type. But on running the report I am getting
    report error:
    ORA-01403: no data found
    Region Source
    declare
      qry varchar2(32767);
    begin
      --Procedure call
      my_pkg.get_query(qry);
      htp.p(qry);
      return /*select 1 from dual */ qry;
    end;
    Procedure
    PROCEDURE get_query (V_QRY OUT VARCHAR2)
    IS
      qry varchar2(32767);
    begin
      qry := ' select name
         , max(decode(to_char(service_date,''Mon-YY''), ''Jan-09'', value, null)) as "Jan-09"
         , max(decode(to_char(service_date,''Mon-YY''), ''Jan-09'', value, null)) as "Feb-09"
         from MY_TABLE
         group by name ';
      V_QRY := qry;
    end;
    The query will be enhanced later to add more months and year based on user parameters once I am successfull in running report on this.
    I wish to use Query Specific Column names. I have seen this suggestion from Scott in a number of threads to use /*select 1 from dual */ with query but not working in my case.
    Can someone please suggest what can I do to make it working?
    Regards,
    Amir

    Firstly, have you unit tested the procedure (namely, within the SQL Workshop, SQL*Plus, SQL Developer,etc, etc.) to see if it produces the right output in the first place?
    If you have, and the query string generated is valid, try assigning the output to a page item (thus allowing you to view it in the session browser) or even pass the procedure output into the debug window (with the use of the wwv_flow.debug function). This might reveal some state or session change which is causing it not to return.You might find this easier to achieve if you change from a 'procedure and out parameter' combination to a 'function returning string' approach.
    Alternatively, try re-creating the report in a new region - occasionally I've come across weird bugs with report regions which resolved themselves in this manner.

  • Problem with new DB app, report+form, report works great, form says ORA-01403: no data found

    I have a new table, the PK is a varchar2(5) column, when I allow the default query in the report to do its work, I get all the expected data.  when I click on the edit icon (pencil), I get an error screen indicating ORA-01403: no data found.  I'm hosed!  This was generated by the app!  no changes were made to anything in the app, except to turn off tabs at create time.  I even left the default name.
    My ARF is hitting the right table with the PK column, but finds nothing.  I have the "success" message showing me the PK value.  What could be going on here, and how can it be addressed?  Today is the 1st time I have seen this matter.
    I'm running 4.22 as the workspace admin, I have other apps that work fine (to expectation), my browser is FF22, though I plan a downgrade to 18.  Our DB is 11.1.0.7.

    Jorge, thanks for your attention to my problem, I appreciate any insights, although there is a little clarification I can offer.  Also, if you can, please remind me the tags to use in my text that would properly set off the code snippets or prior message content?
    [you wrote]
    You said you have a "success" message showing you the PK value. Can you elaborate on this?
    The form page, under the ARF, allows for the display of a "success" message and a "failure" message.  I have seen my "success" message appear, but it didn't show my key field as a brought-back value (which I told it to include), and I think now this is not relevant any longer.  I found that there was a link on the report attributes page between #ROWID# and a P2_ROWID that was incorrect (probably from an earlier stage of dev in the app), and I changed this to my key field, and this altered the outcome of the ARF action.  This leads to ....
    [you wrote]
    Can you see the correct PK value in the URL? Does the item parameter match what you expect (correct page item and value)? Perhaps share that full URL here?
    I have expected values in my URL.  The URL does show my key value (tail end of URL underlined here):
    ../apex/f?p=120:2:7519563874482::NO::P2_VCODE:RB15
    [you wrote]
    Debug the page and see which process, item or step is actually failing. You could be running some other process on the form page and that could be what actually fails.  Treat it as if the ARF works correctly and see what else could be happening.
    I can add the detail that my 1st message was based on testing with a table where I set the PK as data type VARCHAR2, but in more testing on the actual app (whose URL piece is above) I am using a PK which is CHAR.
    The result of the debug effort is that APEX has built its own query for pulling back the row in the ARF, and it is joining on my PK field to an APEX item P_ROWID which I don't think I created.  Nor does it appear to offer me any avenue for correcting it.    debug snippet:    where "VCODE" = :p_rowid; end;

  • Help with ORA-01403: no data found please.

    First off I'd like to apologise for my lack of PL/SQL experience, what follows may seem naive, but I guess we all have to start somewhere.
    I'm trying to create a function which determines an employee's Annual Holiday Entitlement by comparing their length of service against a lookup of entitlement values. Due to the complexity of the application I'm targeting there are a number of other factors to be take into consideration, but this is the basic idea of what I want to achieve.
    I've started by taking a working SQL Server 2005 function and converted this using the translation scratch pad in SQL Developer 1.5.1 I'm now hand cranking the subtleties into the script but when I debug the code I'm getting "ORA-01403: no data found" at almost every SELECT. In fact the only successful select is from the ABS_SYSTEM_CONTROLS table. I can handle the first few failures by setting default values in the variables that I'm trying to load, but this isn't an option when it comes to selecting the DATE_OF_START from the PERSON table.
    I've sure I've probably made some fundamental error, but can't spot it myself. Any help would be most welcome.
    I've included the entire script below for your entertainment ;-)
    Thanks
    Phil.
    create or replace
    function mygetannualholidayentitlement
    ( v_empNo in varchar2
    , v_inputDate in DATE
    ) return number as
       -- Declare variables here
       v_entitlement FLOAT(53);
       v_holidayPlan VARCHAR2(20);
       v_contServiceOption VARCHAR2(255);
       v_postNo CHAR(16);
       v_lengthOfService NUMBER(10,2) ; -- Need to give this a default value else the CURSOR (below) won't initialise.
       v_empStartDate DATE;
       -- Load up our loacal variable for each row in the loop and the final value is the one we want.
       v_selectedLOF FLOAT(53);
       v_selectedDateEffective DATE;
       v_selectedAmount FLOAT(53);
       v_effectiveDate DATE;
       -- Cursor declaration
       -- Holiday plan details are also keyed on DATE_EFFECTIVE.  Need to identify which row is active as at our @effectiveDate.
       CURSOR holDefCursor
         IS SELECT length_of_service,
       date_effective,
       amount
         FROM holiday_plan_def
          WHERE hplan_code = v_holidayPlan
         AND length_of_service < v_lengthOfService
         ORDER BY date_effective ASC,
       length_of_service ASC;
    BEGIN
       -- Initialise variables --
       -- truncate any hours/Mins & secs from effective date
       v_effectiveDate := trunc(v_inputdate);
       v_entitlement := 0;
       v_contServiceOption := 0;
       v_lengthOfService := 0;
       BEGIN
       SELECT HPLAN_CODE
         INTO v_holidayPlan
         FROM APPT_HOLIDAY_BALANCE
          WHERE emp_no = v_empNo
                  --          post_no = @postNo and
                  AND ( v_effectiveDate BETWEEN HOLIDAY_YEAR_START AND HOLIDAY_YEAR_END );
       EXCEPTION
       WHEN NO_DATA_FOUND THEN
          v_holidayplan:=NULL;
       WHEN OTHERS THEN
           raise_application_error(-20011,'Unknown Exception in MyGetAnnualHolidayEntitlement function.');
       END;
       -- Still no hoildayPlan? Then use the default plan code from ABS_SYSTEM_CONTROLS.
       IF v_holidayPlan IS NULL THEN
          SELECT HPLAN_CODE
            INTO v_holidayPlan
            FROM ABS_SYSTEM_CONTROLS ;
       END IF;
       BEGIN
        SELECT OPTION_VALUE
          INTO v_contServiceOption
          FROM PS_OPTIONS
           WHERE OPTION_NAME = 'CONTINUOUS_SERVICE_OPTION';
       EXCEPTION
       WHEN NO_DATA_FOUND THEN
          v_contServiceOption := 'N' ;
       WHEN OTHERS THEN
           raise_application_error(-20011,'Unknown Exception in MyGetAnnualHolidayEntitlement function.');
       END;
       IF v_contServiceOption = 'Y' THEN
       BEGIN
          -- Need to take into account the employees CONTINUOUS_SERVICE_DATE when calculating length of service
          BEGIN
          SELECT CONTINUOUS_SERVICE_DATE
            INTO v_empStartDate
            FROM person
             WHERE emp_no = v_empNo;
          EXCEPTION  
            WHEN NO_DATA_FOUND THEN
              v_empStartDate := NULL;
            WHEN OTHERS THEN
              raise_application_error(-20011,'Unknown Exception in MyGetAnnualHolidayEntitlement function.');
          END;
          -- If we can't get a CONTINUOUS_SERVICE_DATE we will fall back to PERSON.DATE_OF_START
          IF v_empStartDate IS NULL THEN
          BEGIN
             SELECT DATE_OF_START
               INTO v_empStartDate
               FROM PERSON
                WHERE emp_no = v_empNo;
          EXCEPTION  
            WHEN OTHERS THEN
              raise_application_error(-20011,'Unknown Exception in MyGetAnnualHolidayEntitlement function.');
          END;
          END IF;
       END;
       ELSE
       BEGIN
          -- Need to use employees DATE_OF_START when calculating length of service
          SELECT DATE_OF_START
            INTO v_empStartDate
            FROM PERSON
             WHERE emp_no = v_empNo;
       END;
       END IF;
       -- Now we can get length of service
       v_lengthOfService := sqlserver_utilities.datediff('MONTH', v_empStartDate, v_effectiveDate) / 12.00;
       OPEN holDefCursor;
       FETCH holDefCursor INTO v_selectedLOF,v_selectedDateEffective,v_selectedAmount;
       WHILE ( sqlserver_utilities.fetch_status(holDefCursor%FOUND) = 0 )
       LOOP
          BEGIN
             IF v_selectedDateEffective < v_effectiveDate THEN
                v_entitlement := v_selectedAmount;
             END IF;
             -- Get the next value.
             FETCH holDefCursor INTO v_selectedLOF,v_selectedDateEffective,v_selectedAmount;
          END;
       END LOOP;
       CLOSE holDefCursor;
       -- Return the result of the function
       RETURN v_entitlement;
    END;Edited by: user4395499 on 27-Oct-2008 04:04
    Edited by: user4395499 on 27-Oct-2008 04:05
    Edited by: user4395499 on 27-Oct-2008 07:10

    Your code is extremely procedural - whilst you could ultimately get it to work like this, it is not the most efficient way of doing it.
    You should think about reducing your code to one sql statement if at all possible - this reduces the amount of context switching that needs to take place (eg. Going from PL/SQL to SQL back to PL/SQL to SQL, etc) and is usually much easier to maintain and test. You could do this by joining the various tables together, (and you might want to think about using nvl() to combine the two queries on the PERSON table!).
    Also, you've labelled your parameters "v_" and your variables "v_" ... common convention uses "p_" for parameters, to allow for easy distinction between parameters passed in and variables declared during the course of the procedure/function.
    As to the char() defined column - is there any chance that you could change that? As you've found out, chars are usually not a good datatype to use! Storing numbers in a char/varchar2 column is a no-no too, as you then run the risk of having invalid numbers stored in the column.

  • Error in mru internal routine: ORA-20001: no data found in tabular form

    Hi All,
    I am trying to do the Multi Row Update. Please go through the below process which i followes:
    > I have a table B which is of child table of A, the columns belongs to table B are B_ID, B_Name, B_Description and A_ID.
    > I have prepared a report with B_NAME, B_DESCRIPTION and B_ID and in this B_NAME is of LOV.
    > Now I want to update the values through interface by clicking on SUBMIT [Apply Change] button.
    > To do this I used the Process of "Multiple Rows Update" by choosing table B and a primary key value of table B which is B_ID.
    While clicking on the SUBMIT [Apply Change] button I am getting this error:
    Error in mru internal routine: ORA-20001: no data found in tabular formPlease tell me is i am following the correct process. If not please correct me.
    Thanks in advance
    Vishwanath

    Hi All,
    I am trying to do the Multi Row Update. Please go through the below process which i followes:
    > I have a table B which is of child table of A, the columns belongs to table B are B_ID, B_Name, B_Description and A_ID.
    > I have prepared a report with B_NAME, B_DESCRIPTION and B_ID and in this B_NAME is of LOV.
    > Now I want to update the values through interface by clicking on SUBMIT [Apply Change] button.
    > To do this I used the Process of "Multiple Rows Update" by choosing table B and a primary key value of table B which is B_ID.
    While clicking on the SUBMIT [Apply Change] button I am getting this error:
    Error in mru internal routine: ORA-20001: no data found in tabular formPlease tell me is i am following the correct process. If not please correct me.
    Thanks in advance
    Vishwanath

  • Error in standard SIT form : ORA-01403: no data found

    Hi
    I have created a custom responsibility and menu.
    And attached the single seeded function "Enter Person Special Information" to the menu.
    Whenever I try to access the function it opens the FORMS and gives the error.
    ORA-01403: no data found
    FRM-40735: WHEN-NEW-FORM-INSTANCE trigger raised unhandled exception ORA-06502.
    Any ideas?

    Did you do as follows?
    Create a Menu ‘SIT_MENU’:
    Name: SIT_MENU
    User Menu Name: Enter Person Special Information
    Menu Type: Standard
    Desc: (optional)
    Seq: 1
    Prompt: Special Info Types
    Function: Enter Person Special Information
    2. Create Responsibility and attach the Menu as follows:
    Rsponsibility Name: SIT Responsibility
    Application: Human Resources
    Resp. Key: SIT
    Available From: Oracle Applications
    Data Group: Standard
    Application: Human Resources
    Menu: Enter Person Special Information
    Now you can attach this responsibility to a user and test.

  • NEED HELP IN CONFLICT HANDLER ERROR ORA-01403: no data found

    Hi All,
    I am using Oracle Streams to replicate the data...
    I need to update the records on the destination with some particular condition like if USER_COUNTRY = 'XXX' then the data need to be updated in the destination side else skip ...
    I wrote the procedure ..below .. the data is not replicating and found the below error from dba_apply_error..
    ORA-01403: no data found
    ORA-06512: at "SYS.LCR$_ROW_RECORD", line 419
    Table called history_row_lcrs is created in the strmadmin to store the lcr values...
    CREATE OR REPLACE PROCEDURE proc_test(in_any sys.anydata)IS
    lcr sys.lcr$_row_record;
    rc pls_integer;
    v_type varchar2(20);
    col_1 sys.anydata;
    lcr_usercountry varchar2(20);
    TRANS varchar2(20);
    skip_routine Exception;
    BEGIN
    rc:=in_any.GetObject(lcr);
    v_type:=lcr.get_command_type();
    col_1:=lcr.get_value('NEW','USER_COUNTRY');
    rc:=col_1.GetVarchar2(lcr_usercountry);
    for x in ( select user_country from TEST.TESTREP1
    where USER_COUNTRY=lcr_usercountry)
    Loop
    IF (x.USER_COUNTRY = 'XXX')
    THEN
    insert into strmadmin.history_row_lcrs VALUES (SYSDATE, lcr.GET_SOURCE_DATABASE_NAME(), lcr.GET_COMMAND_TYPE(),
    lcr.GET_OBJECT_OWNER(), lcr.GET_OBJECT_NAME(), lcr.GET_TAG(), lcr.GET_TRANSACTION_ID(), lcr.GET_SCN(),
    lcr.GET_COMMIT_SCN,lcr.GET_VALUES('old'), lcr.GET_VALUES('new', 'n'));
    lcr.EXECUTE(true);
    ELSE
    Raise Skip_routine;
    END IF;
    END Loop;
    Exception
    when skip_routine Then
    null;
    END;
    BEGIN
    DBMS_APPLY_ADM.SET_DML_HANDLER(
    object_name => 'TEST.TESTREP1',
    object_type => 'TABLE',
    operation_name => 'UPDATE',
    error_handler => false,
    user_procedure => 'STRMADMIN.PROC_TEST',
    apply_database_link => NULL,
    apply_name => NULL);
    END;
    Please try to help me if am doing something wrong...because I need to update only one colums am using DML_HANDLER instead of SET_UPDATE_CONFLICT_HANDLER...
    Any other inputs are also appreciated...
    Thanks In Advance and appreciate for the quick reply...

    I fired the query, am not getting any output from dbms_output.put_line('..|USER_COUNTRY..');
    Is that no data is reading or may be any reason else..
    in this table store_id is the primary key ..
    SQL> set serveroutput on
    SQL> CREATE OR REPLACE PROCEDURE test(in_any sys.anydata) IS
    2 lcr sys.lcr$_row_record;
    3 rc pls_integer;
    4 v_type varchar2(20);
    5 col_1 sys.anydata;
    6 col_2 sys.anydata;
    7 lcr_usercountry varchar2(20);
    8 lcr_storeid number;
    9 TRANS varchar2(20);
    10 store_id number;
    11 USER_COUNTRY varchar2(20);
    12
    13 BEGIN
    14 rc:=in_any.GetObject(lcr);
    15 v_type:=lcr.get_command_type();
    16 col_1:=lcr.get_value('NEW','USER_COUNTRY');
    17 rc:=col_1.GetVarchar2(lcr_usercountry);
    18 col_2:=lcr.get_value('NEW','STORE_ID');
    19 rc:=col_2.getnumber(lcr_storeid);
    20 select user_country into user_country from dev03.testrep1 where user_country=lcr_usercountry and store_id=lcr_storeid;
    21 dbms_output.put_line('---------||USER_COUNTRY ||-----------');
    22 END;
    23 /
    Procedure created.
    Thanks for your help ....

Maybe you are looking for

  • Can you create apps after 1st May 2015 using Adobe DPS single edition?

    Can you create apps after 1st May 2015 using Adobe DPS single edition? I currently have SE via creatieve cloud - one of the only reasons we switched to CC was for the DPS SE. Does anyone know if this capability will just be 'switched off' at midnight

  • IPod touch 2nd gen software downgrade?

    I have an iPod touch 2nd gen. 8GB. It's current version is 4.2.1. I upgraded using my brother's mac. My mac can no longer update it's own software therefore not allowing me to update my iTunes to iTunes 10. I was wondering if there is a way for me to

  • Cost estimate missing for a material in sales order

    Hi All Users have opened sales orders with materials which does not have a  valid costestimates. These missing cost estimate sales orders did not flow to COPA. Is there any report,  I can run to view all those sales orders which did not flow to COPA?

  • We want to view header reference as column data wonu2019t appear in any Refaren

    Dear Experts, we want to view header reference as column data wonu2019t appear in any of the reference filed. Please tell me the soluation How can I give the soluation bilow issue. Currently user are facing one problem with respect of Line item repor

  • How to create dynamic blocks in oracle forms

    Hi All, Is it possible to create a dynamic blocks and items in forms? I mean based on table driven values I want to create a blocks and items in the forms. I appreciate the help. Thanks Srini.