Oracle function

Hi all

I know it would be a very basic question but need some clarification.

In oracle, we use the function, what is the meaning of return type because by using the output parameter, we can also return the value.

Thank you

Hello

Ask yourself "why do we need to use function values?  Why can't we always use THE arguments instead? »

One of the reasons is that functions with arguments OUT cannot be called from SQL, the SQL statements used in PL/SQL statements.

Another is the convenience of use of multiple functions in a single statement.  With function values, you can do things like

SUPERIOR (SUBSTR (LTRIM (str), 1, 4))

Using only THE values, would need you 3 separate instructions for it; one for each function.

Tags: Database

Similar Questions

  • Failed to open oracle functions after R12 installation on windows 2008 64 bit

    Hi guys
    I installed oracle R12.1.1 on windows server 2008 R2 64-bit, then the application opens but all forms of oracle functions cannot open, the message appear frm-92101, I try the solutions in the net, but no effect and I get another windows which and this message appears when trying to open an another oracle functions
    ""
    program currently running on this computer is attempting to display a message, then
    title of the message:
    E:\oracle\VIS\apps\tech_st\10.1.3\appsutil\jdk\bin\java '-serv ".


    This problem come when a program is not completely compatible with windows
    ""
    This message when you start windows too, but the path of java inside files of oracle applications, please help me if oracle r12.1.1 compatible with win 2008 64 bit or not?

    I installed oracle R12.1.1 on windows server 2008 R2 64-bit, then the application opens but all forms of oracle functions cannot open, the message appear frm-92101, I try the solutions in the net, but no effect and I get another windows which and this message appears when trying to open an another oracle functions

    Direct installation of R12 on Windows 2008 64 bit is not supported. You install it on a Windows 32-bit operating system, and then migrate to Windows 64 - bit.

    Oracle E-Business Suite installation and upgrade version Notes 12 (12.1.1) for Microsoft Windows Server (32-bit) [ID 761567.1]
    Migration Oracle E-Business Suite R12 to Microsoft Windows Server 2008 R2 [ID 1188535.1]

    Thank you
    Hussein

  • The HTML that is returned by an Oracle function...

    What is the best way to view the HTML code that is returned by an Oracle function (Apex 3.2.1.00.10)?

    I tried in many ways...

    I don't want to have a visible, but even when I do that, the first returned row Editor:

    < b > text < /b >

    It shows in "BOLD", but for some reason, it escapes from the second < \b > and the fact like that "& lt;" \b & gt; "so it's show < \b > and everything is"BOLD"...

    tward wrote:
    What is the best way to view the HTML code that is returned by an Oracle function (Apex 3.2.1.00.10)?

    I tried in many ways...

    I don't want to have a visible, but even when I do that, the first returned row Editor:

    a text

    It shows in "BOLD", but for some reason, it escapes from the second <\b>and done like this '< \b >"so he showed <\b>and everything is"BOLD"...

    you have the backslash "close tag"... it should be
    < b > text < /b >

    Note the slash!

  • Conversion in Oracle function.

    Hello

    So here's the scenario I have. I was wondering if there is any oracle function provides or is it possible that I could achieve this goal.
    CREATE OR REPLACE procedure TestA 
    (
          partnumber               IN  number,
          partsubnum               IN  varchar2,
          errstring             OUT varchar2
    ) as
    
    --  Declare local variables
    
    ll_inputpartnum varchar2(100);
    
    
    Begin
    
        ll_inputpartnum := partnumber || partsubnum; -- Concatinate partnumber and partsubnum
      -- Will need to convert this variable to number.
    
        TestB.Process(ll_inputpartnum,parameter2, s_errstring, errnum); --ll_inputpartnum must be of type number 
         if  errnum <> compkg.success then
           errstring := s_errstring;
           return;
         end if;
      
      
    Exception 
        When others then 
        Null;    
    End;
    /
    I don't have the ability to change anything about how to TestB.Process.

    There are therefore two problem I am trying to solve in this scenario.

    First, the input parameter - ll_inputpartnum in TestB.Process takes input of only of number type. So I need to convert somehow the concatenated in full ll_inputpartnum.

    Second problem, procedure TestB.Process - after completing his treatment, goes from ll_inputpartnum to the third procedure. Let's say TestC procedure. TestC procedure, so I need to break in again value concatenated in original partnumber and partsubnum.

    The value concatenated - ll_inputpartnum does not change through this process.

    So, I'm trying to understand the best way to approach this situation.

    Thank you

    Published by: Ramses on May 25, 2010 13:18

    with a function like (using also the package of William)

    function combine_parts(p_partnum in integer,p_partsubnum in varchar2) return integer is
      l_length pls_integer := 5;  /* adjust to the maximum possible length of partsubnum */
      hex_val  varchar2(5) := '';
    begin
      if length(p_partsubnum) > l_length then
        return 0;
      end if;
      for i in 1 .. l_length loop
        hex_val := hex_val || to_base(ascii(substr(lpad(p_partsubnum,l_length,chr(0)),i,1)),16)
      end loop;
      return p_partnum * power(256,l_length) + to_decimal(hex_val,16);
    end;
    

    You can simply

    ll_inputpartnum := combine_parts(partnum,partsubnum);
    

    and finally, the parameter ll_inputpartnum can be connected to the appropriate process
    you will need another function to find partnum and partsubnum in another process, because it will be just ll_inputpartnum

    function concatenated_parts(p_number in integer,p_separator in varchar2 default '|') return varchar2 is
      l_length pls_integer := 5;  /* adjust to the maximum possible length of partsubnum */
      hex_val  varchar2(5);
      chr_val  varchar2(5) := '';
      l_partnum integer;
    begin
      l_partnum := trunc(p_number / power(256,l_length));
      hex_val := to_base(p_number - l_partnum * power(256,l_length),16);
      if length(hex_val) > l_length then
        return '';
      end if;
      for i in 1 .. l_length loop
        chr_val := chr_val || chr(to_decimal(substr(hex_val,i,1),16));
      end loop;
      return to_char(l_partnum) || p_separator || chr_val;
    end;
    

    Concerning

    Etbin

    p.s. features are not tested (no database home)

  • DB2 code: today's date and the day to ORACLE function?

    Please help me to convert this code oracle...

    DB2 code:

    [code] ((Current date) - day (date (current date))) [/ code]

    I tried to use the functions of default in PL date timestamps, but it won't work. Help, please.

    As told by BluShadow and rp0428, you can execute the following statement:

    Select current_date, trunc(current_date,'MM')-1 day of double;

    The output will be today's date and the month last, last day.

  • UNIX_TIMESTAMP and FROM_UNIXTIME from MySQL to ORACLE functions

    Hi all

    I'm migrating some functions and stored procedures in MySQL to ORACLE, and I the next instruction

    Set valuedat = FROM_UNIXTIME (valor + UNIX_TIMESTAMP ('2000-1-01 00:00:00 '));

    Since MySQL.

    Look, I found that:

    UNIX_TIMESTAMP ('2000-1-01 00:00:00 ')

    can be equivalent to the following query:

    SELECT (to_date (January 1, 2000 "," MON-DD-YYYY')-to_date('01-jan-1970','DD-MON-YYYY')) * (86400) as dt FROM dual;

    but testing the numbers is not the same

    Please can someone help me!

    Specifically, I need to know how to build the equivalent in oracle for FROM_UNIXTIME and UNIX_TIMESTAMP functions

    Thank you and best regards!

    CRGM

    Hello

    These are functions that I built to solve the original requirement, thanks for all your comments.

    ************************************************************************************************************************************

    CREATE OR REPLACE FUNCTION FROM_UNIXTIME

    (

    TIMESTAMP_ NUMBER

    ) AS OF DATE OF RETURN

    NUMBER OF SECONDS_PER_DAY: = 86400;

    MASK (50 CHAR) VARCHAR2: = 'DD-Mon-YYYY HH24:MI:SS ";

    DATE OF REF_DATE;

    BEGIN

    REF_DATE: = TO_DATE ('01 - ENE - 1970 00:00:00 ', MASK);

    RETURN REF_DATE + (TIMESTAMP_/SECONDS_PER_DAY);

    END FROM_UNIXTIME;

    **********************************************************************************************************************************

    CREATE OR REPLACE FUNCTION UNIX_TIMESTAMP

    (

    DATE_ IN DATE

    ) RETURN AS NUMBER

    NUMBER OF SECONDS_PER_DAY: = 86400;

    NUMBER OF DIFF_BETWEEN_DATES;

    MASK (50 CHAR) VARCHAR2: = 'DD-Mon-YYYY HH24:MI:SS ";

    DATE OF REF_DATE;

    BEGIN

    REF_DATE: = TO_DATE ('01 - ENE - 1970 00:00:00 ', MASK);

    DIFF_BETWEEN_DATES: = TO_DATE (TO_CHAR (SYS_EXTRACT_UTC (DATE_), MASK), MASK)

    -REF_DATE;

    RETURN DIFF_BETWEEN_DATES * SECONDS_PER_DAY;

    END UNIX_TIMESTAMP;

    ******************************************************************************************************************************

    Concerning

  • Oracle function to retrieve the records randomly

    I need function to select a random DB folder.

    For example, we have 500 records and an input to the function value is 5 ways, it must display the records randomly between 1 to 5

    Thank you

    Question is not clear, I thought that Oracle has always returned entries in random order... Do you expect the number of records between 1 & 5?

    Kind regards

  • Query regarding oracle functions

    Hi all

    I tried to work with decode them and output of NVL to get the following:

    Output value
    1 NULL
    0 1
    1 1
    2 2
    3 3


    to do this, I wrote the following query:
    SELECT DECODE (NVL(high_value,1), 0.1, NVL(high_value,1)) in tab1.

    Can there be a replacement of this using other functions?

    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    AMT for Solaris: release 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production

    Thank you
    Nikhil

    Can be with decoding

    with t_data as
    (
    select null as val from dual union all
    select 0 from dual union all
    select 1 from dual union all
    select 2 from dual union all
    select 3 from dual
    )
    SELECT
         val,decode(val,null,1,0,1, val) output
    from t_data
    
  • You must return the value of the Oracle function in VB Code

    Hi all

    I have the oracle APPTIDFUN (WHO RETURN NUMBER) function, I need to call in the VB Code. (Here's the code)

    --------------------------------
    If Msg2 = 6 Then
    Dim RS As New ADODB. Recordset
    Dim SQL As String
    RS. Open "appointments", CN, adOpenDynamic, adLockPessimistic
    RS. Find ' patient_id = ' "& str1 &" "'". "
    If RS. When the EOF
    RS. Find ' Appt_start_Date = ' "& str3 &" "'". "
    If RS. When the EOF
    RS. AddNew
    RS ("patient_id") = str1
    RS ("Appt_type") = str2
    RS ("Appt_start_Date") = str3
    RS ("Appt_end_date") = str4
    RS ("Num_days") = str5
    RS ("Total_Amount") = str6
    RS ("Inv_Number") = str7
    RS ("Approval_status") = str8
    RS ("NUM_WATCHER") = str9
    RS. Update

    ------------------------------------------------------------
    I want to call the function from oracle here that in the above code

    RS ("Appt_id") = < value of function >


    Please do the needful.

    Abdul,

    You need to change the line

    RS("Appt_Id") = RS1
    

    TO

    RS("Appt_Id") = RS1(0)
    

    Kind regards

    Manu.

    If my answer or the answer to another person has been useful or appropriate, please mark accordingly

  • T - SQL in ORACLE functions

    Use the T - SQL functions in ORACLE too, so you can write a script version that works in SYBASE, SQL SERVER and ORACLE when need to use the following functions:

    ceiling, charindex, dateadd, datediff, datename, datepart, day, db_id, db_name, getdate, host_id, host_name, left, len, month, replicate, right, space, str, str_replace, tips, substring, suser_id, suser_name, user_id, user_name and year.

    The file [comp_tsql_ORA_schema.txt | http://forums.databasejournal.com/attachment.php?attachmentid=564 & d = 1258547015] creates the tablespace and scheme to place objects and file [comp_tsql_ORA.txt | http://forums.databasejournal.com/attachment.php?attachmentid=569 & d = 1259256898] create the features in the new schema. They will be available for any diagram of the oracle instance.

    I hope this helps!
    Any suggestion, please contact.
    aklein2003

    Published by: user1958693 on 11/26/2009 10:16

    This makes sense if you migrate an application from sql server, oracle, and if a lot of t - sql functions is used in the application code that you don't want to bother with...

  • Problem with form of Oracle function

    Hi all

    I built various forms in Oracle Financials, but when I click in the menu option this error "is not available to this responsibility functions. Change responsibilities. or contact your system administrator. I can't see the form on the screen.

    Please, I need your help.

    Cordially Mariano. -.

    Hello

    Did you register this custom responsibility a custom form?

    You are able to access other forms customized to the same responsibility? If this is not the case, make sure that your CUSTOM_TOP is defined in the application env file and bounce application services.

    Note: 305792.1 - feature is not available for this error of responsibility after creating and saving a new form
    https://metalink2.Oracle.com/MetaLink/PLSQL/ml2_documents.showDocument?p_database_id=not&P_ID=305792.1

    Note: 553014.1 - R12 error "Feature is not available this responsibility" when trying to access Custom Form
    https://metalink2.Oracle.com/MetaLink/PLSQL/ml2_documents.showDocument?p_database_id=not&P_ID=553014.1

    Kind regards
    Hussein

  • error to the oracle function?

    Hello:

    Parameter of the week # of months in function to_char failed when I try to get the week # 14/01/2008. I use "select to_number (to_char (to_date ('01-14-2008', ' dd/mm/yyyy'), 'W')) from dual;" and I get 2 instead of 3

    Any idea? ...

    I am running oracle 8i database

    Any help would be much appreciated.

    Thank you

    Maybe you are looking for this?

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select to_date('01/01/2008','DD/MM/YYYY') + (rownum-1) as dt from dual connect by rownum <= 80)
      2  -- end of test data
      3  select dt
      4        ,to_char(dt,'D') as day_num
      5        ,to_char(dt,'DAY') as day_of_week
      6        ,trunc(to_char(dt,'DD')/7)+1 as week
      7* from t
    SQL> /
    
    DT          D DAY_OF_WE       WEEK
    ----------- - --------- ----------
    01-JAN-2008 2 TUESDAY            1
    02-JAN-2008 3 WEDNESDAY          1
    03-JAN-2008 4 THURSDAY           1
    04-JAN-2008 5 FRIDAY             1
    05-JAN-2008 6 SATURDAY           1
    06-JAN-2008 7 SUNDAY             1
    07-JAN-2008 1 MONDAY             2
    08-JAN-2008 2 TUESDAY            2
    09-JAN-2008 3 WEDNESDAY          2
    10-JAN-2008 4 THURSDAY           2
    11-JAN-2008 5 FRIDAY             2
    12-JAN-2008 6 SATURDAY           2
    13-JAN-2008 7 SUNDAY             2
    14-JAN-2008 1 MONDAY             3
    15-JAN-2008 2 TUESDAY            3
    16-JAN-2008 3 WEDNESDAY          3
    17-JAN-2008 4 THURSDAY           3
    18-JAN-2008 5 FRIDAY             3
    19-JAN-2008 6 SATURDAY           3
    20-JAN-2008 7 SUNDAY             3
    21-JAN-2008 1 MONDAY             4
    22-JAN-2008 2 TUESDAY            4
    23-JAN-2008 3 WEDNESDAY          4
    24-JAN-2008 4 THURSDAY           4
    25-JAN-2008 5 FRIDAY             4
    26-JAN-2008 6 SATURDAY           4
    27-JAN-2008 7 SUNDAY             4
    28-JAN-2008 1 MONDAY             5
    29-JAN-2008 2 TUESDAY            5
    30-JAN-2008 3 WEDNESDAY          5
    31-JAN-2008 4 THURSDAY           5
    01-FEB-2008 5 FRIDAY             1
    02-FEB-2008 6 SATURDAY           1
    03-FEB-2008 7 SUNDAY             1
    04-FEB-2008 1 MONDAY             1
    05-FEB-2008 2 TUESDAY            1
    06-FEB-2008 3 WEDNESDAY          1
    07-FEB-2008 4 THURSDAY           2
    08-FEB-2008 5 FRIDAY             2
    09-FEB-2008 6 SATURDAY           2
    10-FEB-2008 7 SUNDAY             2
    11-FEB-2008 1 MONDAY             2
    12-FEB-2008 2 TUESDAY            2
    13-FEB-2008 3 WEDNESDAY          2
    14-FEB-2008 4 THURSDAY           3
    15-FEB-2008 5 FRIDAY             3
    16-FEB-2008 6 SATURDAY           3
    17-FEB-2008 7 SUNDAY             3
    18-FEB-2008 1 MONDAY             3
    19-FEB-2008 2 TUESDAY            3
    20-FEB-2008 3 WEDNESDAY          3
    21-FEB-2008 4 THURSDAY           4
    22-FEB-2008 5 FRIDAY             4
    23-FEB-2008 6 SATURDAY           4
    24-FEB-2008 7 SUNDAY             4
    25-FEB-2008 1 MONDAY             4
    26-FEB-2008 2 TUESDAY            4
    27-FEB-2008 3 WEDNESDAY          4
    28-FEB-2008 4 THURSDAY           5
    29-FEB-2008 5 FRIDAY             5
    01-MAR-2008 6 SATURDAY           1
    02-MAR-2008 7 SUNDAY             1
    03-MAR-2008 1 MONDAY             1
    04-MAR-2008 2 TUESDAY            1
    05-MAR-2008 3 WEDNESDAY          1
    06-MAR-2008 4 THURSDAY           1
    07-MAR-2008 5 FRIDAY             2
    08-MAR-2008 6 SATURDAY           2
    09-MAR-2008 7 SUNDAY             2
    10-MAR-2008 1 MONDAY             2
    11-MAR-2008 2 TUESDAY            2
    12-MAR-2008 3 WEDNESDAY          2
    13-MAR-2008 4 THURSDAY           2
    14-MAR-2008 5 FRIDAY             3
    15-MAR-2008 6 SATURDAY           3
    16-MAR-2008 7 SUNDAY             3
    17-MAR-2008 1 MONDAY             3
    18-MAR-2008 2 TUESDAY            3
    19-MAR-2008 3 WEDNESDAY          3
    20-MAR-2008 4 THURSDAY           3
    
    80 rows selected.
    
    SQL>
    
  • Writing user defined function the same way as the oracle functions

    Hi guys,.

    In one of the interviews, I saw the guy asked me to write a function defined by the user who will be the column name and the list of all values.

    For example

    Name: employees table
    Column name: Employee_Name

    Employee_name
    Scott
    Ivgun
    Jack
    Shane

    The query must be in this marker

    SELECT col_agg (Employee_name) emp_name of employees;

    The output must be

    Emp_names
    Scott, ivgun, jack, shane

    Please let me know if this is possible


    Any suggestions will be much appreciated.

    Thank you
    Ranjan

    You certainly could write what a user defined aggregate function if you wish...

    for example this function will consolidate channels in a CLOB...

    create or replace type clobagg_type as object
      (
      text clob,
      static function ODCIAggregateInitialize(sctx in out clobagg_type) return number,
      member function ODCIAggregateIterate(self in out clobagg_type, value in clob) return number,
      member function ODCIAggregateTerminate(self in clobagg_type, returnvalue out clob, flags in number) return number,
      member function ODCIAggregateMerge(self in out clobagg_type, ctx2 in clobagg_type) return number
      );
    /
    create or replace type body clobagg_type is
      static function ODCIAggregateInitialize(sctx in out clobagg_type) return number is
      begin
        sctx := clobagg_type(null) ;
        return ODCIConst.Success ;
      end;
      member function ODCIAggregateIterate(self in out clobagg_type, value in clob) return number is
      begin
        self.text := self.text || value ;
        return ODCIConst.Success;
      end;
      member function ODCIAggregateTerminate(self in clobagg_type, returnvalue out clob, flags in number) return number is
      begin
        returnValue := self.text;
        return ODCIConst.Success;
      end;
      member function ODCIAggregateMerge(self in out clobagg_type, ctx2 in clobagg_type) return number is
      begin
        self.text := self.text || ctx2.text;
        return ODCIConst.Success;
      end;
    end;
    /
    create or replace function clobagg(input clob) return clob
      deterministic
      parallel_enable
      aggregate using clobagg_type;
    / 
    
    SQL> select trim(',' from clobagg(ename||',')) as enames from emp;
    
    ENAMES
    -----------------------------------------------------------------------------------
    SMITH,ALLEN,WARD,JONES,MARTIN,BLAKE,CLARK,SCOTT,KING,TURNER,ADAMS,JAMES,FORD,MILLER
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as
      2    (select 'PFL' c1, 0 c2,110 c3 from dual union all
      3     select 'LHL', 0 ,111 from dual union all
      4     select 'PHL', 1, 111 from dual union all
      5     select 'CHL', 2, 111 from dual union all
      6     select 'DHL', 0, 112 from dual union all
      7     select 'VHL', 1, 112 from dual union all
      8     select 'CPHL', 0, 114 from dual union all
      9     select 'WDCL', 1, 114 from dual union all
     10     select 'AHL' ,2 ,114 from dual union all
     11     select 'NFDL', 3, 114 from dual)
     12  --
     13  -- end of test data
     14  --
     15  select trim(clobagg(c1||' ')) as c1, c3
     16  from (select * from t order by c3, c2)
     17  group by c3
     18* order by c3
    SQL> /
    
    C1                                     C3
    ------------------------------ ----------
    PFL                                   110
    LHL CHL PHL                           111
    DHL VHL                               112
    CPHL AHL NFDL WDCL                    114
    

    OK, it's more that a function it uses a type of object that connects in operation internal to the ODCI... but it does what you ask. :)

  • Page elements apex calling an Oracle function...

    Hello

    I try to call a function on my database from one page to the APEX. It is without doubt very basic but I searched a lot and I can't find any documentation on this topic, so I hope one of you can help out me.

    I wrote a function very basic example, which accepts a varchar type and returns a number.

    So what I want to do now is to create a region on the page with a text field where the user can input that is passed to the function key and then a display one element that shows the output of the function in the same area of the page.
     
    create or replace
    package pack_function_test
    is
    
    function fn_test (ca_character in VARCHAR2)
    return number;
    
    end;
     
    create or replace
    package body pack_function_test
    is
    
    function fn_test (ca_character in VARCHAR2)
    return number
    is
    
    vl_number  number(1);
    
    begin
    
    IF ca_character = 'A'
      then 
        vl_number  :=  1;
        
    elsif ca_character = 'B'
      then
        vl_number  :=  2;
        
    end if;
    
    RETURN vl_number;
    
    
        END;
    
    end;
    I got great help here in the past so I look forward to your responses.

    Thank you!

    Create (Advanced) dynamic action triggered by onchange of your entry point.

    Create a condition "is not zero" on the dynamic action.

    When the input element is null (condition is false), clear the displayed item.

    When the input element is not null (the condition is true), so a set of value on your item displayed. Using PL/SQL expression, type your function:

    pack_function_test.fn_test(:P123_MY_INPUT_ITEM)
    

    Under page to present elements, put P123_MY_INPUT_ITEM.

    For the type of selection, choose item (s), choose your destination from the list display element, press 'create '.

    For true and false actions, leave 'fire on loading the page"checked (on).

  • Do we not have an oracle function to select the non-null columns at the beginning

    Hello

    I have 8 columns. Some of them may be null.

    I want to display all 8 columns in my result. Columns not null will be first and no one at the end.

    Here is an example of data:

    Employee table:
     Employee_id   Emp_fname  emp_lname  emp_mname  dept salary emp_height  emp_weight
       1               aaa        ddd                d1   100      6           180
       2               bbb                ccc             120                 169
       3               dfe                           d2            5.9         223
    The expected result is:
    result1 result2   result3 result4  result5  result6 result7 result8
    1        aaa        ddd     d1       100     6        180
    2        bbb        ccc     120      169
    3        dfe        d2      5.9      223
    Thank you.

    Published by: BluShadow on July 12, 2012 16:12
    addition of {noformat}
    {noformat} tags for readability.  Please read {message:id=9360002} and do this yourself in future.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    945559 wrote:
    I'm using Oracle Database 11 g Release 11.2.0.3.0.

    Here is my sample data.

    CREATE TABLE saleshist (product VARCHAR2 (30), q1 NUMBER NUMBER of q2, q3 NUMBER, NUMBER of T4);
    INSERT INTO saleshist VALUES ('EE Oracle', 100, 123, null, 128);
    INSERT INTO saleshist VALUES (null, 'Partitioning', 100, 130, 128);

    desired output:
    col1, col2, col3 col4
    'Oracle EE', 100, 123, 128, null
    "Partitioning", 100,130,128, null

    It seems that you have 4 column headers, but 5 columns.

    Assuming that the character ' ~' never occurs in one of the columns:

    WITH   got_list           AS
    (
         SELECT     '~' || product
              || '~' || TO_CHAR (q1)
              || '~' || TO_CHAR (q2)
              || '~' || TO_CHAR (q3)
              || '~' || TO_CHAR (q4)     AS list
         FROM    saleshist
    )
    SELECT  REGEXP_SUBSTR (list,  '[^~]+', 1, 1)     AS col1
    ,       REGEXP_SUBSTR (list,  '[^~]+', 1, 2)     AS col2
    ,       REGEXP_SUBSTR (list,  '[^~]+', 1, 3)     AS col3
    ,       REGEXP_SUBSTR (list,  '[^~]+', 1, 4)     AS col4
    ,       REGEXP_SUBSTR (list,  '[^~]+', 1, 5)     AS col5
    FROM    got_list
    ;
    

    Output:

    COL1            COL2       COL3       COL4       COL5
    --------------- ---------- ---------- ---------- ----------
    Oracle EE       100        123        128
    Partitioning    100        130        128
    

    If you need a multiple character string, such as '? ~', to delimit the columns, then the same basic approach works, but the regular expression is messier.

    Product is just another column in this solution. Can be NULL, and it doesn't have to be unique.

Maybe you are looking for

  • How to install an older operating system?

    I have an old book of mac pro, it s about 7 or 8 years. Accidentally, I ve installed the new version of the OS and all of a sudden the laptop it s even not connect. In my opinion, is due to the new system and I wonder how to install and old BONES. Cl

  • Satellite A500 PSAR9E. Someone tryied to install the SSD to conn JSSD?

    Hello! Now my satellite A500 is completely disassembled and I am looking for what is inside and what is possible to upgrade. The most interesting for me is jssd connector on the bottom of the motherboard. This information was already mentioned on tos

  • Satellite P840 - Accessin the Bios or boot boot order

    Howdy all, first post here. I have a Satellite P840, part PSPJ6A - 00 h 001 Windows 8. I have difficulties to access the Bios or boot order. I need to boot from a CD/DVD and I can't go in the boot options to change the boot order. I tried F12 F2 repe

  • WRT160N: Wireless works great, Wired is slow

    I replaced my old router from Linksys 8 port with a WRT160N wireless so that my iPhone would have Wi - Fi in the House.  (AT & T network is not great where I live.) My iPhone yells now, great connectivity.  But my two desktop computers that are conne

  • Windows Mail - "a few errors have occurred during the processing of requested tasks"

    I get a window every time I have bring to the top of the box mailbox Windows that indicates that 'the host 'YAHOO' could not be found. Check that you have entered the server name correctly - the Yahoo Acct. "Protocol: Pop3, Port: 110, secure (SSL): n