Apply the function of a column of a Ref Cursor

Hello

I have a stored procedure that returns a refcursor. Is it possible to apply a function as for example SUBSTR LPAD and a custom on a column in the refcursor function returned? The problem is that I can't change the existing stored procedure and I was wondering if it would be possible to write somewhat a wrapper procedure (or an anonymous PL/SQL block) that would actually apply a scalar function and only then return the result to the client?

Thanks and regards,
Swear

do you want after retrieve you records of Ref Cursor

SQL> create or replace
  2  procedure rc_test (p_rc out sys_refcursor)
  3  is
  4    l_rc sys_refcursor;
  5  begin
  6     open l_rc for
  7     select dummy from dual;
  8     p_rc := l_rc;
  9  end;
 10  /

Procedure created.

SQL> declare
  2     r sys_refcursor;
  3     v varchar2(1);
  4  begin
  5     rc_test (r);
  6     fetch r into v;
  7     dbms_output.put_line (lower (v));
  8     close r;
  9  end;
 10  /
x

PL/SQL procedure successfully completed.

Tags: Database

Similar Questions

  • Impossible to apply the functional base index


    Hi gurus

    For my learning, I am applying the functional index of basic but looks like I'm doing something wrong, see below for my code and appreciate your answers.

    Code example

    DROP TABLE my_table;

    CREATE TABLE my_table

    (

    AA: PRIMARY KEY number 4

    aa_desc VARCHAR2 (30),

    aa_type VARCHAR2 (10)

    ) ;

    CREATE INDEX first_name_idx ON my_table (aa > 10 and upper (aa_desc) = "SA" and aa_type is null).

    Thanks in advance

    Concerning

    Shu

    SQL> create table my_table1
      2    (
      3      aa      number(4) primary key,
      4      aa_desc varchar2(30),
      5      aa_type varchar2(10)
      6    ) ;
    
    Table created.
    
    SQL> create or replace function my_table_check
      2  (
      3    p_aa      in my_table.aa%type
      4  , p_aa_desc in my_table.aa_desc%type
      5  , p_aa_type in my_table.aa_type%type
      6  )
      7  return number
      8  deterministic
      9  as
     10  begin
     11     if (p_aa > 10 and upper(p_aa_desc) = 'SA' and p_aa_type is null) then
     12       return 1;
     13     else
     14       return 0;
     15     end if;
     16  end;
     17  /
    
    Function created.
    
    SQL> create index my_table_idx on my_table1(my_table_check(aa, aa_desc, aa_type));
    
    Index created.
    
    SQL> explain plan for
      2  select *
      3    from my_table1
      4   where my_table_check(aa, aa_desc, aa_type) = 1;
    
    Explained.
    
    SQL> set linesize 130
    SQL> set pagesize 200
    SQL>
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT
    ----------------------------------------------------------------------------------------------
    Plan hash value: 3962327877
    --------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |              |     1 |    37 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| MY_TABLE1    |     1 |    37 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | MY_TABLE_IDX |     1 |       |     1   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - access("V195588"."MY_TABLE_CHECK"("AA","AA_DESC","AA_TYPE")=1)
    Note
    -----
       - dynamic sampling used for this statement
    
    18 rows selected.
    
    SQL>
    
  • How Oracle called the hidden for the function-based index columns?


    I came across an interesting problem today.  Statistics object for a schema that have been created on the basis of data X have been imported into a 'identical' to the database schema Y.

    The problem is that, on the basis of data X a group of hidden columns associated with index based service (FBIs) were named SYS_NC00182$ to SYS_NC00191$ and on the basis of data Y the same hidden columns were named SYS_NC00183$ to SYS_NC00192$!  The consequence was that statistical column for an FBI data base X have been used for a totally different FBI on the database Y.

    Now, of course, if this was g 11 or 12 c I could just create virtual columns and those of the index.  In this way the names of the columns would be compatible on databases.  However, it is a 10g database, and I do not have this option.

    I am curious to understand how Oracle generates these hidden column names.  I'm also curious if, in 10g, there is a way to identify the name of a column hidden for an FBI that doesn't involve a statement explain plan running on a query that uses all the expressions of the FBI for the table.

    The names of $ SYS_NCnnnnn are based on the internal column id - what is loosely based on the order of creation of the FBI. If you delete a column the column internal ids (after this column), which means the names for the SYS_NCnnnnn$ the change.  An opportunity to explain your results is that a (real) column on the X data table fell, but the column still exists on the database Y.

    If you want to get the link between the current internal name and expression, then you can start with dba_ind_expressions - and create a customized version of the view - e.g @.

    Select c.intcol #, c.name, io.name, idx.name, bo.name, base.name, c.default$, ic.pos #.

    of sys.col$ c, sys.obj$ idx, basis of sys.obj$, sys.icol$ ic.

    sys. User$ io, sys.user$ bo, sys.ind$ I

    where bitand(ic.spare1,1) = 1 / * expression * /.

    and (bitand (students, 1024) = 0) / * not bmji * /.

    and ic.bo # c.obj = #.

    and ic.intcol # c.intcol = #.

    and ic.bo # base.obj = #.

    and io.user # idx.owner = #.

    and bo.user # base.owner = #.

    and ic.obj # idx.obj = #.

    and idx.obj # i.obj = #.

    and however # (1, 2, 3, 4, 6, 7, 9)

    /

    The first two columns in the select ones that I added to the initial view definition.

    Concerning

    Jonathan Lewis

  • How can I iterate over the columns of a REF CURSOR?

    I have the following situation:
    DECLARE
       text   VARCHAR2 (100) := '';
       
       TYPE gen_cursor is ref cursor;
       c_gen gen_cursor;
    
       CURSOR c_tmp
       IS
            SELECT   *
              FROM   CROSS_TBL
          ORDER BY   sn;
    BEGIN
       FOR tmp IN c_tmp
       LOOP
          text := 'select * from ' || tmp.table_name || ' where seqnum = ' || tmp.sn;
    
          OPEN c_gen FOR text;
    
          -- here I want to iterate over the columns of c_gen
          -- c_gen will have different number of columns every time,
          --        because we select from a different table
          -- I have more than 500 tables, so I cannot define strong REF CURSOR types!
    
          -- I need something like
          l := c_gen.columns.length;
          for c in c_gen.columns[1]..c_gen.columns[l]
          LOOP
              -- do something with the column value
          END LOOP;
       END LOOP;
    END;
    As you can see from the comments in the code, I couln would find examples on the internet with a REF CURSOR low and selecting from multiple tables.
    What I found was:
    CREATE PACKAGE admin_data AS
       TYPE gencurtyp IS REF CURSOR;
       PROCEDURE open_cv (generic_cv IN OUT gencurtyp, choice INT);
    END admin_data;
    /
    CREATE PACKAGE BODY admin_data AS
       PROCEDURE open_cv (generic_cv IN OUT gencurtyp, choice INT) IS
       BEGIN
          IF choice = 1 THEN
             OPEN generic_cv FOR SELECT * FROM employees;
          ELSIF choice = 2 THEN
             OPEN generic_cv FOR SELECT * FROM departments;
          ELSIF choice = 3 THEN
             OPEN generic_cv FOR SELECT * FROM jobs;
          END IF;
       END;
    END admin_data;
    /
    But they have only 3 tables here and I have like 500. What can I do here?

    Thanks in advance for any help!

    Hope it will help > [Ref Cursor dynamic dynamic Fetch | http://www.oracle.com/technology/oramag/code/tips2003/042003.html]

    See you soon,.
    AA

  • Casting table PL/SQL for the type of existing table and back ref cursor

    Hello



    I have the problem of casting a pl/sql table for the type of an existing table and turning the ref cursor to the application. Casting a ref cursor back and number of pl/sql table works well.



    Declarant

    < strong > TYPE type_table_name IS TABLE OF THE package_name.table_name%ROWTYPE; < facilities >

    within the stored procedure, fill in a table of this type temp_table_name and returning the ref cursor help

    < strong > results OPEN to SELECT * FROM TABLE (CAST (temp_table_name AS type_table_name)); < facilities >

    generates an error. type_table_name is unknown in this distribution. According to me, this happens because of the declaration of the type locally.



    Statement type_table_name inside the package specification does not work neither. Incredible, cast to the said dbms_sql.number_table to specify ref cursor back and dbms_sql package works very well!



    < strong > CREATE TYPE type_table_name IS TABLE OF THE package_name.table_name%ROWTYPE; < facilities > deals without any error but creates an invalid type complain a reference to package_name.table_name



    I don't want to declare every column in the table in type_table_name, because any change the table_name table would result in an inconsistent type_table_name.



    Thanks in advance!

    Edited by: user6014545 the 20.10.2008 01:04

    In any case you are right that there is a problem around anchorage (or maintaining) types of objects persistent to match the table structures, they may represent.

    In the case you describe, you might be better off just open the refcursor immediately the using one of the techniques described in the http://www.williamrobertson.net/documents/comma-separated.html to manage the delimited list.

    In the more general case where the line of treatment is necessary, you may make the pipeline functions.

    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    
    SQL> CREATE TABLE table_name
      2  AS
      3     SELECT ename column_name
      4     FROM   emps;
    
    Table created.
    
    SQL> CREATE OR REPLACE PACKAGE package_name
      2  AS
      3     TYPE type_name IS TABLE OF table_name%ROWTYPE;
      4
      5     FUNCTION function_name_pipelined (
      6        parameter_name IN VARCHAR2)
      7        RETURN type_name PIPELINED;
      8
      9     FUNCTION function_name_refcursor (
     10        parameter_name IN VARCHAR2)
     11        RETURN sys_refcursor;
     12  END package_name;
     13  /
    
    Package created.
    
    SQL> CREATE OR REPLACE PACKAGE BODY package_name
      2  AS
      3     FUNCTION function_name_pipelined (
      4        parameter_name IN VARCHAR2)
      5        RETURN type_name PIPELINED
      6     IS
      7     BEGIN
      8        FOR record_name IN (
      9           SELECT table_alias.*
     10           FROM   table_name table_alias
     11           WHERE  table_alias.column_name LIKE parameter_name) LOOP
     12
     13           PIPE ROW (record_name);
     14        END LOOP;
     15
     16        RETURN;
     17     END function_name_pipelined;
     18
     19     FUNCTION function_name_refcursor (
     20        parameter_name IN VARCHAR2)
     21        RETURN sys_refcursor
     22     IS
     23        variable_name sys_refcursor;
     24     BEGIN
     25        OPEN variable_name FOR
     26           SELECT table_alias.*
     27           FROM   TABLE (package_name.function_name_pipelined (
     28                     parameter_name)) table_alias;
     29
     30        RETURN variable_name;
     31     END function_name_refcursor;
     32  END package_name;
     33  /
    
    Package body created.
    
    SQL> VARIABLE variable_name REFCURSOR;
    SQL> SET AUTOPRINT ON;
    SQL> BEGIN
      2     :variable_name := package_name.function_name_refcursor ('%A%');
      3  END;
      4  /
    
    PL/SQL procedure successfully completed.
    
    COLUMN_NAME
    -----------
    ALLEN
    WARD
    MARTIN
    BLAKE
    CLARK
    ADAMS
    JAMES
    
    7 rows selected.
    
    SQL> ALTER TABLE table_name ADD (new_column_name VARCHAR2 (1) DEFAULT 'X');
    
    Table altered.
    
    SQL> BEGIN
      2     :variable_name := package_name.function_name_refcursor ('%A%');
      3  END;
      4  /
    
    PL/SQL procedure successfully completed.
    
    COLUMN_NAME NEW_COLUMN_NAME
    ----------- ---------------
    ALLEN       X
    WARD        X
    MARTIN      X
    BLAKE       X
    CLARK       X
    ADAMS       X
    JAMES       X
    
    7 rows selected.
    
    SQL>
    
  • getting this error on the function g 10 isn't a return type

    See the function down
      TYPE ptr IS REF CURSOR;
      FUNCTION check (check_part IN VARCHAR2, check_vendor in varchar2) RETURN ptr;
    FUNCTION check(check_part IN VARCHAR2, check_vendor in varchar2) RETURN ptr is
      
       my_ptr ptr;
        
       check_cnt number(30);
       default_cnt number(30);
          
      BEGIN
        
      select count(*) into check_cnt
      from table_one ps
      where ps.part_number = check_part
      and ps.vendors = check_vendor;
      
      select count(*) into default_cnt 
      from table_one lm 
      where lm.part_number = check_part
      and lm.vendors = 'UNKNOWN';
      
      if (check_cnt = 1 and default_cnt = 0) then
       
        OPEN my_ptr  FOR
        
          SELECT tp.id,
                FROM table_one tp 
          WHERE tp.part_number = (check_part)
          and tp.vendors = (check_vendor);
      return my_ptr;  
        
    elsif (default_cnt = 1 and check_cnt = 0)  then
    
          open my_ptr for 
          
          SELECT tp.id,
           FROM table_one tp 
          WHERE tp.part_number = (check_part)
         and tp.vendors = 'UNKNOWN';
    
    return my_ptr;
    end if;
    
      
    END check;
    Please note that I use oracle 10g all the... Any help is appreciated. Thank you.

    Published by: user13328581 on February 6, 2011 19:36

    sql_dev wrote:
    Hello

    Better just to have a simple statement in the else block

    ELSE
    open my_ptr for
    SELECT NULL
    FROM DUAL;
    return my_ptr;
    

    So whenever the IF fails, your other work without value in the cursor.

    In fact, this slider returns a single row that contains a NULL value.
    Better add a condition that will always evaluate to false (0 = 1).

  • Apply the corrections lenses on the already imported photos

    Hello

    I just started using Lightroom CC and I imported my collection of Aperture in Lightroom using the automatic import of the Lightrooms function.

    After some time, I discovered the correction lens Lightroom function. Now I want to apply the setting of correction of lens on all images in a folder (or folders more) at a time instead of doing image by image in the develop module.

    The only 'multi apply the function' I can find some time is to import the photos. I can't find a way to apply the corrections of the goal on the photos already imported. Who has an idea on how to do it?

    Thanks in advance, Arthur

    In the develop module, select all the images in the film. Auto-Sync lights up and then apply the lens correction to one of the images. This correction will apply to all images that are highlighted.

  • Recovery of the records by using the Ref Cursor or indexes per Table (which is better)

    Hi all

    I am interested to know if there is a performance (or other) advantages to return a result set from an Oracle stored procedure for a client application (for example, in Java) by using a Ref Cursor or Index by Table, respectively. Most of the people I met who know Java seem to use a Ref Cursor but did not say why this method is preferable. I'm not too familiar with Java and do not have the opportunity to test the difference between either method, but I am very interested in the other user forum about this view, gauging

    Kind regards

    Kevin.

    KevinFitz wrote:
    Hi zerathul,

    Thanks for the quick and helpful response. A REF CURSOR would be the best solution if the same set of results (content and number of records returned) should be dealt with by the application of the 'customer '. I'm guessing that maybe in this situation 'theoretical' that there might be less network traffic to return the set of results through an associative array,

    Kind regards

    Kevin.

    Yes, it would always be the best solution, because an associative array would mean collecting all the data in memory of expensive PGA on the database server before they pass any return on the network, while a fair Ref cursor is to feed the data over the network (maybe a little extra load, but you were unlikely to notice). Also the client application would treat a ref as of rows returned cursor data recovery and could treat them upon their arrival, an associative array is a collection of data which will then be entirely spent before any treatment could be done and then the treatment should go through the entire table to do.

    REF CURSOR will also provide other information such as the error codes etc regarding SQL if necessary. If you get an error when filling a table on the side of the database, it is not so easy to recover this error to the client.

    REF CURSOR is designed for this purpose. Use them.

  • Need the difference between strong Ref Cursor and weak Ref Cursor examples

    Oracle 9.2

    It would be great if someone can help understand the differences between
    1 Strong Ref Cursors(return type)
    and
    2. weak Ref Cursor (no return type)

    What I read is weak ref Cursor as sys_refcursor is better to use the ref Cursor, because in the case of slider strong Ref object type that will be returned must be declared in advance. It dosent make sense to me?

    I start with the examples would be appreciate for advice

    Strong Ref Cursor

    create the package str_pack
    is
    type sref_type is ref cursor return emp % rowtype;
    SVAR sref_type;
    end str_pack;

    Create procedure st_proc (eid in number, c1 on str_pack.sref_type)
    is
    Start
    Open c1 to select empno, ename, sal from emp where empno = eid;
    end;

    declare
    str_pack.sref_type C1;
    type rec is RECORD (eid, ename varchar2 number (20), number of sal);
    SheikYerbouti rec;
    Start
    st_proc(10,C1);
    loop
    When exit c1% notfound;
    Fetch c1 into SheikYerbouti.
    end loop;
    Close c1;
    end;


    There could be errors in the above example but its basically to get a better understanding.

    For weak Ref Cursor

    procedure of the child

    Create procedure child_proc (in number, c1 on sys_refcursor eid)
    is
    Start
    Open c1 to select empno, ename, sal from emp where empno = eid;
    end;

    parent process

    Create procedure parent_proc (recnum varchar2)
    is
    p_retcur sys_refcursor;
    emp_row emp % rowtype;
    Start
    child_proc (eid, p_retcur);
    loop
    extract the p_retcur in emp_row;
    dbms_output.put_line(emp_row.empno ||) e '|| emp_row. Ename | "wins". emp_row. SAL);
    end loop;
    end parent_proc;

    Concerning
    @

    Hello

    the fundamental difference is to do with the compiling and linking of runtime type that occurs.

    The he should explain a lot more detail than I could ever!
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:1640161160708

    P;

  • is it possible to apply the sort on the columns added to a dynamic display object?

    Hi all


    We use JDeveloper Studio Edition Version 12.1.3.0.0 and deployed on GlassFish Server Open Source Edition 3.1.2.2 (build 5) and connect to the SQLServer database.


    We have created a dynamic display object in the AM Impl, all objects in view columns are added dynamically.


    All lines are displayed correctly, but when sorting columns data disappear. (point of view are being refreshed, of course).


    is it possible to apply the sort on the columns added to a dynamic display object?

    This is how we show data in the JSF page:


    < af:table lines = ' #{bindings. " DynamicVO.rangeSize}' fetchSize = "#{bindings." DynamicVO.rangeSize}.

    emptyText = "#{bindings." DynamicVO.viewable? "{'No data to display.': 'Access Denied.'}".

    var = 'row' rowBandingInterval = '0' value = ' #{bindings. " DynamicVO.collectionModel}.

    selectedRowKeys = ' #{bindings. " DynamicVO.collectionModel.selectedRow}.

    selectionListener = "#{bindings." DynamicVO.collectionModel.makeCurrent}.

    rowSelection = "single" id = "t1" >

    < af:forEach elements = "#{bindings." Var DynamicVOIterator.attributeDefs}' = 'def' varStatus = 'vs' >

    "< af:column headerText =" #{def.propertyMap.label} "sortable ="true"sortProperty =" #{def.name} ".

    ID = "clmn$ {vs.index}" >

    < af:outputText value = "#{row [def.name]}" id = "ot1" / > "

    < / af:column >

    < / af:forEach >

    < / af:table >




    Thanks guys, I created a custom class that contains a model that can be sorted in a pod of support and I have to the adf work table it and it is very good about sorting.

    JSF:

    Rows = "#{pageFlowScope.crudBean.dynamicTable.collectionModel.RowCount} '"

    contentDelivery = 'immediate' var = 'row' rendered = 'true '.

    Binding = "#{backingBeanScope.crudBackingBean.tasksTable} '"

    selectionListener = "#{backingBeanScope.crudBackingBean.customListener} '"

    "rowSelection ="single"id ="t1"partialTriggers =": pt_gr2 "columnStretching =" column: clmn0 ">

    inlineStyle = "width: 100px;"  ID = "clmn$ {vs.index}" > "

  • try to follow the tutorial of Muse to apply a store online, downloaded lesson files will not open, but an alert says my version of Muse needs update. The function of update in Muse said that my version is the most recent; 2014.3

    try to follow the tutorial of Muse to apply a store online, downloaded lesson files will not open, but an alert says my version of Muse needs update. The function of update in Muse said that my version is the most recent; 2014.3!

    I expect that you use OS X 10.8 or earlier? Muse 2015.0 and later requires OS X 10.9 or higher.

  • Selection of parts and columns, or entire lines and apply the character style

    I am trying to apply character styles to certain parts/whole rows and columns.

    I can change individual cells with the following code...

    table = app.selection[0];
    if (table.hasOwnProperty("baseline")) table = table.parent;
    if (table instanceof Cell) table = table.parent;
    if (table instanceof Column) table = table.parent;
    if (table instanceof Row) table = table.parent;
    if (table instanceof Table)
    
    {
     table.rows[0].cells[6].texts[0].appliedCharacterStyle = "none report";
     }
    

    ... but when I try to select an entire line, I get the error 'Object does not support property or method' texts. "" "When I try one of the following two codes.

    {
     table.rows[0].cells.texts.appliedCharacterStyle = "none report";
     }
    

    {
     table.rows[0].cells.appliedCharacterStyle = "none report";
     }
    

    Anyone know how I can do the following?

    1. Select any row (or column) and apply the character style

    2. Select the last line (regardless of the number of rows in the table) and apply the character style

    3. apply the character style to specific columns (with theexception of the cells of two albums)

    Thank you!

    Hello

    Change this line:

    table.columns[a].cells.itemByRange(2,-1).texts.everyItem().appliedCharacterStyle = "chart orange";
    

    for the first 2 rows in each column

    Jarek

  • How to apply the filter to a specific column condition, but not to the report?

    Hello

    I'm having a problem in the application of a filter to one of the column condition.
    I have a scheme with the table around 10 dimension tables and a fact. My requirement is to provide a count on the table of facts with associated with some other columns in the dimension tables.

    Lets consider a scenario with tables as sales (Fact), region (Dimension), Year (Dimension), Type of sale (Dimension).

    Now my requirement is to highlight the fields

    City (Region) - city
    Year-
    Sales Count (dirty table) - number of all sales of the fact table
    Sales Count (dirty table) - count of all sales of the fact which type of sale table is 'Cash'

    Here, my question is how to apply the filter condition of Sales Type = 'MONEY in' only on one of the Sales Count column that comes from the fact table. I want to be ordered for the fourth column, the filter condition.

    Can someone let me know how?

    Thank you

    You must do this:

    1) click the button column fx sales. (This procedure does than on fact, not attributes.0

    2) click on the filter button.

    (3) select the size of sales from the left Type "selection list."

    (4) in the filter window, enter CASH, and click OK.

    This will create one filter on sales 'use' size 'type sales' as the filter. It willl filter only to this column.

  • Using the Evaluate function as source columns in presentation services.

    Can we use Evaluate function to get values from a data source (Oracle DB in my case) and to act as a column.
    I have custom DB function in oracle DB, it takes the input string parameter and returns a string. I am directly call this Evaluate function in the formula of change for any column in my sector of activity:

    EVALUATE ('FUNC_NAME (%1)', 'ABC')

    It gives following error.

    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error occurred. [nQSError: 14027] The browser cannot process the following query containing only constants: evaluate (FUNC_NAME (%1), 'ABC') as c1. (HY000)
    Publ. SQL: SELECT EVALUATE ('FUNC_NAME (%1)', 'ABC') saw_0 OF XXX ORDER BY saw_0

    Can use us the function Evaluate directly call and receive the value of the underlying database? We need to have a column from presentation services? Is there another way to do this?

    Regardless of the generation EVALUATE expression (using the constant only) in the DPR MDB logical column or simply in the responses there are a few rules:

    1. the RPD and answers
    If you want to query just EVALUATE expression without another column, then it must do (example):

    Column1:
    CASES where 1 = 2 then. Another EVALUATE PROD_CATEGORY ('TO_CHAR (%1)' as char, 100) end

    Evaluate uses only constant. We place the presentation inside the case attribute to make the browser to handle this request.

    2 responses
    You can only use EVALUATE ('TO_CHAR (%1)' as char, 100) in the expression column of answers but only in combination with another attribute of presentation, is not only EVALUATE ('TO_CHAR (%1)' as char, 100) in the query.

    Column1: PRODUCTS. PROD_CATEGORY
    Column2: EVALUATE ('TO_CHAR (%1)' as char, 100)

    Concerning
    Goran
    http://108obiee.blogspot.com

  • Problem with the function 'length' for table column in a table (fn)

    Hello

    I have a piece of javascript code that sets all the values of a column in a table:

    function exemptAll (flag)
    {
    Alert (document.wwv_flow. F42. Length);
    for (var i = 0; i < document.wwv_flow.f42.length; i ++)
    {
    var curr_id = document.wwv_flow.f42user.user;
    If (flag == 'Y')
    {
    document.getElementById ("curr_id") .value = "Y";
    }
    on the other
    {
    document.getElementById (curr_id) .value = 'n';
    }
    }
    }


    It works very well to provide in the form of tables, there are multiple lines, if only one line is the "document.wwv_flow.f42.length" function returns false values - we had '2' and '3' returned to a form of the tab that contains a single row and subsequently code fails with an error "invalid argument".

    Is this a recognized bug because we cannot find similar reports of what is happening on the forums. Any help would be appreciated as we have to fake a work around using an element of the page containing the number of lines in the tabular presentation.

    Hello

    I think that "bug" is caused by the dynamic nature of Javascript.

    If there is more than one field called f42, any reference to it will return an array of fields. However, if there is only one instance of it, any reference to it will return the field itself! In the latter case, probably the length function returns the number of characters in the field.

    Therefore, you must check whether what you have is an array or not. Unfortunately, there is no such function only as "isArray" in JS! If you are looking on the net for "isArray" you will find a number of alternatives well...

    I hope this helps.
    Luis

Maybe you are looking for

  • iPhone SE in Argentina

    Hello. I can't find out if the iPhone sim-free works with carriers of the Argentina. Thank you.

  • Lost password manager

    My firefox site was slow and a warning has come to suggesting that I re - install. I checked and it said that all passwords would be saved. Having done that I can not find the password manager on the site or any of my registered sites react with the

  • With the help of hyperlinks and bookmarks in documents

    I like to use hyperlinks between documents and have put some using this method. However, when I just use the hyperlink, I get the following message:+ This operation has been cancelled due to restrictions in effect on this computer. Please contact you

  • Display the line number in TextEdit

    I'm trying to twist around the preferences and browsing the web, if there is a way to display the line numbers in the TextEdit application. I could not find, how is it possible to display the line number? OS: Mac OS X El Capitan

  • 660 GTX to my hpe-112y

    OK, so I'm wondering if this card would work with my computer here are its specs http://www.GeForce.com/hardware/desktop-GPUs/GeForce-GTX-660/specifications This is the power supply im planning on getting http://www.TigerDirect.com/applications/Searc