ORA-06503: PL/SQL: Function returned without value

Hello
Having a bit of a problem with piplined functions.
Why does this work :
SET SERVEROUTPUT ON
DECLARE
TYPE SARRAY IS TABLE OF VARCHAR2(4000);
CURSOR CU IS SELECT * FROM DX_XML_ATTENDANCE WHERE STUD_ID = 107777 AND BASE_ID = 94;
T_STUD NUMBER(10);
T_BASE NUMBER(10);
T_DATE DATE;
T_MARKS VARCHAR2(1000);
LEN_MARKS NUMBER;
PDATE DATE;
SDATE DATE;
EDATE DATE;
SLEN NUMBER;
WEEKLEN NUMBER;
INIPOS NUMBER;
MARRAY VARCHAR2(1000);
SUBARRAY SARRAY := SARRAY();
SFILL VARCHAR2(14) := '--------------';
EPOS NUMBER;
MY_REC     DX_XML_ATTENDANCE%ROWTYPE;
BEGIN
SUBARRAY.EXTEND(17);
DBMS_OUTPUT.ENABLE(100000000);
--FOR MY_REC IN CU
OPEN CU;
LOOP
     FETCH CU INTO MY_REC;
     EXIT WHEN (CU%NOTFOUND);
T_STUD := MY_REC.STUD_ID;
T_BASE := MY_REC.BASE_ID;
T_DATE := TO_DATE(MY_REC.START_DATE, 'DD/MM/YYYY');
T_MARKS := MY_REC.MARKS;
LEN_MARKS := LENGTH(T_MARKS);
EPOS := LEN_MARKS / 2;
SDATE := ROUND(TO_DATE(T_DATE), 'W') - 1;
INIPOS := TO_NUMBER(TO_CHAR(T_DATE, 'D'));
SLEN := INIPOS + 3;
PDATE := SDATE;
EDATE := SDATE + EPOS;
MARRAY := SUBSTR(T_MARKS, 1, SLEN);
WEEKLEN := LENGTH(MARRAY);
IF WEEKLEN < 14 THEN
     MARRAY := SUBSTR(SFILL, 1, 14 - WEEKLEN) || MARRAY;
END IF;
SUBARRAY(1) := T_STUD;
SUBARRAY(2) := T_BASE;
SUBARRAY(3) := PDATE;
FOR i IN 4 .. 17 LOOP
     SUBARRAY(i) := SUBSTR(MARRAY, i - 3, 1);
END LOOP;
DBMS_OUTPUT.PUT_LINE(SUBARRAY(1)||' '||SUBARRAY(2)||' '||SUBARRAY(3)||' '||SUBARRAY(4)||' '||
     SUBARRAY(5)||' '||SUBARRAY(6)||' '||SUBARRAY(7)||' '||SUBARRAY(8)||' '||SUBARRAY(9)||' '||
     SUBARRAY(10)||' '||SUBARRAY(11)||' '||SUBARRAY(12)||' '||SUBARRAY(13)||' '||SUBARRAY(14)||' '||
     SUBARRAY(15)||' '||SUBARRAY(16)||' '||SUBARRAY(17));
WHILE PDATE < EDATE LOOP
     PDATE := PDATE + 7;
     MARRAY := SUBSTR(T_MARKS, SLEN + 1, 14);
     WEEKLEN := LENGTH(MARRAY);
     IF WEEKLEN < 14 THEN
          MARRAY := MARRAY || SUBSTR(SFILL, 1, 14 - WEEKLEN);
     END IF;
     FOR i IN 4 .. 17 LOOP
          SUBARRAY(i) := SUBSTR(MARRAY, i - 3, 1);
     END LOOP;
     SUBARRAY(3) := PDATE;
DBMS_OUTPUT.PUT_LINE(SUBARRAY(1)||' '||SUBARRAY(2)||' '||SUBARRAY(3)||' '||SUBARRAY(4)||' '||
     SUBARRAY(5)||' '||SUBARRAY(6)||' '||SUBARRAY(7)||' '||SUBARRAY(8)||' '||SUBARRAY(9)||' '||
     SUBARRAY(10)||' '||SUBARRAY(11)||' '||SUBARRAY(12)||' '||SUBARRAY(13)||' '||SUBARRAY(14)||' '||
     SUBARRAY(15)||' '||SUBARRAY(16)||' '||SUBARRAY(17));
     PDATE := PDATE + 7;
     SLEN := SLEN + 14;
END LOOP;
END LOOP;
END;
and this does not :
CREATE OR REPLACE PACKAGE BODY PARSE_ATTENDANCE AS
FUNCTION ENUM_MARKS(SEL_SQL IN VARCHAR2)
RETURN TMP_ATT_DATA_TBL PIPELINED
IS
V_SQL           VARCHAR(1000):= SEL_SQL;
V_CURSOR      SYS_REFCURSOR;
V_ROW          TMP_ATT_HOLDING:=TMP_ATT_HOLDING(NULL, NULL, NULL, NULL);
T_STUD           NUMBER(10);
T_BASE           NUMBER(10);
T_DATE           DATE;
T_MARKS      VARCHAR2(1000);
LEN_MARKS      NUMBER;
PDATE          DATE;
SDATE          DATE;
EDATE          DATE;
SLEN           NUMBER;
WEEKLEN      NUMBER;
INIPOS           NUMBER;
MARRAY           VARCHAR2(1000);
SUBARRAY      SARRAY := SARRAY();
SFILL           VARCHAR2(14) := '--------------';
EPOS           NUMBER;
BEGIN
SUBARRAY.EXTEND(17);
OPEN V_CURSOR FOR V_SQL;
LOOP
     FETCH V_CURSOR INTO V_ROW.STUD_ID, V_ROW.BASE_ID, V_ROW.START_DATE, V_ROW.MARKS;
     EXIT WHEN V_CURSOR%NOTFOUND;
T_STUD := V_ROW.STUD_ID;
T_BASE := V_ROW.BASE_ID;
T_DATE := TO_DATE(V_ROW.START_DATE, 'DD/MM/YYYY');
T_MARKS := V_ROW.MARKS;
LEN_MARKS := LENGTH(T_MARKS);
EPOS := LEN_MARKS / 2;
SDATE := ROUND(TO_DATE(T_DATE), 'W') - 1;
INIPOS := TO_NUMBER(TO_CHAR(T_DATE, 'D'));
SLEN := INIPOS + 3;
PDATE := SDATE;
EDATE := SDATE + EPOS;
MARRAY := SUBSTR(T_MARKS, 1, SLEN);
WEEKLEN := LENGTH(MARRAY);
IF WEEKLEN < 14 THEN
     MARRAY := SUBSTR(SFILL, 1, 14 - WEEKLEN) || MARRAY;
END IF;
SUBARRAY(1) := T_STUD;
SUBARRAY(2) := T_BASE;
SUBARRAY(3) := PDATE;
FOR i IN 4 .. 17 LOOP
     SUBARRAY(i) := SUBSTR(MARRAY, i - 3, 1);
END LOOP;
PIPE ROW(TMP_ATT_DATA_OBJ(SUBARRAY(1),SUBARRAY(2),SUBARRAY(3),SUBARRAY(4),
     SUBARRAY(5),SUBARRAY(6),SUBARRAY(7),SUBARRAY(8),SUBARRAY(9),
     SUBARRAY(10),SUBARRAY(11),SUBARRAY(12),SUBARRAY(13),SUBARRAY(14),
     SUBARRAY(15),SUBARRAY(16),SUBARRAY(17)));
WHILE PDATE < EDATE LOOP
     PDATE := PDATE + 7;
     MARRAY := SUBSTR(T_MARKS, SLEN + 1, 14);
     WEEKLEN := LENGTH(MARRAY);
     IF WEEKLEN < 14 THEN
          MARRAY := MARRAY || SUBSTR(SFILL, 1, 14 - WEEKLEN);
     END IF;
     FOR i IN 4 .. 17 LOOP
          SUBARRAY(i) := SUBSTR(MARRAY, i - 3, 1);
     END LOOP;
     SUBARRAY(3) := PDATE;
     PIPE ROW(TMP_ATT_DATA_OBJ(SUBARRAY(1),SUBARRAY(2),SUBARRAY(3),SUBARRAY(4),
     SUBARRAY(5),SUBARRAY(6),SUBARRAY(7),SUBARRAY(8),SUBARRAY(9),
     SUBARRAY(10),SUBARRAY(11),SUBARRAY(12),SUBARRAY(13),SUBARRAY(14),
     SUBARRAY(15),SUBARRAY(16),SUBARRAY(17)));
     PDATE := PDATE + 7;
     SLEN := SLEN + 14;
END LOOP;
END LOOP;
END ENUM_MARKS;
END PARSE_ATTENDANCE;
(This is then called like SELECT * FROM
TABLE(
PARSE_ATTENDANCE.ENUM_MARKS(
'SELECT STUD_ID, BASE_ID, START_DATE, MARKS
FROM DX_XML_ATTENDANCE WHERE STUD_ID = 107777
AND BASE_ID = 94'))
I get the same error, around this section near the bottom :
     PDATE := PDATE + 7;
     SLEN := SLEN + 14;
Can any one help?

Here is an example. you are missing an return statement.
SQL> create or replace type varchar2_table is table of varchar2(10) ;
  2  /
Type created.
SQL> show errors
No errors.
SQL> create or replace function get_data return varchar2_table pipelined is
  2  begin
  3      pipe row(('Test')) ;
  4  end ;
  5  /
Function created.
SQL> show errors
No errors.
SQL> select * from table(get_data) ;
ERROR:
ORA-06503: PL/SQL: Function returned without value
ORA-06512: at "KKISHORE.GET_DATA", line 3
no rows selected
SQL> create or replace function get_data return varchar2_table pipelined is
  2  begin
  3      pipe row(('Test')) ;
4 return ;
  5  end ;
  6  /
Function created.
SQL> show errors
No errors.
SQL> select * from table(get_data) ;
COLUMN_VAL
Test
SQL>

Similar Messages

  • REP-1401: 'no_daysformula':Fatal PL/SQL error occured. ora-06503: PL/SQL : Functio returned without value. REP-0619: You cannot run without a layout.

    Hi everyone.
    Can anyone tell me what is wrong in this code below?
    Code:
    function NO_DAYSFormula return Number is
    begin
      IF TO_CHAR(TO_DATE(:P_FR_DT, 'DD-MM-RRRR'), 'RRRR') =TO_CHAR(TO_DATE(:ACCT_OPN_DT, 'DD-MM-RRRR'), 'RRRR')
      AND :P_TO_DT<:MATURITY_DATE
      AND :ACCT_OPN_DT>:P_FR_DT
      THEN RETURN (:P_TO_DT-:ACCT_OPN_DT+1);
      ELSIF TO_CHAR(TO_DATE(:P_FR_DT, 'DD-MM-RRRR'), 'RRRR') =TO_CHAR(TO_DATE(:ACCT_OPN_DT, 'DD-MM-RRRR'), 'RRRR')
      AND :P_TO_DT<:MATURITY_DATE
      AND :ACCT_OPN_DT<:P_FR_DT
      THEN RETURN (:P_FR_DT-:P_TO_DT+1);
      ELSIF TO_CHAR(TO_DATE(:P_FR_DT, 'DD-MM-RRRR'), 'RRRR') =TO_CHAR(TO_DATE(:ACCT_OPN_DT, 'DD-MM-RRRR'), 'RRRR')
       AND :P_TO_DT>:MATURITY_DATE
       AND :ACCT_OPN_DT<:P_FR_DT
      THEN RETURN (:P_FR_DT-:MATURITY_DATE+1);
      END IF;
    END;
    It gets compiled successfully but when i run the report, i get 2 errors.
    Error 1:
    REP-1401: 'no_daysformula':Fatal PL/SQL error occurred.
    ora-06503: PL/SQL : Function returned without value.
    Error 2:
    REP-0619: You cannot run without a layout.
    Should i use only 1 return statement?
    Can i use as many return statements as i want?
    What is the exact mistake? Please let me know.
    Thank You.

    Let me clear you the first thing...
    If you get any fatal errors while running the report (e.g., function returned without value,no value etc.,) the report will show
    REP-0619: You cannot run without a layout.
    So you just correct the function 'no_daysformula' .
    First of all you run the report without that formula column.
    If it works fine then , Check the return value of your formula column (Your formula column properties --> Return value --> value (It will be DATE as i think so).
    As function will always return a single value, Check your formula 'no_daysformula' returns the same.
    declare a return variable say for example..
    DECLARE
    V_DATE DATE;
    BEGIN
    --YOUR CODE---
    RETURN V_DATE := (RETURN VALUE)
    END;
    Last but not least ... use Else condition to return (NULL or any value ) in your code and check..
    If any Problem persists let me know
    Regards,
    Soofi.

  • PL/SQL: Function returned without value in authentication schemes

    Hi all,
    finally i did the authentication shemes based on my function and my own table ,thank you all for help :-) ,but now when i enter
    1-correct user name &wrong password <it is gonna work,the authentication workin fine >
    i am gonna get <Invalid Login Credentials> which is right in case of wrong login
    2-wrong user name &wrong password <it is not gonna work>
    3-wrong user name &correct password <it not gonna work>
    in case of not working i am getting the following error:
    ORA-06503: PL/SQL: Function returned without value
    Error ERR-10460 Unable to run authentication credential check function.
    any help to solve this issue so that it will display <Invalid Login Credentials>
    in all cases of invalid login
    thanks in advance ,
    Ahmed,

    scott,you efforts was useful and i beleive that the error that i am getting it is from the function that i have can you please take a look on :
    FUNCTION CHECK_USER
    ( P_USERNAME IN varchar2,
    P_PASSWORD IN varchar2)
    RETURN boolean
    IS
    BEGIN
    for c1 in (select user_name, password from vms2_employee_details where user_name = P_USERNAME)
    loop
    if P_PASSWORD = c1.password then
    return true;
    ------dbms_output.put_line('the return from the function is true');
    else
    return false;
    ----dbms_output.put_line('the return from the function is false');
    end if;
    end loop;
    EXCEPTION
    WHEN no_data_found THEN
    return false;
    when others then
    return false;
    ----dbms_output.put_line('the return from the function is false');
    END;
    and tell me what do you think ,
    thanks,
    ahmed

  • ORA-06503: Function returned without value at WWV_FLOW_WEBSERVICES_API

    Hi, I use APEX_WEB_SERVICE.MAKE_REQUEST function to call web service however stuck with ORA-06503 exception. It would be nice to hear comment from someone who knows APEX_WEB_SERVICE from inside.
    ORA-06503: PL/SQL: Function returned without value
    ORA-06512: at "APEX_040000.WWV_FLOW_WEBSERVICES_API", line 125
    ORA-06512: at "NEC_VLD.NEC_DVS_WS", line 77
    The error occurs about 60% of my test case calls and always with the same parameter values. I thought something bad on web service side however I've tested it with the same parameter values on SoapUI tool and it works just fine. The parameter itself is fixed length varchar2 variable (e.g. 636BB6EFF19941420F00010000007B00000000000000).
    My environments
    APEX
    4.0.1 - no luck
    upgrade to 4.0.2 - no luck
    plain 4.0.2 install - no luck
    Databases
    10.0.2
    11.0.2
    Procedure to call web service:
    procedure getDocumentByID(
    p_xhdoc in varchar2) is
    l_envelope clob;
    l_resp_msg XMLType;
    begin
    l_envelope := '<?xml version="1.0" encoding="UTF-8"?>';
    l_envelope := l_envelope||'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sap="http://saperion.dvs.affecto.lt/">
    <soapenv:Header/>
    <soapenv:Body>
    <sap:getDocumentByID>
    <id>'||p_xhdoc||'</id>
    </sap:getDocumentByID>
    </soapenv:Body>
    </soapenv:Envelope>';
    l_resp_msg := apex_web_service.make_request(
    p_url => get_ref_value('DVS_DOC_WS_URL'),
    p_action => get_ref_value('DVS_DOC_WS_ACTION'),
    p_envelope => l_envelope,
    p_username => null,
    p_password => null);
    end;
    Regards,
    Tomas

    Never mind sorry! I've just tried granting APEX_040000 permissions for this particular Network ACL and now it works! Can I suggest that apex_web_service.make_request needs some better error handling however.
    Here's the fix...
    BEGIN
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(
          acl       => 'mywebservice.xml'
        , principal => 'APEX_040000'
        , is_grant  => TRUE
        , privilege => 'connect'
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(
          acl       => 'mywebservice.xml'
        , principal => 'APEX_040000'
        , is_grant  => TRUE
        , privilege => 'resolve'
      COMMIT;
    END;

  • ORA-06503 Function returned without value

    Hi All,
    I'm getting ORA-06503: PL/SQL: Function returned without value error on this function..... can u guide me where Im going wrong?
    Cheers!
    I
    FUNCTION XX(P_Trial_No IN PATIENT_VISITS.TRIAL_NO%TYPE,
    P_PATIENT_VISIT_NO IN PATIENT_VISITS.PATIENT_VISIT_NO%TYPE) RETURN NUMBER IS
    L_Sequence_No Patient_Visit_Designs.Sequence_No%TYPE;
    BEGIN
    -- Retrieves and returns sequence Number from patient visit designs
    IF p_patient_visit_no IS NOT NULL THEN
    SELECT Sequence_No
    INTO L_Sequence_No
    FROM Patient_Visit_Designs pvd
    WHERE pvd.Trial_No = P_Trial_No AND
    pvd.Patient_Visit_No = P_Patient_Visit_No;
    RETURN L_Sequence_No;
    ELSE
    RETURN NULL;
    END IF;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    END XX;

    CREATE OR REPLACE FUNCTION xx (
       p_trial_no           IN   patient_visits.trial_no%TYPE,
       p_patient_visit_no   IN   patient_visits.patient_visit_no%TYPE
       RETURN NUMBER
    IS
       l_sequence_no   patient_visit_designs.sequence_no%TYPE;
    BEGIN
       l_sequence_no := NULL;
    -- Retrieves and returns sequence Number from patient visit designs
       BEGIN
          IF p_patient_visit_no IS NOT NULL
          THEN
             SELECT sequence_no
               INTO l_sequence_no
               FROM patient_visit_designs pvd
              WHERE pvd.trial_no = p_trial_no
                AND pvd.patient_visit_no = p_patient_visit_no;
          END IF;
       EXCEPTION
          WHEN NO_DATA_FOUND
          THEN
             l_sequence_no := NULL;
       END;
       RETURN l_sequence_no;
    END xx;

  • Problem with Function returned without value  -

    all i am having a problem w/ jdev passing the values. when hardcoded it works. when i remove to pass the 2 vals for doc_type and doc_num the params are being passed to the impl but the String sql = " BEGIN :5 := scotts_test_proc.get_log(:1, :2, :3, :4 ); END; "; is not sending the values to the pkg. to verify i am getting data i created a table to store the data being passed/retrieved by function. i am getting the log_pieces posted when hard coded so i know that works. but when i try to pass the doc_type and doc_num it errors w/ function returend without value . am i passing the params correctly from co to impl to func to get the return l0g_piece. thats for the help
    calling package
    spec
    function Get_Log( -- rmode IN NUMBER , rmode IN STRING, doc_type IN VARCHAR2 DEFAULT 'TEL',
    doc_id IN VARCHAR2 DEFAULT NULL , doc_num IN VARCHAR2 DEFAULT NULL
    -- , p_out out varchar2
    ) -- IS --proc
    RETURN varchar2 IS --function
    body
    l_doc_type := 'TEL';- remove this hardcoded
    l_doc_type := doc_type ; --to pass the param
    IF l_doc_type = 'TEL' THEN
    -- l_log_pieces := Get_TEL(TRIM(3524204)); --change 3524204 to doc_num                hardcoded presently
    l_log_pieces := Get_TEL(TRIM(doc_num)); --to pass the param  
    -- (doc_num);
    l_log_piece := l_log_pieces(1);
    -- p_out := l_log_piece ;
    insert into isitthere (doc_type, doc_num, isitthere) VALUES (doc_type, doc_num, l_log_piece); commit;
    return l_log_piece; -- function -- return p_out; -- function p_out :=  l_log_piece ;  proc
    END IF; --if doc type is TEL
    FROM CO
    System.out.println("CO Passing paramDOC_TYPE for -------> " +docAbbr.getValue(pageContext)      );    --   passing TEL
    System.out.println("CO Passing paramDOC_NUM for -------> " + paramDOC_NUM ); -- passing 88
    String getDocAbbrForHTML = docAbbr.getText(pageContext);
    System.out.println("Passing CO getDocAbbrForHTML for -------> " + getDocAbbrForHTML ); -- passing TEL
    Serializable paramDocLocatorParamList [] = {paramRMODE, getDocAbbrForHTML , paramDOC_ID, paramDOC_NUM , p_out };
    OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
    OADBTransaction dbtrans;
    OAViewObject docLocator = (OAViewObject)am.findViewObject("DocLocatorVO1");
    Serializable paramABC = "TELNET";
    paramABC = am.invokeMethod("getHTMLString", paramDocLocatorParamList);
    rtxt0.setValue(pageContext, "here it is 12354" + paramABC.toString() );
    // docLocator.executeQuery();
    // --------------- End getHTMLString ----------------- //
    FROM AM IMPL
    public String getHTMLString ( String paramRMODE, String getDocAbbrForHTML , String paramDOC_ID, String paramDOC_NUM, String p_out )
    System.out.println("Entering The AM Impl");
    System.out.println("Passing getDocAbbrForHTML in IMPL -------> " +getDocAbbrForHTML     );   -- got TEL in param
    System.out.println("Passing paramDOC_NUM in IMPL -------> " + paramDOC_NUM ); -- got 88 in param
    CallableStatement st = null;
    OADBTransaction txn = (OADBTransaction)getDBTransaction();
    Connection conn = txn.getJdbcConnection();
    String sql = " BEGIN :5 := scotts_test_proc.get_log(:1, :2, :3, :4 ); END; ";
    CallableStatement cs = txn.createCallableStatement(sql,1);
    String ErrorExist = "";
    String getHTML = "";
    try
    cs.setString(1, paramRMODE); // cs.setInt(1, paramRMODE.intValue()); // cs.setInt(1,Integer.parseInt(paramRMODE));
    cs.setString(2, getDocAbbrForHTML); //paramDOC_TYPE);
    cs.setString(3, paramDOC_ID);
    cs.setString(4, paramDOC_NUM);
    // cs.setString(5,p_out); // --param   
    /* cs.registerOutParameter(1,Types.CHAR);
    cs.registerOutParameter(2,Types.CHAR);
    cs.registerOutParameter(3,Types.CHAR);
    cs.registerOutParameter(4,Types.CHAR);*/
    cs.registerOutParameter(5,Types.VARCHAR);
    cs.execute();
    getHTML = cs.getString(5 ) ;
    p_out = getHTML;
    //this string is to see my results. only......
    String x ="abc 123";/*"<BR><font face=Verdana ><b>TEL Document Action History <BR><font color=#336699>(3524204    Nosulina, Yelena N     COMPLETE)</b></font></font><br><br><table border=1 width=100% cellspacing=0 cellpadding=2 bordercolor=#EEEEDC> <tr bgcolor=#F7F7E7>"
    + " <td width=11% valign=top align=left><font face=Verdana size=2 color=#336699><b>Action</b></font></td> <td width=17% valign=top align=left ><font face=Verdana size=2 color=#336699><b>Approver UserName</b></font></td> <td width=14% valign=top align=left ><font face=Verdana size=2 color=#336699><b>Date/Time </b></font></td> <td width=56% valign=top align=left ><font face=Verdana size=2 color=#336699><b>Notes</b></font></td> "
    +" </tr> <!-- loop thru this set of rows ---> <tr bgcolor=#FFFFFF> <td width=11% valign=top align=left ><font face=Verdana size=2 > </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2> </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Dec-20-2011 03:01:23 PM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>DOCUMENT CREATED </font></td> </tr> <!-- end loop--> "
    + " <tr bgcolor=#FFFFFF> <td width=11% valign=top align=left ><font face=Verdana size=2 > </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2>McCombs, Tracey L </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Dec-30-2011 01:12:10 PM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>Requestor </font></td> </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> "
    +" <td width=11% valign=top align=left ><font face=Verdana size=2 >WF STARTED </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2>Workflow </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Dec-30-2011 01:12:21 PM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>Workflow Started </font></td> </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> "
    +"<td width=11% valign=top align=left ><font face=Verdana size=2 > </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2>McCombs, Tracey L </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Dec-30-2011 01:12:21 PM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>SUBMIT </font></td> </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> "
    +"<td width=11% valign=top align=left ><font face=Verdana size=2 >NOTIFICATION SENT </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2>Workflow </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Dec-30-2011 01:12:21 PM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>Notification sent to User Approvals Level 1, Org ID: 455 311402400 Med - Infectious Diseases </font></td> "
    +" </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> <td width=11% valign=top align=left ><font face=Verdana size=2 >  </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2>Brownlow, Lana Jill </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Jan-03-2012 08:49:48 AM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>Approved :  </font></td> </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> "
    +" <td width=11% valign=top align=left ><font face=Verdana size=2 >USER APPROVED </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2>Workflow </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Jan-03-2012 08:49:48 AM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>Completed all User Approvals </font></td> </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> "
    + " <td width=11% valign=top align=left ><font face=Verdana size=2 >CENTRAL APPROVED </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2> </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Jan-03-2012 08:49:48 AM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>Completed Central Approval Process  </font></td> </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> "
    +" <td width=11% valign=top align=left ><font face=Verdana size=2 > </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2> </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Jan-03-2012 02:17:07 PM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>DOCUMENT REASON CHANGED TO COMPLETE. DATA LOADED IN BASE TABLES. </font></td> </tr> <!-- end loop--></table>";
    getHTML = x;
    System.out.println("getHTML 1234 is " + getHTML ); -- testing output to get returned
    cs.close();
    catch (SQLException sqle)
    try { cs.close(); }
    catch (Exception e) {}
    throw OAException.wrapperException(sqle);
    return getHTML;

    when return is encountered your function terminates.

  • Function returned without value Error

    create or replace function dssppv.hra_find_short_path (
       p_new_rgmn_grp_gid    in   number
      ,p_tail_rgmn_grp_gid   in   number
      ,p_mkt_cnfgr_gid       in   number
       return string
    is
       v_rgmn_grp_path varchar2 ( 2000 );
       check_step varchar2 ( 2000 );
    begin
       dbms_output.put_line
          ( 'Begin of function  hra_find_short_path to Check Circular Loop : '
            || to_char ( sysdate, 'YYYY-MM-DD HH24:MI:SS' )
       check_step                 := ' Step 1 - Circular loop Check up.';
       --Checking for the circular loop
       select rgmn_path || '/' || gt.rgmn_grp_nam
       into   v_rgmn_grp_path
       from   ( select  min_rgmn_node
                       ,rgmn_path
                       ,rgmn_grp_gid
               from     ( select    level as min_rgmn_node
                                   ,dt.rgmn_grp_gid
                                   ,dt.tail_rgmn_grp_gid
                                   ,gp.rgmn_grp_nam
                                   ,rtrim
                                       ( reverse
                                            ( sys_connect_by_path
                                                      ( reverse ( gp.rgmn_grp_nam )
                                       ) as rgmn_path
                         from       dssppv.t_market_cnfgr_rgmn_grp_dtl dt join dssppv.t_market_cnfgr_rgmn_grp gp
                                    on (     dt.rgmn_grp_gid = gp.rgmn_grp_gid
                                         and gp.mkt_cnfgr_gid = p_mkt_cnfgr_gid
                         start with dt.tail_rgmn_grp_gid = p_new_rgmn_grp_gid
                         connect by nocycle prior dt.rgmn_grp_gid =
                                                              dt.tail_rgmn_grp_gid )
               where    rgmn_grp_gid = p_tail_rgmn_grp_gid
               order by min_rgmn_node )
             ,dssppv.t_market_cnfgr_rgmn_grp gt
       where  gt.rgmn_grp_gid = p_new_rgmn_grp_gid and rownum = 1;
       dbms_output.put_line ( ' Circular Loop is formed as shown :'
                              || v_rgmn_grp_path
       if ( v_rgmn_grp_path is not null )
       then
          dbms_output.put_line ( ' Circular Loop is formed as shown :'
                                 || v_rgmn_grp_path
       else
          dbms_output.put_line ( ' No Loop is formed.' );
       end if;
       dbms_output.put_line
             ( 'End of function  hra_find_short_path to Check Circular Loop : '
               || to_char ( sysdate, 'YYYY-MM-DD HH24:MI:SS' )
       return v_rgmn_grp_path;
    exception
    --  when no_data_found
      -- then
       --   dbms_output.put_line
        --     ( 'End  of function  hra_find_short_path to Check Circular Loop : '
         --      || to_char ( sysdate, 'YYYY-MM-DD HH24:MI:SS' )
          --return null;
       when others
       then
          dbms_output.put_line
                         ( 'Error in function DSSPPV.hra_find_short_path at: '
                           || check_step
          dbms_output.put_line ( sqlerrm );
          dbms_output.put_line
             ( 'End of function  hra_find_rgmn_grp_loops to Check Circular Loop : '
               || to_char ( sysdate, 'YYYY-MM-DD HH24:MI:SS' )
    end hra_find_short_path;
    /I purpose fully commented No Data Found Exception top check whether it was returning null when no record is found.
    But it was going into no data found exception when there is no record.
    But when execute sql separately it was showing zero records without raising the no data found error.
    it was not even going through the if loop .... Please Correct me if i did something wrong
    if ( v_rgmn_grp_path is not null )
       then
          dbms_output.put_line ( ' Circular Loop is formed as shown :'
                                 || v_rgmn_grp_path
       else
          dbms_output.put_line ( ' No Loop is formed.' );
       end if;

    Hi,
    Rede wrote:
    Frank,
    I am expecting that when no row is returned
    select rgmn_path || '/' || gt.rgmn_grp_nam
    into   v_rgmn_grp_path
    Null will be selected into v_rgmn_grp_path  unless there is an exception
    A SELECT INTO query must return exactly one row. If no rows satisfy the WHERE clause, then no rows are returned, and a NO_DATA_FOUND error is raised.
    One way to get around this is to do an aggregate query. If you use an aggregate function (like MIN) but no GROUP BY clause, then exactly one row will always be returned, even if the table has no rows, or no rows satisfy the WHERE clause. (You've probably used this feature before, saying "SELECT COUNT(*) FROM table_x;" and getting one row, containing 0, in the result set.)
    Try something like this
    select MIN (rgmn_path || '/' || gt.rgmn_grp_nam)
       into   v_rgmn_grp_path
       from   ( select  min_rgmn_node
            ,dssppv.t_market_cnfgr_rgmn_grp gt
    where  gt.rgmn_grp_gid = p_new_rgmn_grp_gid;Edited by: Frank Kulash on Jun 2, 2010 4:02 PM

  • Report- Pl/sql function returning sql query parsing page items as text?

    Hi Team,
    I am facing a strange issue .
    I have four page items namely
    1)JOB_CODE
    2)MIN_EXP
    3) MAX_EXP
    4) SOURCES1
    I have a report of the type "Pl/sql function returning sql query"
    declare
    v_sql varchar2(4000);
    begin
    if (:JOB_CODE IS NOT NULL and :MIN_EXP IS NOT NULL and :MAX_EXP IS NOT NULL and :SOURCES1 IS NOT NULL) then
    v_sql:= 'select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where V_REQUIREMENT = :JOB_CODE and v_experience_years >= :MIN_EXP and v_experience_years <= :MAX_EXP and source like ' || '''' || '%'|| ':SOURCES1' || '%' || '''';
    elsif (:JOB_CODE IS NULL and :MIN_EXP IS NOT NULL and :MAX_EXP IS NOT NULL and :SOURCES1 IS NOT NULL) then
    v_sql := 'select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where v_experience_years >= :MIN_EXP and v_experience_years <= :MAX_EXP and source like ' || '''' || '%'|| ':SOURCES1' || '%' || '''';
    elsif (:MIN_EXP IS NULL and :JOB_CODE IS NOT NULL and :MAX_EXP IS NOT NULL and :SOURCES1 IS NOT NULL) then
    v_sql := 'select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where v_experience_years <= :MAX_EXP and V_REQUIREMENT = :JOB_CODE and source like ' || '''' || '%'|| ':SOURCES1' || '%' || '''';
    elsif (:MAX_EXP is null and :JOB_CODE IS NOT NULL and :MIN_EXP IS NOT NULL and :SOURCES1 IS NOT NULL) then
    v_sql := 'select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where V_REQUIREMENT = :JOB_CODE and v_experience_years >= :MIN_EXP and source like ' || '''' || '%'|| ':SOURCES1' || '%' || '''';
    end if;
    insert into query_list values (v_sql);
    insert into debug values (:JOB_CODE , :MIN_EXP , :MAX_EXP , :SOURCES1);
    return v_sql;
    end;
    Please not that I am insertin the query into a table called Query_list and the page item values into the table called Debug thru the pl/sql function which returns teh query.
    Now I select the data from the debug tables.
    select unique(query) from query_list;
    select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where V_REQUIREMENT = :JOB_CODE and v_experience_years >= :MIN_EXP and v_experience_years <= :MAX_EXP and source like '%:SOURCES1%'
    select * from debug;
    JOBCODE     MINEX     MAXEX     SOURCE
    21     1     10     donkeyHire
    And if I run the query in sql I get some records returned
    select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where V_REQUIREMENT = 21 and v_experience_years >= 1 and v_experience_years <= and source like 'donkeyHire'
    V_CANDIDATE_ID     V_FNAME     V_CURRENT_EMPLOYER     V_EXPERIENCE_YEARS
    2     Vengu     Andale Tech     4
    But the record does not show up in the report!
    does this type of report parse page items as text?
    Why is it so?
    Waiting for an early reply.
    Thanks,
    venkat

    Venkat - You don't want to put ':SOURCES1' in quotes like that.
    Scott

  • Issue with running PL/SQL function returning Sql query

    hi, I am trying to create a report region by using the option of PL/SQL function returning sql query.
    I notice that it's very slow for the report region page to show up. In my PL/SQL function body, there are only 3 steps, first update all the 10 rows of varchar2 fields to null,then insert values to those fields, then select all from the table to show report results. It takes more than 5 minitues for the page to load up, how ever, if i run those steps in SQL*Plus, it only takes a couple of seconds to finish. Any suggestions?
    Thanks,
    gina

    Sergio, the codes are as followed,
    Declare
    q varchar2(32767); -- query
    Begin
    q := 'select "ID",'||
    '"ENTRY NAME","TOTAL","#CM","%CM","#CA",'||
    '"%CA", from Info_table';
    update info_table
    set "TOTAL" = '',
    "#CM" = '',
    "%CM" = '',
    "#CA" ='',
    "%CA"=''
    where "ID"<=10;
    // set all data in column Total to null,there is only 10 rows in the table
    update info_Table set Total = vTotal,
    "#CM" = vCM
    (those variables hold user key-in Text filed value)
    where ID = 1;
    return q;
    End;

  • On Submit process not firing -report (PL/SQL function returning SQL query)

    Can anyone suggest possible causes / solutions for the following problem?
    I have a report region that uses a PL/SQL function returning SQL query. The report allows the user to update multiple fields / rows and then click a button to submit the page which should run the On-Submit process to update the database. However the process does not run and I get a 'HTTP404 page cannot be found' error; and when I navigate back using the Back button I cannot then navigate to any other page in my application without getting the same error. The button was created by a wizard selecting the options to submit the page and redirect to a (same) page. The button does not actually have a redirect in its definition but the wizard created a branch to the same page which should work and the button has the text 'submit as SUBMIT' next to it so it appears to be set up correctly.
    I have recreated this page several times in my application and I cannot get the On-Submit process to run. However I have created a cut down version of the same page in the sample application on apex.oracle.com at http://apex.oracle.com/pls/otn/f?p=4550:1:179951678764332 and this works perfectly so I am at a loss to understand why it does not work in my application. I cannot post any part of the application itself but if anybody would like to check out page 30 of the sample application (Customer Update Test tab) updating the surnames only, using credentials ja, demo, demo this is pretty much what I have got in my application.
    Any ideas would be much appreciated?

    Thanks for the suggestions guys. I have now identified that the problem goes away when I remove the second table from my report query. The original report query retrieved data from two tables and the process was updating only one of the tables. I thought I had approached the task logically i.e. first get the report to display the records from the two tables, then get the process to update the first table and finally to modify the process further to update the second table.
    Can anyone point me to an example of multiple row updates on multiple tables using a PL/SQL function returning an SQL query?

  • Column order in SQL Query (PL/SQL function returning a query)

    Hi,
    when I define a PL/SQL function returning a query inside a region, I often find that the column order is arbitrarily changed.
    How do I enforce the column order ?
    Bye,
    Flavio

    I removed the 11th column called service_name from this dynamic query: and now the report says: report error:
    ORA-01403: no data found. I messed around with the Headiuns Type. It was set to Custom. I changed it to Column Names. There is no difference.
    I am not sure how to fix?
    declare topqry varchar2(32000);
    whereqry varchar2(32000);
    finalqry varchar2(32000);
    var_status varchar2(100);
    division_status varchar2(50);
    office_status varchar2(1000);
    user_status varchar2(1000);
    overdue_status varchar2(1000);
    begin
    if :P10_FALLBACK = 'All' then
    var_status:= ' and vp.status in (''FA'',''FBA'',''FBI'',''25%'',''50%'',''90%'',''Closed'') ';
    elsif :P10_FALLBACK = 'Active' then
    var_status:= ' and vp.status in (''FA'',''25%'',''50%'',''90%'',''FBA'') ';
    elsif :P10_FALLBACK = 'FB' then
    var_status:= ' and vp.status in (''FBA'',''FBI'') ';
    elsif :P10_FALLBACK = 'Closed' then
    var_status:= ' and vp.status in (''Closed'') ';
    elsif :P10_FALLBACK = 'Inactive' then
    var_status:= ' and vp.status in (''FBI'') ';
    end if;
    if :P10_DIVISION = 'All' then
    division_status:= ' and vp.vms_division in (''News'',''Ad Services'') ';
    elsif :P10_DIVISION = 'News' then
    division_status:= ' and vp.vms_division in (''News'') ';
    elsif :P10_DIVISION = 'Ad' then
    division_status:= ' and vp.vms_division in (''Ad Services'') ';
    end if;
    if :P10_OFFICE = '%' then
    office_status:= ' and OFFICE_ID in (select office
    from VMS_OFFICE_ACCESS
    where user_id = lower(:P0_user) ) ';
    else
    office_status:= ' and OFFICE_ID in :P10_OFFICE ';
    end if;
    if :P10_LIMIT_USER = '%' then
    user_status := ' and SALESPERSON in (select first_name || '' '' || last_name
    from VMS_PROSPECT_users u
    join vms_office_access o
    on u.office_id = OFFICE
    where o.user_id = lower(:P0_USER) ) ';
    else
    user_status:= ' and SALESPERSON in (:P10_LIMIT_USER ) ';
    end if;
    if :P10_SHOW_OVERDUE = 'Show' then
    overdue_status:= ' and target_close_date <= sysdate ';
    var_status:= ' and vp.status in (''25%'',''50%'',''90%'',''FBA'') ';
    else
    overdue_status:= ' and FIRST_APPOINTMENT between
    nvl(to_date(:P10_FIRST_APPT_START, ''mm/dd/yyyy''),FIRST_APPOINTMENT) and
    nvl(to_date(:P10_FIRST_APPT_END,''mm/dd/yyyy''),FIRST_APPOINTMENT) ';
    end if;
    topqry := 'SELECT OFFICE_ID ,vp.PROSPECT_ID ,ENTRY_DATE ,ACCOUNT , NEXT_CONTACT_DATE ,ACTION_STEP ,
    TARGET_CLOSE_DATE ,vp.STATUS ,SALESPERSON ,vp.SALES_TYPE ,service_name , FIRST_APPOINTMENT ,MODIFY_DATE ,EST_ANNUAL_REVENUE ,EST_INCREMENTAL_REVENUE ,
    pi.NOTES , pi.SALES_TYPE ,pi.STATUS ,Contact ,Origin_Source FROM VMS_PROSPECTING_ITEMS pi right outer join VMS_PROSPECTS vp on vp.PROSPECT_ID = pi.PROSPECT_ID left outer join VMS_SERVICES vs on vs.service_ID = pi.service_ID where 1 = 1 ';
    whereqry := ' and (not exists (select *
    from VMS_PROSPECTING_ITEMS i3
    where vp.prospect_id = i3.prospect_id)
    or exists (select *
    from VMS_PROSPECTING_ITEMS i2
    where i2.order_id = pi.order_id
    and active = ''Y'' )) and instr(upper(ACCOUNT),upper(nvl(:P10_ACCOUNT,ACCOUNT))) > 0 ';
    whereqry := whereqry || var_status || division_status || office_status || user_status || overdue_status;
    finalqry := topqry || whereqry;
    return finalqry ;
    end;

  • How to call pl/sql function from element values

    EBS 11.5.10.2
    XMLP 5.6.3
    Hello,
    I noticed that the output of the rdf-to-data template conversion process makes use of an undocumented feature of data templates, and I would like to get input from experts as to which situations this feature is usable.
    The closest thing I can find in the documentation is a sample in the user guide. There is a "General Ledger Journals Data Template Example" that has a <dataStructure> section that contains <element> nodes which are NOT children of a <group> node. I can't find any explanation of this in the user guide.
    I've noticed from converted templates that in these un-grouped elements you can make calls to PL/SQL functions in the "value" attribute, like this:
    <dataStructure>
      <group name="G_LINES" source="Q_MAIN">
        <element name="Line_Num"           value="Line_Num"/>
      </group>
      <element name="C_CALCULATED_VALUE" dataType="number" value="XX_CUSTOMPROCS.SOME_FUNCTION"/>
    </dataStructure>Has anyone had any success being able to call PL/SQL functions from grouped elements? Whenever I try, it doesn't seem to work.
    When I try something like this:
    <dataStructure>
      <group name="G_LINES" source="Q_MAIN">
        <element name="Line_Num"           value="Line_Num"/>
        <element name="some_calculation"   value="XX_CUSTOMPROCS.SOME_FUNCTION"/>
        <element name="some_calculation_b" value="XX_CUSTOMPROCS.SOME_FUNCTION_B(:Line_Num)"/>
      </group>
      <element name="C_CALCULATED_VALUE" dataType="number" value="XX_CUSTOMPROCS.SOME_FUNCTION"/>
    </dataStructure>The <SOME_CALCULATION/> and <SOME_CALCULATION_B/> nodes come out empty in the output data xml file, but <C_CALCULATED_VALUE> would have a value as desired.

    ah - perfect. That makes sense. Thank you for the response!
    But what about when we need to pass parameters to those functions whos values are the results of aggregate element values?
    This happens a lot in the converted data templates, where pl/sql package functions are meant to replace formula columns from the original Oracle Report. Take this example from the conversion of ARXAGMW.rdf (Aging Report, 7 Buckets):
    (note the function call in the value of "Set_Percent_Inv_Inv" is using aggregate results from subgroups)
      <group name="G_INV_INV" dataType="varchar2" source="Q_Invoice">
        <element name="Total_Inv_Inv_Amt" function="sum" dataType="number" value="G_Invoice.C_Amt_Due_Rem_Inv"/>
        <element name="Total_Inv_Inv_B0" function="sum" dataType="number" value="G_Invoice.C_Inv_B0"/>
        <element name="Total_Inv_Inv_B1" function="sum" dataType="number" value="G_Invoice.C_Inv_B1"/>
        <element name="Total_Inv_Inv_B2" function="sum" dataType="number" value="G_Invoice.C_Inv_B2"/>
        <element name="Total_Inv_Inv_B3" function="sum" dataType="number" value="G_Invoice.C_Inv_B3"/>
        <element name="Total_Inv_Inv_B4" function="sum" dataType="number" value="G_Invoice.C_Inv_B4"/>
        <element name="Total_Inv_Inv_B5" function="sum" dataType="number" value="G_Invoice.C_Inv_B5"/>
        <element name="Total_Inv_Inv_B6" function="sum" dataType="number" value="G_Invoice.C_Inv_B6"/>
        <element name="Set_Percent_Inv_Inv"  dataType="number"  value="XX_CUSTOMPROCS.XXC_ARXAGMW.set_percent_inv_invformula(:Total_Inv_Inv_Amt, :Total_Inv_Inv_B0, :Total_Inv_Inv_B1, :Total_Inv_Inv_B2, :Total_Inv_Inv_B3, :Total_Inv_Inv_B4, :Total_Inv_Inv_B5, :Total_Inv_Inv_B6)"/>
        <element name="Sum_Percent_B0_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B0_Inv_p"/>
        <element name="Sum_Percent_B1_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B1_Inv_p"/>
        <element name="Sum_Percent_B2_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B2_Inv_p"/>
        <element name="Sum_Percent_B3_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B3_Inv_p"/>
        <element name="Sum_Percent_B4_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B4_Inv_p"/>
        <element name="Sum_Percent_B5_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B5_Inv_p"/>
        <element name="Sum_Percent_B6_Inv" dataType="number" value="XX_CUSTOMPROCS.XXC_ARXAGMW.Sum_Percent_B6_Inv_p"/>
        <group name="G_Cust_Inv" dataType="varchar2" source="Q_Invoice">
          <group name="G_Site_Inv" dataType="varchar2" source="Q_Invoice">
            <group name="G_1" dataType="varchar2" source="Q_Invoice">
              <group name="G_Invoice" dataType="varchar2" source="Q_Invoice">
                <element name="C_Amt_Due_Rem_Inv" dataType="number" value="C_Amt_Due_Rem_Inv"/>
                <element name="C_Inv_B0" dataType="number" value="C_Inv_B0"/>
                <element name="C_Inv_B1" dataType="number" value="C_Inv_B1"/>
                <element name="C_Inv_B2" dataType="number" value="C_Inv_B2"/>
                <element name="C_Inv_B3" dataType="number" value="C_Inv_B3"/>
                <element name="C_Inv_B4" dataType="number" value="C_Inv_B4"/>
                <element name="C_Inv_B5" dataType="number" value="C_Inv_B5"/>
                <element name="C_Inv_B6" dataType="number" value="C_Inv_B6"/>
              </group>
            </group>
          </group>
        </group>
      </group>
      ...All of these groups and sub-groups are based on one single query, so I am not sure how I would move the function call into the query without changing the results of the function.
    In the example above, elements Sum_Percent_B0_Inv through Sum_Percent_B6_Inv grab the results of the calculation done in set_percent_inv_invformula. Here is the essence of that function:
      sum_percent_b0_inv := ROUND ((total_inv_inv_b0 / total_inv_inv_amt) * 100, 2);
      sum_percent_b1_inv := ROUND ((total_inv_inv_b1 / total_inv_inv_amt) * 100, 2);
      sum_percent_b2_inv := ROUND ((total_inv_inv_b2 / total_inv_inv_amt) * 100, 2);
      sum_percent_b3_inv := ROUND ((total_inv_inv_b3 / total_inv_inv_amt) * 100, 2);
      sum_percent_b4_inv := ROUND ((total_inv_inv_b4 / total_inv_inv_amt) * 100, 2);
      sum_percent_b5_inv := ROUND ((total_inv_inv_b5 / total_inv_inv_amt) * 100, 2);
      sum_percent_b6_inv := ROUND ((total_inv_inv_b6 / total_inv_inv_amt) * 100, 2);The only solution I can think of is to have separate queries, one for each subgroup, that do the "sum" in sql; but that seems terribly inefficient.

  • REP-2103: PL/SQL formula returned invalid value or no value

    Hi all,
    Before clone the report GEPS FA Prepare Mass Addition Report runs fine. But after cloned from production, it shows error:
    Enter Password:
    REP-0004: Warning: Unable to open user preference file.
    REP-2103: Column 'G_MASS_ADDITION_INVOICE' : PL/SQL formula returned invalid value or no value.
    REP-0069: Internal error
    REP-57054: In-process job terminated:Terminated with error:
    REP-2103: Column 'G_MASS_ADDITION_INVOICE' : PL/SQL formula returned invalid value or no value.
    Actually I didn't have such column 'G_MASS_ADDITION_INVOICE'. This is a group name. I tried a lot, such as widden the formula column width or delete the formula column, but it still show this error. I didn't have any trigger or other formula column. Even I create a new report use the same name with a single query( select sysdate from dual), but it still shows the same error.
    Is there anyone faced this issue before or can help me ? Thanks
    ares
    Edited by: 930967 on Jun 13, 2012 12:46 AM

    Hi;
    Please see:R12 GL Account Balances Across Ledgers (GLRGCBGT) Report Errors With: REP-0004 MSG-00025 MSG-00104 MSG-01221 REP-2103 REP-0069 REP-57054, Program Exited With Status 1 [ID 1316929.1]
    Regard
    Helios

  • SQL Query(PL/SQL Function Returning SQL Query)

    I am trying to write a dynamic report using SQL Query(PL/SQL Function Returning SQL Query).
    I can get the report to run but I need to concatinate some columns into one, seperated by a comma or a dash.
    I have tried select *****||','||***** alias
    also select *****||'-'||***** alias
    but I always get an error.
    Is there a way of doing this please
    Gus

    This is my full query
    declare
    v_query varchar2(4000);
    begin
    if :P63_TRAN_INFO = 2 THEN
    v_query := 'select
         A.FILENR,
         A.EXERCISENAME,
    A.STARTDATE,
    A.ENDDATE,
         A.UNIT,
    A.ACCADDRESSES, B.ADDRESS, B.ADDRESS_1, B.POST_CODE, B.TOWN,
         A.EXERCISEAREAS,
         A.TOTALVEHICLES,
    A.TOTALTROOPS+A.RNTOTALTROOPS+A.RAFTOTALTROOPS TOTALTROOPS,
    A.CAR, A.MINIBUS, A.HGV,
    A.NAMERANK, A.ADDRESS, A.ADDRESSI, A.ADDRESSII, A.POSTCODE,
    A.TRANSIT,
    A.INFOONLY
    from     BFLOG_AT A, BFLOG_ACCADDRESS B
    WHERE A.ACCADDRESSES = B.NAME
    AND A.STARTDATE >= :P63_START_DATE
    AND A.ENDDATE <= :P63_END_DATE
    AND A.AUTHORISED = 1
    AND A.INFOONLY = 1' ;
    END IF;
    RETURN v_query;
    END;
    This query runs ok, but if I try changing it to the code below with fields concatinated, then it fails
    declare
    v_query varchar2(4000);
    begin
    if :P63_TRAN_INFO = 2 THEN
    v_query := 'select
         A.FILENR,
         A.EXERCISENAME,
    A.STARTDATE,
    A.ENDDATE,
         A.UNIT,
    A.ACCADDRESSES||','||B.ADDRESS||','||B.ADDRESS_1||','||B.POST_CODE||','||B.TOWN ADDRESS,
         A.EXERCISEAREAS,
         A.TOTALVEHICLES,
    A.TOTALTROOPS+A.RNTOTALTROOPS+A.RAFTOTALTROOPS TOTALTROOPS,
    A.CAR, A.MINIBUS, A.HGV,
    A.NAMERANK, A.ADDRESS, A.ADDRESSI, A.ADDRESSII, A.POSTCODE,
    A.TRANSIT,
    A.INFOONLY
    from     BFLOG_AT A, BFLOG_ACCADDRESS B
    WHERE A.ACCADDRESSES = B.NAME
    AND A.STARTDATE >= :P63_START_DATE
    AND A.ENDDATE <= :P63_END_DATE
    --AND (A.EXERCISEAREAS LIKE "GAP, OA, OAL")
    --OR (A.EXERCISEAREAS LIKE "Harz")
    AND A.AUTHORISED = 1
    AND A.INFOONLY = 1' ;
    END IF;
    RETURN v_query;
    END;
    Cheers
    Gus

  • PL/SQL function returning a SQL Query

    Is this only availabe in HTML db or in 10g in general? Where do I find more about this feature?
    Thanks in advance,
    Denes

    Not sure what you mean. HTML DB allows to use a PL/SQL function returning a valid SQL query in report regions.
    Its just a PL/SQL function returning a string, outside of HTML DB, I guess you can use it wherever it makes sense.

Maybe you are looking for

  • 1-Click Weather worked when I upgraded to Firefox 4 and now it's suddenly uncompatible.

    I upgraded to Firefox 4 two days ago. I've used the 1-Click Weather extension for years and it worked fine with Firefox 4 up until about 10:00 this morning. Then it disappeared from my toolbar and, when I went to the addon manager I was told that it'

  • Jumping Display T500 Switchable Graphics

    Hi guys So my dear T500 that has servered me so well over the past 4 years all of a sudden developed the weirdest graphics glitches that were definitely hardware related, as they happened even in the BIOS screen. So I had the mainboard changed and al

  • How well does the iPhone 5s/5c work with Wind Mobile?

    I'm going to be (hopefully) getting the iphone 5s or 5c soon and I'm trying to decide on which carrier to go with. How well does the iphone 5s/5c work with wind mobile and how fast is the internet with data?

  • Play AC3 5.1 Sound with a 7.1 system on all speak

    I have a 7. soundcard (Creative Labs Audigy 2 ZS) and a 7. speaker system (Creative Labs Gigaworks S750). Because todays movies have only 5. sound (no 7.), not all speakers are used. In the settings of my soundcard-software (AC3 settings), I can conf

  • The question mark shows up as É

    I have gone to view then character encoding and selected the option Unicode (UTF-8). Not only my question mark is affected, but some of the other punctuation as well, such as the quotation marks, brackets, and greater than and less than symbols. very