Retrieving values from comma delimited string from PL/SQL procedure

Gurus,

I would spend that time but I'm crunched for time. I have a value of varchar2 parameter delimited by commas that will take X number of delimited values.

Can you guys recommend a simple method to extract these values so that I can use this in explicit cursor?

I give points to useful and correct responses.


Thanks again,
Scott


BTW, I use Oracle 10 g and 11i applications

Published by: sreese on January 31, 2012 15:37

Hello

Check out these pages:
http://www.Oracle-base.com/articles/Misc/DynamicInLists.php
http://tkyte.blogspot.com/2006/06/varying-in-lists.html

Tags: Database

Similar Questions

  • Retrieving values from XML in Oracle 9i - part II

    Hello

    regarding my previous post retrieving values of XML in Oracle 9i , I now have a different requirement.

    Assuming that the XML is as follows:

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < GenericRequest xmlns =" http://webservices.mysite.com/test "xmlns:ns =" " http://webservices.mysite.com/test/NS "xmlns:ns1 =" " http://webservices.mysite.com/test/ns1 "xmlns:ns2 =" " http://webservices.mysite.com/test/ns2 ">

    < ns1:order >

    < ns1:orderItems >

    < ns1:orderItem >

    create < ns1:operation > < / ns1:operation >

    < ns1:brickId > TST002 < / ns1:brickId >

    < ns1:brickAttributes >

    < ns1:attribute >

    < ns2:name > COUNTRY < / ns2:name >

    < ns2: value > U.S. < / ns2: value >

    < / ns1:attribute >

    < ns1:attribute >

    < ns2:name > CUST_ID < / ns2:name >

    < ns2: value > 12345 < / ns2: value >

    < / ns1:attribute >

    < ns1:attribute >

    < ns2:name > CITY < / ns2:name >

    < ns2: value > New York < / ns2: value >

    < / ns1:attribute >

    < / ns1:brickAttributes >

    < / ns1:orderItem >

    < ns1:orderItem >

    Update < ns1:operation > < / ns1:operation >

    < ns1:brickId > TST001 < / ns1:brickId >

    < ns1:brickAttributes >

    < ns1:attribute >

    < ns2:name > COUNTRY < / ns2:name >

    < ns2: value > U.S. < / ns2: value >

    < / ns1:attribute >

    < ns1:attribute >

    < ns2:name > CUST_ID < / ns2:name >

    < ns2: value > 22222 < / ns2: value >

    < / ns1:attribute >

    < ns1:attribute >

    < ns2:name > CITY < / ns2:name >

    < ns2: value > Los Angeles < / ns2: value >

    < / ns1:attribute >

    < / ns1:brickAttributes >

    < / ns1:orderItem >

    < / ns1:orderItems >

    < / ns1:order >

    < / GenericRequest >

    As you can now see the XML contains several elements of the order. For each agenda item, I have a single operation and a brick_id. Then, for each item on the agenda, I have a list of brickAttributes (name and value).

    How can I get something like that?

    OPERATION BRICK_ID NAME VALUE

    --------- -------- ------- -----------

    create TST002 COUNTRY WE

    create TST002 CUST_ID 12345

    create TST002 New York CITY

    update of TST001 COUNTRY United States

    Update TST001 CUST_ID 22222

    Update TST001 CITY Los Angeles

    Version of database is 9.2.0.8

    SELECT * FROM version of v$.

    BANNER

    ----------------------------------------------------------------

    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64 bit Production

    PL/SQL Release 9.2.0.8.0 - Production

    CORE Production 9.2.0.8.0

    AMT for HP - UX: 9.2.0.8.0 - Production Version

    NLSRTL Version 9.2.0.8.0 - Production

    Kind regards.

    Alberto

    Response of Odie, result is that extend

    with sample_data as (
    select xmltype(
    '
    
              
                
                  
                    create
                    TST002
                    
                      
                        COUNTRY
                        US
                      
                      
                        CUST_ID
                        12345
                      
                      
                        CITY
                        New York
                      
                    
                  
                  
                    update
                    TST001
                    
                      
                        COUNTRY
                        US
                      
                      
                        CUST_ID
                        22222
                      
                      
                        CITY
                        Los Angeles
                      
                    
                  
                
              
    ') xmldoc
    from dual
    )
    select extractvalue(value(x), 'ns1:orderItem/ns1:operation', 'xmlns:ns1="http://webservices.mysite.com/test/ns1"') as operation
         , extractvalue(value(x), 'ns1:orderItem/ns1:brickId', 'xmlns:ns1="http://webservices.mysite.com/test/ns1"') as brick_id
         , extractvalue(value(y), 'ns1:attribute/ns2:name', 'xmlns:ns1="http://webservices.mysite.com/test/ns1", xmlns:ns2="http://webservices.mysite.com/test/ns2"') as name
         , extractvalue(value(y), 'ns1:attribute/ns2:value', 'xmlns:ns1="http://webservices.mysite.com/test/ns1", xmlns:ns2="http://webservices.mysite.com/test/ns2"') as value
    from sample_data t
       , table(
           xmlsequence(
             extract(
               t.xmldoc
             , '/GenericRequest/ns1:order/ns1:orderItems/ns1:orderItem'
             , 'xmlns="http://webservices.mysite.com/test", xmlns:ns1="http://webservices.mysite.com/test/ns1"'
             )
           )
         ) x
       , table(
           xmlsequence(
             extract(
               value(x)
             , 'ns1:orderItem/ns1:brickAttributes/ns1:attribute'
             , 'xmlns:ns1="http://webservices.mysite.com/test/ns1"'
             )
           )
         ) y
    ;
    

    As shown, it simply retrieves to a higher level object that repeats once in table x and happening at the table there, which returns the expandable nodes.  The join is managed by value (x) in the second simple table.  It assumes that there is always 1 or several nodes of ns1:attribute in each ns1:orderItem.

  • Retrieving values from XML in Oracle 9i

    Hello

    I have the following XML:

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < GenericRequest xmlns =" http://webservices.mysite.com/test "xmlns:ns =" " http://webservices.mysite.com/test "xmlns:ns1 =" " http://webservices.mysite.com/test "xmlns:ns2 =" " http://webservices.mysite.com/test ">

    < ns1:order >

    < ns1:orderItems >

    < ns1:orderItem >

    create < ns1:operation > < / ns1:operation >

    < ns1:brickId > TST123 < / ns1:brickId >

    < ns1:brickAttributes >

    < ns1:attribute >

    < ns2:name > COUNTRY < / ns2:name >

    < ns2: value > U.S. < / ns2: value >

    < / ns1:attribute >

    < ns1:attribute >

    < ns2:name > CUST_ID < / ns2:name >

    < ns2: value > 12345 < / ns2: value >

    < / ns1:attribute >

    < ns1:attribute >

    < ns2:name > CITY < / ns2:name >

    < ns2: value > New York < / ns2: value >

    < / ns1:attribute >

    < / ns1:brickAttributes >

    < / ns1:orderItem >

    < / ns1:orderItems >

    < / ns1:order >

    < / GenericRequest >

    And I use an older version of Oracle (it's something I can't change unfortunately):

    SELECT * FROM version of v$.

    BANNER

    ----------------------------------------------------------------

    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64 bit Production

    PL/SQL Release 9.2.0.8.0 - Production
    CORE Production 9.2.0.8.0
    AMT for HP - UX: 9.2.0.8.0 - Production Version
    NLSRTL Version 9.2.0.8.0 - Production

    What is the best way to get the list name / value in a format like this with a SQL query?

    VALUE NAME

    ------- --------

    COUNTRIES WE

    CUST_ID 12345

    New York CITY

    Kind regards.

    Alberto

    Hello Alberto,.

    You can do it like this:

    with sample_data as)

    Select xmltype)

    '

    "http://WebServices.mysite.com/test" xmlns:ns ="http://webservices.mysite.com/test" xmlns:ns1 ="http://webservices.mysite.com/test" xmlns:ns2 = "http://webservices.mysite.com/test" >. "

    create

    TST123

    COUNTRY

    WE

    CUST_ID

    12345

    CITY

    New York City

    xmlDoc ')

    of the double

    )

    Select extractvalue (value (x), ' / ns1:attribute / ns2:name ',' xmlns:ns1 is "http://webservices.mysite.com/test", xmlns:ns2 ="http://webservices.mysite.com/test" "" ") as the name

    ExtractValue (value (x), ' / ns1:attribute / ns2: value ',' xmlns:ns1 = "http://webservices.mysite.com/test", xmlns:ns2 ="http://webservices.mysite.com/test" "" ") as the value

    of sample_data t

    table)

    xmlsequence)

    extract)

    t.xmlDoc

    , ' / GenericRequest / ns1:order / ns1:orderItems / ns1:orderItem / ns1:brickAttributes / ns1:attribute'

    ", ' xmlns ="http://webservices.mysite.com/test", xmlns:ns1 ="http://webservices.mysite.com/test"". "

    )

    )

    ) x

    ;

    Namespace URI appear to be the same in your example of XML, if this is really the case, you can simplify the query and use the same namespace by default in any of the query.

  • Retrieving values from XML

    Hi all
    I don't know how to extract the POLICY of XML value which is 25000.
    Here's what I got tired.

    SELECT extractvalue (COLUMN_VALUE, ' / Member/MemberId ') MemberID,.
    ExtractValue (' COLUMN_VALUE, ' / Member/membership/MembershipKey/Key / * ') PolicyID
    TABLE (XMLSequence (xmltype (')))
    < member >
    MRD000200 < MemberId > < / MemberId >
    < 00 > BenefitRecordId < / BenefitRecordId >
    < membership >
    < MembershipKey >
    < issuer > CBA < / transmitter >
    < key name = "ABC_DIVISIONS" Id = "A_5" / >
    < / MembershipKey >
    < MembershipKey >
    < issuer > CBA < / transmitter >
    < key name = 'POLICY' Id = "25000" / >
    < / MembershipKey >
    < MembershipKey >
    < issuer > CBA < / transmitter >
    < key name = "SECTION" Id = "E22" / >
    < / MembershipKey >
    < / membership >
    < / member >
    '
    () .extract ('/member')));

    I want the rest of output
    Member ID PolicyID SECTION
    MRD000200 25000 E22

    Please suggest.
    Thank you.

    One way is like this:

    SELECT extractvalue(COLUMN_VALUE, '/Member/MemberId') MemberID,
    extractvalue (COLUMN_VALUE, '/Member/Membership/MembershipKey/Key[@Name="POLICY"]/@Id') PolicyID,
    extractvalue (COLUMN_VALUE, '/Member/Membership/MembershipKey/Key[@Name="SECTION"]/@Id') SectionID
    FROM TABLE(XMLSequence(xmltype('
    
    MRD000200
    00
    
    
    ABC
    
    
    
    ABC
    
    
    
    ABC
    
    
    
    
    '
    ).extract('/Member')));
    
  • SQL statement to retrieve value from the attribute using XPATH

    Hi all

    I think this is the right place to post this request since it is related to oracle and xpath.

    I'm writing a sql statement of xpath that will extract the value of the column attribute is what type of clob data. Here is the xml example (xml_content is the column name)



    < RAFSCREEN >
    < Home >
    < clientnumber reference = "123123" >
    < / servant >
    < RAFSCREEN >



    I need to output query should return 123123.
    I'm using query

    Select extract (xmltype (xml_content), 'RAFSCREEN, Domestic, @clientnumber') as clientnumber from table_name

    It will be very useful if someone answer this question.
    Thank you

    It is Possible...

    10g> with form_content
      2  as
      3  (
      4  select 212 form_content_id , '    ' xml_content from dual union all
      5  select 222 , '    '   from dual union all
      6  select 223 , '    '   from dual union all
      7  select 224 , '    '   from dual )
      8  select form_content_id, extractValue(xmltype(xml_content),'/RAF/XBorderRAF/ReviewReferences/@clientLegalName') as clientnumber
      9  from form_content ;
    
    FORM_CONTENT_ID CLIENTNUMBER
    --------------- --------------------------------------------------------------------------------------------------------------------------------------------
    212      ABC123
    222      ZY123
    223      IN123
    224      NL123
    
    4 rows selected.
    

    Your request (you need)

    select form_content_id, extractValue(xmltype(xml_content),'/RAF/XBorderRAF/ReviewReferences/@clientLegalName') as clientnumber
    from form_content ;
    
  • retrieve value from XML

    Hello
    I have an XML doc string stored in a varchar2 column, I want to use Oracle's XML functionality to the query string after the converted to an XMLTYPE.

    I tried to convert and questioning, but it was in vain.

    Please give me ideas or links to

    1 convert an xml stored in VARCHAR2 to XML doc.
    2. tell me the API for questioning against the created XML doc.

    Kind regards
    Kone

    We can give you ideas without a version number (3 digits).

    We can not tell you why what you were doing was not working if you don't show it to us.

    Start there.

  • Split comma delimited string CONNECT BY Clause

    Hello
    I had a problem by dividing a strings separated by commas into lines.

    I explain the following use cases:

    I have an x in table
    -> create table x (id number, int_status varchar2 (100), c_ref varchar2 (30), s_ref varchar2 (30));

    I inserted values in the table:

    insert into x (id, int_status, c_ref, s_ref) values (1, 'a1, a2, a3, a4 ', 'A',' AS');
    insert into x (id, int_status, c_ref, s_ref) values (1,'b1, b2, b3, b4 ',' B', 'BS');
    insert into x (id, int_status, c_ref, s_ref) values (1,'c1, c2, c3, c4 ", 'C', null);
    insert into x (id, int_status, cust_ref, site_ref) values (1, NULL, would be ', NULL);


    I need to split the int_status separated by commas into individual lines. This means that my result is:

    . What I need or are looking as expected result:
    -----------
    1, has, HAVE, a1
    1, has, HAVE, a2
    1, has, HAVE, a3
    1, has, HAVE, a4
    1, B, BS, b1
    1, B, BS, b2
    1, B, BS, b3
    1, B, BS, b4
    C, 1, null, c1
    C, 1, null, c2
    C, 1, null, c3
    C, 1, null, c4

    I currently have a solution using Regex. But this solution uses the UNIQUE keyword.

    The solution that I currently have:

    Select UNIQUE c_ref, s_ref, regexp_substr (int_status, "[^,] +', 1, level") error_code
    x
    connect regexp_substr (int_status, "[^,] +', 1, level") is not null;


    I need a better solution. Pointers?

    Thank you
    Cherif

    Hi Omar,.

    I mentioned the solution of Odie for similar problem some time ago...
    and in my opinion the easiest to solve your task would be:

    SELECT id,c_ref,s_ref,str error_code
      FROM x_imp,
           XMLTABLE ('ora:tokenize($v, ",")'
                     PASSING int_status AS "v"
                     COLUMNS str VARCHAR2 (12) PATH '.');
    

    output:

    ID     C_REF     S_REF     ERROR_CODE
    1     A     AS     a1
    1     A     AS     a2
    1     A     AS     a3
    1     A     AS     a4
    1     B     BS     b1
    1     B     BS     b2
    1     B     BS     b3
    1     B     BS     b4
    1     C          c1
    1     C          c2
    1     C          c3
    1     C          c4
    

    See you soon,.
    Manik.

  • Retrieve data from PL/SQL block and generate the UNIX data file

    Hi all

    I comply the following Unix Shell Script code block. The following code was generated the file count_curdate.txt with all need info. The query gives the number of records, the partition_dt group

    ABC ='sqlplus-s < < of folklore > count_curdate.txt
    uname/paswd@ConnectString
    SET THE OFF POSITION;
    SELECT COUNT (*) | «, » || partition_dt of the XYZ group by partition_dt;
    "exit";
    END '

    But now I need to change the above code to use dbms_application_info.set_module in it. Could someone let me know how to generate the file using PL/SQL in Shell Script block. I have tried following written code, but it generates count_curdate.txt file with 0 bytes.

    ABC ='sqlplus-s < < of folklore > count_curdate.txt
    uname/paswd@ConnectString
    Set serveroutput on;
    SET THE OFF POSITION;
    Set feedback off;
    BEGIN
    DBMS_APPLICATION_INFO.set_module (' shm.ksh ',' get account per day ");
    FOR again IN (SELECT COUNT (*):) «, » || partition_dt as 'DCount"of the XYZ of partition_dt group);
    LOOP
    DBMS_OUTPUT. Put_line (reccur. DCount);
    END LOOP;
    end;
    /
    "exit";
    END '

    Hello, your PL/SQL is not successfully completed, i.e.,.

    This:

    ABC=`sqlplus -s < count_curdate.txt
    uname/paswd@connectstring
    set serveroutput on;
    SET HEADING OFF;
    set feedback off;
    BEGIN
    dbms_application_info.set_module ('shm.ksh','get count by day');
    FOR reccur IN (SELECT COUNT(*)||','||partition_dt as "dcount" from XYZ group by partition_dt);
    LOOP
    DBMS_OUTPUT.PUT_LINE(reccur.dcount);
    END LOOP;
    end;
    /
    exit;
    END`
    

    Should be this:

    ABC=`sqlplus -s < count_curdate.txt
    uname/paswd@connectstring
    set serveroutput on;
    SET HEADING OFF;
    set feedback off;
    BEGIN
    dbms_application_info.set_module ('shm.ksh','get count by day');
    FOR reccur IN (SELECT COUNT(*)||','||partition_dt as "dcount" from XYZ group by partition_dt);
    LOOP
    DBMS_OUTPUT.PUT_LINE(reccur.dcount);
    END LOOP;
    end;
    /
    exit;
    EOF`
    
  • Retrieve a list of values from a string

    Hello

    We create the test table:

    create table test

    (

    CLOB cfg;

    );

    .. .and inserting a record:

    insert into test (cfg) values ('[009])

    ZINGARI = 5

    [130]

    ZINGARI = 10

    [131]

    ZINGARI = 30

    [132]

    ZINGARI = 10

    [135]

    ZINGARI = 25

    [136]

    ZINGARI = 20');

    Yes, the line breaks are required.

    I have to write a SQL that returns the list of [ARTICLES].

    The result should be:

    [130]

    [131]

    [132]

    [135]

    [136]

    It is acceptable even a comma separated string, for example:

    [130], [131], [132], [135], [136]

    with or without brackets.

    Unfortunately, I can't create a table with 2 fields, it would have been too easy... senior...

    Is there a solution?

    Thank you!

    with qry (TOTAL_MESS) as)

    Select ' [009]

    ZINGARI = 5

    [130]

    ZINGARI = 10

    [131]

    ZINGARI = 30

    [132]

    ZINGARI = 10

    [135]

    ZINGARI = 25

    [136]

    ZINGARI = 20' of the double

    )

    Select the LEVEL, regexp_substr (TOTAL_MESS, '(.*) (\[\d+\)]', 1, level, am ', 2) BRACKET_NUM

    q qry

    connect by level< regexp_count(total_mess,="" '\[\d+\]',="" 1,="" 'm')="" +="">

    LEVEL BRACKET_NUM
    1 [009]
    2 [130]
    3 [131]
    4 [132]
    5 [135]
    6 [136]
  • Combine several values of rank in a line like comma delimeted string

    Hello

    I have a requirement to combine several values of rank in a line as the comma delimeted string as below

    INDEX_NAME COLUMN_NAME POSITION_COLONNE
    EMP_EMAIL_UK EMAIL 1
    EMP_EMP_ID_PK EMPLOYE_ID 1
    EMP_DEPARTMENT_IX DEPARTMENT_ID 1
    JOB_ID EMP_JOB_IX 1
    EMP_MANAGER_IX MANAGER_ID 1
    EMP_NAME_IX LAST_NAME 1
    EMP_NAME_IX FIRST_NAME 2
    I write in a SQL and the output I need is, for example EMP_NAME_IX LAST_NAME, FIRST_NAME.

    I can't write any function as well.

    http://www.Oracle-base.com/articles/Misc/StringAggregationTechniques.php

    SELECT index_name,
           ltrim(sys_Connect_by_path(column_name, ','), ',') column_names
      FROM (select index_name,
                   column_name,
                   row_number() over(partition by index_name order by column_position) rn
              from all_ind_columns
             WHERE table_owner = 'HR')
     WHERE connect_by_isleaf = 1
     START WITH rn = 1
    CONNECT BY PRIOR rn = rn - 1
           and prior index_name = index_name
    
  • Is it possible to convert an array of values in a comma-delimited-list?

    Hello
    I want to transform the following dataset:

    Parent | Child
    ----------------------
    Charles | William
    Charles | Harry
    Anne | Peter
    Anne | Zara
    Andrew | Beatrice
    Andrew | Eugénie

    in this:

    Parent | Children
    -----------------------------
    Charles | Diana, Camilla
    Anne | Peter, Zara
    Andrew | Beatrice, Eugenie

    In other words, I would like to make a list of values from some of the major and produce them as a comma-delimited list.

    I know that his is possible in T - SQL, even if the method is a bit of a nasty hack. Is this possible in PL - SQL?

    Thaks in advance
    Jamie
    SQL>  with t  as(
     select 'Charles' parent, 'William' child from dual union
     select 'Charles', 'Harry' from dual union
     select 'Anne', 'Peter' from dual union
     select 'Anne', 'Zara' from dual union
     select 'Andrew', 'Beatrice' from dual union
     select 'Andrew', 'Eugenie' from dual
    )
    --
    --
    select parent, rtrim(xmlagg(xmlelement(e,child || ',')).extract('//text()'),',') childs from t
    group by parent
    /
    PARENT     CHILDS
    ---------- --------------------
    Andrew     Beatrice,Eugenie
    Anne       Peter,Zara
    Charles    Harry,William       
    
    3 rows selected.
    

    Don't know how Diana & Camilla suddenly jumped in many... ;)

  • Getting a value from selectonechoice

    Hello

    I use Jdeveloper 11.1.1.6

    My requirement is as below

    I have a component selected only one option, which displays a list of values.

    The user selects a value from the list of value and clicks the command button, and then the input field should be updated with the

    the value that is selected in the list.

    To do this, I wrote the code (no components company involved / only ADF faces) below

    I am able to get the list of values and post it on my page. For the rest of the game, I am not able to guess.

    I put selectoncechoice partialtriggers for buttons and the text in field

    All I need is the java code for getting the selected value and by attaching it to the text field.

    Can you help or guide me on this...

    Bean:

    The list < SelectItem > tempList.

    {} public void settempList (list < SelectItem > tempList)

    this.tempList = tempList;

    }

    public list < SelectItem > gettempList() {}

    If (tempList == null) {}

    tempList = new ArrayList < SelectItem > ();

    tempList.add (new SelectItem ("t1", "Item 1"));

    tempList.add (new SelectItem ("t2", "Item 2"));

    }

    Return tempList.

    }

    USER INTERFACE:

    <? XML version = "1.0" encoding = "UTF - 8"? >

    " < = xmlns:jsp jsp:root ' http://Java.Sun.com/JSP/page "version ="2.1"xmlns:f =" " http://Java.Sun.com/JSF/core "

    ' xmlns:af = ' http://xmlns.Oracle.com/ADF/faces/rich "> "

    < jsp:directive.page contentType = text/html"; Charset = UTF - 8 "/ >

    < f: view >

    < af:document title = "listPage.jspx" id = "d1" > "

    < af:form id = "f1" >

    < af:panelGroupLayout id = "pgl1" layout = "vertical" halign = "center" >

    < af:spacer width = "10" height = "10" id = "s1" / >

    < af:selectOneChoice label = "Custom List" id = "soc1" contentStyle = "make weight:" BOLD "; color: Green; ">

    < f: selectItems value = "#{Valuesbean.tempList}" id = "si1" / > "

    < / af:selectOneChoice >

    < af:outputText value = "Output text" id = "ot1' partialTriggers ="soc1"/ >

    < af:commandButton text = "Change" id = "ot1' partialTriggers ="soc1"/ >

    < / af:panelGroupLayout >

    < / af:form >

    < / af:document >

    < / f: view >

    < / jsp:root >

    Hello

    If you see:

    You must set a value for the selectOneChoice component. You add a new variable in your beans to use it to store your selectedItem. Then your output text should also reference the same attribute in its value field.

    Try to add in your bean:

    String mySelection;

    public String getMySelection() {}

    return mySelection;

    }

    {} public void setMySelection (String, string)

    mySelection = string;

    }

    value = "#{ValuesBean.mySelection}" label = "Custom List" id = "soc1" contentStyle = "make weight:"BOLD"; color: Green; » >

    and value = "#{ValuesBean.mySelection}" id = "ot1' partialTriggers ="soc1"/ >"

  • Procedure with the DML statements that insert values from 1 to 100 in only one table and it is matching word equivalent in the other

    Can someone help me create a procedure with the DML statements that insert values from 1 to 100 in a table "abc" and the procedure must connect the numbers into words in another table "xyz" without doing a commit explicitly. "."

    Currently on trial...

    SQL > create table abc (num number);

    Table created.

    SQL > create table xyz (num varchar2 (100));

    Table created.

    SQL > ed
    A written file afiedt.buf

    1. insert all
    2 values of 1 = 1 then in abc (num) (l)
    3 when the values of 1 = 1 then in xyz (num) (to_char (to_date(l,'j'), 'jsp'))
    4 * Select the level from dual connect by level<=>
    SQL > /.

    200 rows created.

    And the result...

    SQL > select * from abc;

    NUM
    ----------
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ..
    ..
    ..
    98
    99
    100

    100 selected lines.

    SQL > select * from xyz;

    NUM
    ----------------------------------------------------------------------------------------------------
    one
    two
    three
    four
    five
    six
    seven
    eight
    nine
    ten
    Eleven
    twelve
    ..
    ..
    ..
    98
    Nineteen eighty
    Cent

    100 selected lines.

  • Copy the default value from another field in the same page

    Hello

    I need to pass a value from one page to another page and I want to use this key as DEFAULT VALUE for a field.

    If I create a form tabular all it's ok, but if I create a normal page. I am not able to do that.

    1. 1. I call the page and I pass the value. I also have a FIELD of VIEW and I can see the correct value.
    2. 2. I create a field with attributes of this:
      1. a. source > Source = database column type
      2. b. sources > Source value or expression = FK_ID_DA (the column name)
      3. c. default > default = P27_PK_ID_DA (the field that contains the value)
    3. 3. on the screen, I see P27_PK_ID_DA and not the value

    Where is the error?

    Thank you very much

    TexasApexDeveloper wrote:

    You missed one: before the variable, without it, the default value is the string...

    Not sure that you can READ the other pages... Such that if you are on Page 27 and have a field that you want to use on page 30, page 27 is presented and its items in session state, you can 'see' on page 30.

    So, if you set the default value: P27_PK_ID_DA, then you should get by default, you are looking for...

    Only if the default value Type is set on the PL/SQL Expression. If the literal value "P27_PK_ID_DA" is seen then the Type of default value should currently be set static text with Substitutions of State of Session, in which case the value of session state must be referenced using the syntax of substitution string:

    &P27_PK_ID_DA.

  • How to use the NVL function to a parameter with comma delimited values

    Gurus,

    It is confusing to me.  I am trying to use the NVL function, but the setting that I'm passing in my cursor contains multiple values with commas.  The NVL function is confused when analyzing the values.

    'Where' cursor clause...

    and nvl (sn.c_attribute1,'x@#$%') in nvl (p_desig,'x@#$%'( )

    translated parameter values...

    and nvl (sn.c_attribute1,'x@#$%') in nvl ('SPRT''GOOD' 'BAD' 'x@#$%') -NVL does not parse the value correctly

    Any idea on how to get NVL recognize 'x@#$%' , if p_desig is null?

    Thank you

    Scott

    HI, Scott.

    Whenever you have a problem, please post a small example data (CREATE TABLE and only relevant columns, INSERT statements) of all the tables involved, so that people who want to help you can recreate the problem and test their ideas.

    Also post the results you want from this data, as well as an explanation of how you get these results from these data, with specific examples.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

    My best guess, based on what you posted bone is present, that your problem is discussed in the following:

    http://tkyte.blogspot.com/2006/06/varying-in-lists.html

    http://www.Oracle-base.com/articles/Misc/DynamicInLists.php

Maybe you are looking for