PL/SQL V() function returns null

Hello

I just updated one of my instance of APEX of 3.0 to 3.2.1 version. After update I can't read session values using the function v (VARIABLE_NAME) of pl/sql. Always returns null (I tried v('session'), v ('app_id'), v ('app_user')).

: Reference VARIABLE works fine, but I can't use it in my own packages.

No idea how to solve this problem?

Kind regards
Przemek

Hello

Are you by chance using old drop-in replacement for Patrick Wolf for the function of V?

http://www.inside-Oracle-apex.com/attention-are-you-using-drop-in-replacement-for-v-and-NV-function-2/

John.
--------------------------------------------
Blog: http://jes.blogs.shellprompt.net
Work: http://www.sumneva.com (formerly http://www.apex-evangelists.com)
Author of Pro Application Express: http://tinyurl.com/3gu7cd
AWARDS: Don't forget to mark correct or useful posts on the forum, not only for my answers, but for everyone!

Tags: Database

Similar Questions

  • Capture of high speed using flex functions returns null vector

    Hello

    We have a controller 7350 and UMI-7774 drive a motor step by step through P70530 pilot. We use a single axis, axis 1, which is configured as a stepper motor with your comments and 10000 steps/rev. Our engine performs a profile displacement and during this move, you should read the position of the encoder with about 2000 Hz resolution. I can move the engine using MAX or flex functions, I can also read the encoder using the post MAX, but cannot perform high speed reading.

    Issues related to the:

    1. How can I configure read it for 2000 Hz at high speed?

    Function flex_configure_buffer (boardID, bufferInEnc, axis, NIMC_HS_CAPTURE_READBACK, contMoveBufSize, totalPoints, NIMC_FALSE, requiredInterval, on actualInterval)

    Returns the error-70078 (invalid parameter) when I pass a required interval less than 10ms.

    2. How can I read data from buffer high speed?

    Even when the buffers is configured with the interval of 10 ms, the flex_read_buffer_rtn (boardID, bufferInEnc, rear, out retVector) function returns no data (retVector = null).

    Please find attached an example of solution of vs2008 demonstrating the problem.

    Hello Stephen,

    The problem is now solved, the problem was in the trigger condition.

    It seems that the parameter requiredInterval in the function flex_configure_buffer() function call is ignored, because I get to any interval of 0.5 ms data even if the requiredInterval and the actualInterval are two 10ms.

    Thanks for your help.

  • JDev 11.1.2.1 bc.getCurrentBindingsEntry () returns null.

    I use the code below to the ADF's seafood favorite shuttle component video training that is available on the web:

    public static list < SelectItem > selectItemsForIterator (String iteratorName,
    String valueAttrName,
    String displayAttrName) {}
    BindingContext, bc is BindingContext.getCurrent ();
    Link = DCBindingContainer
    (DCBindingContainer) bc.getCurrentBindingsEntry ();
    DCIteratorBinding iter = binding.findIteratorBinding (iteratorName);
    The list < SelectItem > selectItems = new ArrayList < SelectItem > ();
    {for (line r: {iter.getAllRowsInRange ())}
    selectItems.add (new SelectItem (r.getAttribute (valueAttrName),
    (((String) r.getAttribute (displayAttrName)));
    }
    selectItems return;
    }

    The call to getCurrentBindingsEntry() returns null.

    Can someone tell me what would cause this function returns null?

    Thank you, Steve

    Hi Steve, I don't know if the problem is related to the scope of the bean, because I use the same method in the beans of pageFlowScope without problem. However, I fell right on the same problem you are facing today. The problem in my case, it was the default activity of my BTF was a method call that attempted to call getCurrentBindingsEntry. I changed the default activity at a glance and then called getCurrentBindingsEntry in the constructor of the bean. This solves the problem. If you have a similar situation?

    Dar.K

  • Function - return multiple values in a concatenated string

    Hello

    Is it possible for a function return a concatenated string (combining more than one number). I'm trying to return the purchase by the introduction and invoice_id number and code order number, but an invoice_id can have several PO with the same code number. I want to concatenate the PO numbers with commas, for example

    10124, 10090, 10987

    At the present time, the function returns NULL for those cases that have more than one purchase order number.

    Thank you
    func_get_po(i.invoice_id, cc.code_combination_id) "PO No",
    func_get_po_requester(i.invoice_id, cc.code_combination_id, func_get_po(i.invoice_id, cc.code_combination_id)) "PO Requester",
    

    Of course, this can be done without any problem.
    If it returns NULL, then you must debug function and check the operating logic. I know that it will take a little of your time, but not problems with the logic of syntax and concatenation.

  • ORA-06503: PL/SQL: function returned no value ORA-06512:

    Hi all

    SQL > set serveroutput on

    SQL > CREATE OR replace FUNCTION qty_value (p_item_id number)

    2 RETURN NUMBER

    3 EAST

    4 v_qty_arrival NUMBER;

    5 BEGIN

    6. SELECT THE CASE SENSITIVE OPTION

    7. WHAT (SUM (b.quantity) - SUM (b.quantity_received)) < = 0 THEN 0

    8 ELSE (SUM (b.quantity) - SUM (b.quantity_received))

    9 END Qty_Arrival

    10 INTO v_qty_arrival

    Po_lines_all 11 a,

    po_line_locations_all 12 b

    13 WHERE a.po_line_id = b.po_line_id

    14 AND a.item_id = p_item_id;

    15 EXCEPTION

    16 THEN THAN OTHERS THEN

    17 v_qty_arrival: = NULL;

    18 RETURN v_qty_arrival;

    19 END qty_value;

    20.

    The function is created.

    SQL >

    SQL > select xxc_qty_arrivale (214960) double

    2.

    Select xxc_qty_arrivale (214960) double

    *

    ERROR on line 1:

    ORA-06503: PL/SQL: function returned no value

    ORA-06512: at the 'APPS '. XXC_QTY_ARRIVALE', line 19

    Back AFTER using the exception block is fine as long as your code actually REACHED the exception block.

    When there are no errors, then your code will not enter the exception block, but you still NEED to return a value, since it is what functions a function wants to return a value, that's what the functions are made for.

    Spot the differences between the following 3 functions. Understand how they work.

    The first function has only a return in the exception block but runs correctly. Result: error, because the back is missing in the code block.

    The second function has a return in the exception block and one in the block of code and runs correctly. Result: no error, because the return is not missing in the code block.

    The third function has a return in the exception block and one in the block of code and is forced into an error. Result: no error, because the return of the exception handler is used (instead of retriggering of the error, which you would normally do).

    SQL > create or replace function myfunc

    2 return number

    3 as

    4 start

    5 dbms_output.put_line ('in the section of code');

    6 null;

    7 exception

    8 then than others

    9. can

    10 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

    11      --

    12 return 0;

    13      --

    14 end;

    15.

    The function is created.

    SQL > select double myfunc;

    Select double myfunc

    *

    ERROR on line 1:

    ORA-06503: PL/SQL: function returned no value

    ORA-06512: at "GHPLUS. MYFUNC", line 14

    In the section of code

    SQL > create or replace function myfunc

    2 return number

    3 as

    4 start

    5 dbms_output.put_line ('in the section of code');

    6 null;

    7    --

    8 return 1;

    9    --

    10 exceptional

    11 so that others

    12. can

    13 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

    14      --

    15 return 0;

    16      --

    end 17;

    18.

    The function is created.

    SQL > select double myfunc;

    MYFUNC

    ----------

    1

    1 selected line.

    In the section of code

    SQL > create or replace function myfunc

    2 return number

    3 as

    n number 4;

    5. start

    6 dbms_output.put_line ('in the section of code');

    7 n: = 1/0; -force an error (zero divisor) to join the exception handler

    8    --

    9 return 1;

    10-

    exception 11

    12 so that others

    13. can

    14 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

    15      --

    16 return 0;

    17      --

    18 end;

    19.

    The function is created.

    SQL > select double myfunc;

    MYFUNC

    ----------

    0

    1 selected line.

    In the section of code

    In the handler for exception ORA-01476: divisor is equal to zero

    SQL >

  • % ROWCOUNT SQL return null after Forms_DDL on a dynamic SQL

    Hello

    I'm new to PL/SQL coding and is currently working on the development of some application in Oracle Forms as a result of the 10 g developer.

    I'm having a problem getting a number of lines (number of rows affected by the last command dml) to register after using forms_ddl
    PROCEDURE P_SQL_UPDATE IS
    
      L_string1                VARCHAR2(250);
      L_string2                VARCHAR2(250);
      L_string3                VARCHAR2(250);
      L_string4                VARCHAR2(250);
      L_rowcount                Pls_integer;
      L_count                  NUMBER;
      L_alert                       NUMBER;
    
    BEGIN
    
      L_string1 := 'UPDATE ' || :global.G_table_nam || ' SET ';
      L_string2 := NULL;
      L_string3 := ' WHERE ';
      L_string4 := NULL;
    
    ...
    ... building strings 2 and 3
    ...
    
    :global.final_sql := L_string1 || L_string2 || L_string3 || L_string4;
    
      FORMS_DDL(:global.final_sql);
      L_rowcount := SQL%ROWCOUNT;
    
      if FORM_SUCCESS then
        set_alert_property('ALT_COMMIT_ROLLBACK',ALERT_MESSAGE_TEXT, 'The # of rows affected: ' || L_rowcount || CHR(10) || 'Commit or Rollback?');
        L_alert := show_alert('ALT_COMMIT_ROLLBACK');
        if L_alert = ALERT_BUTTON1 then
          commit;
        else
             rollback;
        end if;
      else
        set_alert_property('ALT_INFO',ALERT_MESSAGE_TEXT, 'Error: ' || DBMS_ERROR_CODE  || ' - ' ||DBMS_ERROR_TEXT);
        L_alert := show_alert('ALT_INFO');
      end if;
       
    END;
    I tried to replace the global variable with a string 1 potential SQL hard coded, I changed L_rowcount to digital, attempted to directly display rowcount % SQL via dbms_output.put_line... L_rowcount is just empty during the pop-up alert.

    Another solution has been L_rowcount: = DBMS_SQL. LAST_ROW_COUNT; ... This gives a slightly different result in the alert window, instead of being white, it returns 0. If something is definitely not right. Another is that in doing so, he always returned null/one field blank on the alert popup.

    I have run tests on SQL % number of lines in the editor of TOAD and got results, but during the actual shape that l_rowcount is always null after the execution of the procedure (with the exception of being 0 using the dbms_sql.last_row_count).


    I want to emphasize that change is not introduced without the additional validation in the FORM_SUCCESS at the end... I had read that the Forms_DDL is an implicit validation and committing the SQL without anything else happening... This seemed a little odd as well.

    Before forms_ddl, I tried to use execute, exec, or run immediately on the SQL, but nothing helped. I think of one other option would be to pass this SQL to a datablock again together and use to execute query on this block? Don't know how to go about it.



    The purpose of this form is intended for users to enter values in a generic form and when he meets the validation in the field triggers, they will support on submit and ideally before the update is committed I want users to be notified of the # of lines that would be affected by their proposed... change so if the # is huge they will know that they did something wrong before they affect the entire database.


    Any input would be appreciated,
    Travis

    Travis,
    The built-in function Forms_DDL() emits an implicit VALIDATION because the transaction is issued as DDL no DML. Therefore, given that the VALIDATION is the last command issued by the call of Forms_DDL, the attributes of the cursor of the implicit cursor (SQL) will all be set to NULL. If you absolutely must have the number of LINES of the documents concerned, you can create a database program unit that you can spend your dynamic statement too and have it return zero (failure) or the number of affected records (success).

    In addition, since Forms_DDL() emits an implicit VALIDATION, you must create a BACKUP point before calling Forms_DDL() If you want the ability to RESTORE any changes made in the call to Forms_DDL().

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

    Published by: Silvere July 26, 2011 09:29

  • FIRST analytical functions returns the null line

    The following query returns a null line when there is no such thing as a line for the predicate. Is it a bug or expected behaviour. If so what is the meaning of the null row, is it not logical?



    SELECT NVL (max (ah.fyr_end_dt) KEEP (DENSE_RANK FIRST ORDER BY ah.as_of_dt DESC), ' RETURNED NULL')
    Of account_history ah
    WHERE
    Ah.acct_id = 999
    AND trunc (ah.as_of_dt) < = 31 December 08 '
    ;

    Hello

    user4900730 wrote:
    Moreover, in my example how I distinguish the case where a line really exists, but the column is null when there is no such thing as a line and the FIRST function returns the same value null? Hopefullly I should be able to do it in a single SQL and know the difference?

    COUNT (*) > 0, but COUNT (col_x) = 0, then there is a line, but col_x happened to be null.

    For example, the following query shows that there is 1 row in the group with the lowest name ("ADAMS"), but the column comm in all ranks of this group is null:

    SELECT     COUNT (*)    KEEP (DENSE_RANK FIRST ORDER BY ename)
                              AS total_cnt
    ,     COUNT (comm) KEEP (DENSE_RANK FIRST ORDER BY ename)
                              AS comm_cnt
    FROM     scott.emp
    ;
    

    Output:

     TOTAL_CNT   COMM_CNT
    ---------- ----------
             1          0
    

    The employee whose highest name ("WARD") has a number in the comm column.

  • Manipulation of PL/SQL, an overload of functions and NULL

    Hello

    I am trying to write a package of assistance with the same name of function that takes a different type of settings (VARCHAR2 or NUMBER or DATE) and processing them. Please check the example below.

    create or replace package is MY_PACKAGE
    performOperation (var1 VARCHAR2) return feature NUMBER;
    performOperation (var1 NUMBER) function return NUMBER;
    performOperation (var1 DATE) function return NUMBER;
    end MY_PACKAGE;

    This package works well until I pass a VARCHAR2 or NUMBER or DATE values. If I pass NULL, I get error PL-00307/ORA-06550. Check for null before adoption is not an option. Is there a better way to handle the NULL value inside this package.

    Thanks for your help on this.

    vbforums wrote:
    Thanks for the reply of Solomon.

    I prefer not to determine the type of data from the start, I'm too load methods. If it manages the NULL, I could use different names for all three data type

    There is no need, unless you use a PL/SQL NULL or NULL SQL function:

    SQL> create or replace package body MY_PACKAGE is
      2  function performOperation(var1 VARCHAR2) return NUMBER is begin return 1; end;
      3  function performOperation(var1 NUMBER) return NUMBER is begin return 2; end;
      4  function performOperation(var1 DATE) return NUMBER is begin return 3; end;
      5  end MY_PACKAGE;
      6  /
    
    Package body created.
    
    SQL> set serveroutput on
    SQL> declare
      2      v_num number;
      3      v_str varchar2(1);
      4      v_dt  date;
      5  begin
      6      dbms_output.put_line(my_package.performOperation(v_str));
      7      dbms_output.put_line(my_package.performOperation(v_num));
      8      dbms_output.put_line(my_package.performOperation(v_dt));
      9  end;
     10  /
    1
    2
    3
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    However, if you use use the PL/SQL NULL or NULL SQL function, you must convert it into an appropriate type as NULL itself is without (the unknown value of an unknown type) type. When NULL is assigned to a variable or a column, it becomes an unknown variable value or a column of data type. This is why PL/SQL can understand an overload.

    SY.

  • Assigning a page element in the region of the "body of function return PLSQL SQL query.

    I've not been here in a long time. I like the new forum text editor!

    I have a search page in my application that contains a return region of query SQL PLSQL function body. I use PLSQL to build a query based on the user entries in various page numbers (search text, serial number, year, etc.). Using PLSQL is very useful to enforce the page quickly because there are 1/2 million lines with a lot of text fields some of which are CLOB.

    Users want to know how many rows were returned, but if I allow using a paging system that includes the total performance dies because ApEx has to sort through all the pages of output. Instead, I use ' line varies X to Y "without the part of" Z", and it's pretty fast. I can't use the #TOTAL_ROWS # because it does not work with this system of pagination.

    So, I built a code within the region of function body PLSQL to build a second query that counts only the lines based on the input parameters. I can do this query within the region using EXECUTE IMMEDIATE and the number to an output variable. The disconnect is that I can not then assign it to a page element. If I add a statement assigned to a page element, either by

    : P45_COUNT: = p_count;
    or
    APEX_UTIL. SET_SESSION_STATE ('P45_COUNT', p_count);

    then when I submit the changes I get

    ERR-1002 unable to find point item ID 'P45_COUNT' in the application '4000 '.

    as if the ApEx is not looking for the item in my application, but in the application development environment. I am able to write the results to a table and then recover data in the next region. That's how I got around the problem, but it seems too complicated and unnecessary.

    I wrote the following code just to illustrate the problem.

    Make sense? Any ideas?

    Thank you!

    Bill


    declare
    p_sql varchar2 (32767).
    p_sql_count varchar2 (32767).
    p_table_count number (2);
    p_count number (10);
    p_instr number (10);
    Start
    p_sql: = q'! Select g.id, g.widget, g.year_made, g.serial!';
    p_sql: = p_sql | q'! g table_g where g.status = 1!';

    If: P45_YEAR_MADE is not null then
    p_sql: = p_sql | q'! and $P45_YEAR_MADE = g.year_made!';
    end if;
    If: P45_SERIAL is not null then
    p_sql: = p_sql | q'! and upper (g.serial) like '% "| Upper ($P45_SERIAL) | » %' !';
    end if;
    If: P45_WIDGET_SEARCH is not null then
    p_sql: = p_sql | q'! and upper (g.widget) like '% "| Upper ($P45_WIDGET_SEARCH) | » %' !';
    end if;

    p_instr: = instr (p_sql, 'of g table_g where g.status = 1');
    p_sql_count: = ' select count (g.id) of "| substr (p_sql, p_instr);

    p_sql_count: = replace (replace (replace (p_sql_count, ' $P45_YEAR_MADE ',: P45_YEAR_MADE), "$P45_SERIAL", "' |: P45_SERIAL |)) ('), "$P45_WIDGET_SEARCH", "' | : P45_WIDGET_SEARCH | '''');

    run immediately p_sql_count in p_count;

    / * the following

    : P45_COUNT: = p_count;

    gives this error when I submit the region in the development environment

    ERR-1002 unable to find point item ID 'P45_COUNT' in the application '4000 '.

    */

    Select count (1) in the table_sql p_table_count where app_session =: APP_SESSION.
    If p_table_count = 0 then
    insert into table_sql (app_session, sql_text, session_date, count) values (: APP_SESSION, p_sql_count, sysdate, p_count);
    on the other
    Update table_sql set sql_text = p_sql_count, session_date = sysdate, count = p_count where app_session =: APP_SESSION.
    end if;

    / * the above written SQL and count of a table * /.

    Return replace(p_sql,'$',':');
    end;

    Hello

    Try the suggestion of Scott in Re: how to get the query region "PL/SQL function body returns the query string"?

    Andy

  • Need help with ics. SQL return null

    Hi experts WCS.

    I have this ics. SQL statement that returns an IList as null and nothing in the errStr in debugging print.

    IList rsATypes is ics. SQL (, sqlATypes, listName, limit, bCache errStr);

    The code is in one of my jsp. He ran very well in my local JSK (HyperSQL Db), but returns NULL in the case of Test (Oracle DB, if this is another).

    I got the sql statement println during execution and run it directly in Oracle DB (same instance) it returns the expected result set.

    The code snippet:

      System.out.println("## ics.GetSSVar(\"pubid\")          : " + ics.GetSSVar("pubid"));
    
        // Get Attribute Types
        String sqlATypes = "SELECT DISTINCT assetpublication.assettype "
                         + "FROM assetpublication "
                         + "LEFT JOIN approvedassets "
                         + "    ON assetpublication.assetid = approvedassets.assetid "
                         + "WHERE pubid = '" + ics.GetSSVar("pubid") + "' "
                         + "AND (tstate is null OR tstate <> 'A') "
                         + "AND (voided is null OR voided <> 'T') "
                         + "ORDER BY assettype; ";
        System.out.println("##0126 sqlATypes : " + sqlATypes);
        String from = "AssetPublication, ApprovedAssets";
        // String listName = null;
        String listName = "ATypesList";
        int limit = -1;
        // boolean bCache = true;
        boolean bCache = false;
        StringBuffer errStr = new StringBuffer("");
        ics.ClearErrno();
        IList rsATypes = ics.SQL(from, sqlATypes, listName, limit, bCache, errStr);
    
        System.out.println("## rsATypes : " + rsATypes);
        if (rsATypes == null) {
            System.out.println("## NO DATA in rsATypes! errStr : " + errStr.toString());
    

    }

    The journal:

    ## ics.GetSSVar("pubid")          : 1374097570685
    ## sqlATypes : SELECT DISTINCT assetpublication.assettype FROM assetpublication LEFT JOIN approvedassets     ON assetpublication.assetid = approvedassets.assetid WHERE pubid = '1374097570685' AND (tstate is null OR tstate <> 'A') AND (voided is null OR voided <> 'T') ORDER BY assettype;
    ## rsATypes : null
    ## NO DATA in rsATypes! errStr :
    


    I got enclosing try catch block, who did not take any exception.


    The funny thing is, in the same piece of code, an ics. Casea used already worked (which I noticed outside because there was not enough for what I want to do):

            StringBuffer errSB = new StringBuffer("");
            ics.SetVar("assetid", id);
            IList approvedAsset = ics.SelectTo("ApprovedAssets", "state,voided,tstate,locked,reason,treason", "assetid", null, -1, null, true, errSB);
    

    Any help/ideas from anyone would be really appreciated.

    Thanks Guddu1223, I discovered why.

    The SQL statement cannot end with a semicolon (see line 11 of my original above codes). Delete who had back all the records provided for in my resultset in the IList.

    The reason why it works in my local, but not stable instance that I guess is my local JSK + HyperSQL, in WCS + Oracle DB instance trying...

  • Analyze: Body of PL/SQL function returning a SQL query

    I need to get the final SQL returned by the PL/SQL function.
    I'll use this final SQL in a procedure.
    Please provide only a few tips on how to get the SQL code. I already looked in the DBMS_SQL package, but I don't know if this is the right place to look.


    Kind regards
    Sumit
    declare 
    
      l2 varchar2(2000);
    
    begin
    
      l2:= 'Select NAME,ORIGINATED,OWNER,ORIGINATOR,';
      l2:= l2 || 'DESIGNATED_UNIT,SOURCE,';
      l2:= l2 || 'REFERENCE';
      l2:= l2 || ' from MV_DETAILED_DATA';
    
      /*
        Copy dynamic query SQL to application item for later use.
      */
      :app_item := l2;
    
      wwv_flow.debug('l2: ' || l2);
    
      return l2;
    
    end;
    

    I always use a call of debugging in the region of body of the PL/SQL function returning a SQL query sources so the real generated SQL can be quickly entered via the debug mode.

  • ORA-06503: PL/SQL: function returned no value

    Hi guys,.
    I wrote a function that returns the number of quarter for a given date.
    Here's the function

    FUNCTION to CREATE or REPLACE fn_get_quarter
    (p_date DATE)
    RETURN NUMBER
    AS
    v_qtr NUMBER;
    BEGIN
    Select TO_CHAR (p_date, 'Q')
    IN v_qtr
    DOUBLE;
    dbms_output.put_line (' it's quarter ' | v_qtr);
    END;

    It compiled without error.

    Here is the test case that I wrote

    DECLARE
    p_date DATE: = TO_DATE('12/22/2009','MM/DD/YYYY');
    v_qtr NUMBER;
    BEGIN
    v_qtr: = fn_get_quarter (p_date);
    END;

    When I run the present, I get the following error.

    ORA-06503: PL/SQL: function returned no value
    ORA-06512: at "GPS_FVO. FN_GET_QUARTER', line 13
    ORA-06512: at line 7

    But surprisingly, I get the result.

    Please suggest and let me know how to get rid of this error and why I get this error.

    Thanks in advance.
    Sam

    RETURN v_qtr;
    should be added after DBMS_OUTPUT

  • How to make FUNCTION returns several columns and several outputs line

    Hi all

    Kindly share your idea; Thanks in advance;

    I have the demo of the Table.

    DEMO table:

    name identity
    1 to 10
    1-a11
    1-a12
    2-b10
    2-b11
    3 ccc

    and the function is like:

    create or replace function (number of p1) return varchar2 as
    number of vid;
    VNAME varchar2 (20);
    Start
    SELECT id, name in vid, vname from demo where id = p1;
    return v1;
    end;
    /

    This function returns the output for the id = 3;

    BUT,

    I need output like (input 1)

    VNAME vid
    1 to 10
    1-a11
    1-a12

    A function returns a single data type.

    This type of data can be a type of atomic data (varchar2, number etc.) or it may be a type of data object to save, or even a type of collection data.

    Where will you use this feature? In PL/SQL or SQL?

    If you are wanting to use it in SQL, need you a pipeline for example function

    SQL> CREATE OR REPLACE TYPE myemp AS OBJECT
      2  ( empno    number,
      3    ename    varchar2(10),
      4    job      varchar2(10),
      5    mgr      number,
      6    hiredate date,
      7    sal      number,
      8    comm     number,
      9    deptno   number
     10  )
     11  /
    
    Type created.
    
    SQL> CREATE OR REPLACE TYPE myrectable AS TABLE OF myemp
      2  /
    
    Type created.
    
    SQL> CREATE OR REPLACE FUNCTION pipedata(p_min_row number, p_max_row number) RETURN myrectable PIPELINED IS
      2    v_obj myemp := myemp(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
      3  BEGIN
      4    FOR e IN (select *
      5              from (
      6                    select e.*
      7                          ,rownum rn
      8                    from (select * from emp order by empno) e
      9                   )
     10              where rn between p_min_row and p_max_row)
     11    LOOP
     12      v_obj.empno    := e.empno;
     13      v_obj.ename    := e.ename;
     14      v_obj.job      := e.job;
     15      v_obj.mgr      := e.mgr;
     16      v_obj.hiredate := e.hiredate;
     17      v_obj.sal      := e.sal;
     18      v_obj.comm     := e.comm;
     19      v_obj.deptno   := e.deptno;
     20      PIPE ROW (v_obj);
     21    END LOOP;
     22    RETURN;
     23  END;
     24  /
    
    Function created.
    
    SQL> select * from table(pipedata(1,5));
    
         EMPNO ENAME      JOB               MGR HIREDATE                    SAL       COMM     DEPTNO
    ---------- ---------- ---------- ---------- -------------------- ---------- ---------- ----------
          7369 SMITH      CLERK            7902 17-DEC-1980 00:00:00        800                    20
          7499 ALLEN      SALESMAN         7698 20-FEB-1981 00:00:00       1600        300         30
          7521 WARD       SALESMAN         7698 22-FEB-1981 00:00:00       1250        500         30
          7566 JONES      MANAGER          7839 02-APR-1981 00:00:00       2975                    20
          7654 MARTIN     SALESMAN         7698 28-SEP-1981 00:00:00       1250       1400         30
    
    SQL> select * from table(pipedata(6,10));
    
         EMPNO ENAME      JOB               MGR HIREDATE                    SAL       COMM     DEPTNO
    ---------- ---------- ---------- ---------- -------------------- ---------- ---------- ----------
          7698 BLAKE      MANAGER          7839 01-MAY-1981 00:00:00       2850                    30
          7782 CLARK      MANAGER          7839 09-JUN-1981 00:00:00       2450                    10
          7788 SCOTT      ANALYST          7566 19-APR-1987 00:00:00       3000                    20
          7839 KING       PRESIDENT             17-NOV-1981 00:00:00       5000                    10
          7844 TURNER     SALESMAN         7698 08-SEP-1981 00:00:00       1500          0         30
    
    SQL> select * from table(pipedata(11,15));
    
         EMPNO ENAME      JOB               MGR HIREDATE                    SAL       COMM     DEPTNO
    ---------- ---------- ---------- ---------- -------------------- ---------- ---------- ----------
          7876 ADAMS      CLERK            7788 23-MAY-1987 00:00:00       1100                    20
          7900 JAMES      CLERK            7698 03-DEC-1981 00:00:00        950                    30
          7902 FORD       ANALYST          7566 03-DEC-1981 00:00:00       3000                    20
          7934 MILLER     CLERK            7782 23-JAN-1982 00:00:00       1300                    10
    
    SQL>
    

    If you use it in PL/SQL and then just filling a data type of collection and return that will make. Although you should question why you want to pass large amounts of data around like that first.

    Explain your purpose and what you intend to do and we can recommend the best way.

    {message: id = 9360002}

  • The page validation: function returning a Boolean

    Hi guys,.

    I'm doing a page validation simple to check an element in my presentation table if it is a number or not:

    START
    FOR i IN 1.. apex_application.g_f12. COUNTY
    LOOP
    IF LENGTH (TRIM (TRANSLATE (apex_application.g_f12 (i), "0123456789","" "))) is NOT null
    THEN
    RETURN FALSE;
    END IF;
    END LOOP;
    END;

    but I get this error message if g_f12 = AAA:

    ORA-06502: PL/SQL: digital or value error: character of number conversion error
    ERR-1021 error cannot run the validation of the "body of the function that returns a Boolean.
    Ok

    If g_f12 = A12 or a mixed alphanumeric it will work!

    * (I tried this with the function returning the text and it works like a charm, but in this case I have to use the function returns boolean to allow me to translate the error message) *.

    am I doing something wrong please help

    Thank you

    Hello

    Well, now when I look at the error message, I think that the problem is quite obvious.

    Kind regards
    Jari

    -----
    My Blog: http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

  • apex_util.get_email returns null values

    Request Express 4.1.0.00.32

    I created a calculation for a page element to get the email of the user.

    The page is P16_EMAIL_ADDRESS.

    The calculation is a type of PL/sql. The code is:

    DECLARE
    L_EMAIL_RTN VARCHAR2 (240);
    BEGIN
    L_EMAIL_RTN: = APEX_UTIL. GET_EMAIL (p_username = > 'APP_USER');
    END;

    When I check the session information and debugging logs it indicates that the function is to return null.

    I figured I was doing something wrong in the APEX while I created a procedure in the database called the APEX_UTIL. GET_EMAIL. I've run in debug mode and saw that he too returned null. I get the same results with the GET_FIRST_NAME and GET_LAST_NAME functions.

    Can you see what I'm doing wrong? Or give an example of using these functions correctly?

    Thank you

    Steve

    Published by: cranestar on February 28, 2012 09:28

    So if you know, APEX forums supports the use of the [code] and [code /] intended to set aside code segments for ease of reading.

    One thing I noticed in your sample service is this unconditional statement: RETURN NULL;

    Your function can do all sorts of things, but this indicates the function always return explicitly NULL - your behavior. You must declare a variable to store the results of the function call to APEX_UTIL. GET_EMAIL() and return this variable:

    create or replace function L_EMAIL_RTN
      return varchar2
     is
    declare
      v_email   VARCHAR2(240);
    begin
      v_email  := APEX_UTIL.GET_EMAIL(p_username => :APP_USER);
      return v_email;
    end;
    

Maybe you are looking for

  • Cannot delete sync data, even with the new acct because it will merge the data.

    Attempt to remove my sync data because it is full of dupps and omissions. Deleted my sync account created a new account of diff when I try to use it I thought that it will merge with my old acct data because it's the same PC. I lost 2 days doing a si

  • &lt; CLOSED &gt; USSD / Test Mode / Debug Codes

    EDITED POST - DELETED DATA

  • start stop multiple while loops

    I have a fairly large VI that works while several loops with the strutures case inside. I would like to be able to close and on all looped programmatically according to events. (complete cycle or cycle started) I need to store my data in a table, but

  • Cannot delete the file/folder even in Administrator Mode or Mode safe

    I. hate. Vista. Windows XP has NEVER been this difficult to work with! I recently installed MagicISO. Didn't like it, so I deleted it. He left behind a small dll file and the folder. I wanted to remove both, couldn't. Tried safe mode. FAILED Administ

  • Signals and Slots

    Try to test something after that someone wanted to help with the signals and Slots sorta. I know there is an alternative to this, but I'm trying to understand why this does not work when doing it this way.  It relies, it works but it does not fly...