Any idea what this function is meant for?

DB version:10gR2
Have you guys any idea what this function does?
create or replace function separate_1
    in_list varchar2,
    in_del varchar2 := ','
) return split_tbl pipelined
is
    l_idx    pls_integer;
    l_list    varchar2(32767) := in_list;
    l_value    varchar2(32767);
begin
    loop
        l_idx := instr(l_list,in_del);
        if l_idx > 0 then
            pipe row(substr(l_list,1,l_idx-1));
            l_list := substr(l_list,l_idx+length(in_del));
        else
            pipe row(l_list);
            exit;
        end if;
    end loop;
    return;
end separate_1;The comment for this functions says that this is used to split a string delimited by a comma separator. But i didn't understand this function. Can this functionality be achieved without a table function?

user10450365 wrote:
DB version:10gR2
Have you guys any idea what this function does?Odd that. Apart from a couple of parameter name changes it looks almost identical to a function I posted a couple of years back...
SQL> CREATE OR REPLACE TYPE split_tbl IS TABLE OF VARCHAR2(32767);
  2  /
Type created.
SQL> CREATE OR REPLACE FUNCTION split (p_list VARCHAR2, p_delim VARCHAR2:=' ') RETURN SPLIT_TBL PIPELINED IS
  2      l_idx    PLS_INTEGER;
  3      l_list   VARCHAR2(32767) := p_list;
  4      l_value  VARCHAR2(32767);
  5    BEGIN
  6      LOOP
  7        l_idx := INSTR(l_list, p_delim);
  8        IF l_idx > 0 THEN
  9          PIPE ROW(SUBSTR(l_list, 1, l_idx-1));
10          l_list := SUBSTR(l_list, l_idx+LENGTH(p_delim));
11        ELSE
12          PIPE ROW(l_list);
13          EXIT;
14        END IF;
15      END LOOP;
16      RETURN;
17    END SPLIT;
18  /
Function created.
SQL> SELECT column_value
  2  FROM TABLE(split('FRED,JIM,BOB,TED,MARK',','));
COLUMN_VALUE
FRED
JIM
BOB
TED
MARK

Similar Messages

  • I am trying to add a wireless printer and it keeps asking for an "Ipadmin" user name and password rather than my adminstrator password. Any ideas what this is??

    I am trying to add a wireless printer and it keeps asking for an "Ipadmin" user name and password rather than my adminstrator password. Any ideas what this is?

    OS X 10.7 Lion, 10.8 Mountain Lion & 10.9 Mavericks
    Reset Password starting from Recovery HD
    Start the computer,then press and hold down command and R keys to start into recovery partition.
    When you see the Apple logo, release the keys.
    Wait until  OS X Utilities window shows up.
    Move the mouse to the menubar at the top and click "Utilities", then select "Terminal"
    from the drop down.
    Terminal window will appear.
    Type in   resetpassword   and press enter on the keyboard.
    Leave the Terminal window open.
    Reset Password Utility window will open with Macintosh HD selected.
    Select the user account from the popup menu box.
    Enter a new password.
    Reenter the new password for the user.
    Enter a hint.
    Click the "Save" button.
    Click  in the menubar and select Restart.
    Log in.
    If Keychain dialog box appears, select “Create New Keychain”.

  • I just reinstalled iTunes, and it will not open, as it says iTunes library itl. was created from an earlier version. Any idea what this means, and how I can get itunes to open?

    I just reinstalled iTunes, and it will not open, as it says iTunes library itl. was created from an earlier version. Any idea what this means, and how I can get itunes to open?

    Many thanks.
    That suggests that another application has stashed old QuickTime componentry in your system files.
    So just in case we'll go looking for older QuickTime componentry in the most common locations for it to be stashed.
    First we'll need to change some view settings.
    In your Start menu, open Computer.
    In your Organise menu, select Folder Options.
    In the View tab, make sure that "Show hidden files and folders" is selected, and Hide extensions for known file types is unchecked.
    Click OK.
    Now in Computer, open your C:\ drive (or whichever drive you have your operating system installed on).
    Open the "Windows" folder.
    If you have a 32-bit version of Windows, open the "System32" folder.
    If you have a 64-bit version of Windows, open the "SysWOW64" folder.
    What files and folders can you see in there with QuickTime in the title? (In a standard installation of Quicktime you should be seeing precisely two files... QuickTime.qts and QuickTimeVR.qtx ... and no QuickTime folders whatsoever.)

  • Hi ERROR U41M1C212 for Update Elements 9 and PS CS5. Any Idea what it is? Thanks for Help.

    hi ERROR U41M1C212 for Update Elements 9 and PS CS5. Any Idea what it is? Thanks for Help.

    If you look at the bottom/right of this screen you have a list of links in 'More information like this'.
    Have a look at them.

  • ERRORS found during the burning process #-34506...any idea what this means?

    ERRORS found during the burning process #-34506...any idea what this means?
    This one project I want to copy to DVD keeps saying this when I go to burn (that is after nearly 2 hrs of processing). There is nothing wrong with the movie so i don't know why i'm having such a problem burning it. i guess to start i'd need to know what this code means (I couldn't find it in iDVD help).
    thanks in advance
    Jeremiah

    First I'd be certain that I had changed the preferences from best quality to best performance.
    Did you follow the chapter rules?
    *Make sure no chapter markers are within two seconds of the start or end of the timeline.
    *Make sure no chapter markers are within a transition.
    *Make sure no chapter markers are within two seconds of the end of a transition.
    You may have already done this, but
    Quit iDVD. Search for the file named com.apple.iDVD.plist and trash it. (A new one will be created next launch of iDVD.) Or look in: User/Library/Preferences. This may solve project loading errors too. Restart and use Disk Utility to Repair Permissions.
    :)Sue

  • My videos on iPhoto no longer play ... the message reads OSStatus error -54.    anyone any idea what this might mean?

    My videos on iPhoto no longer play ... the message reads OSStatus error -54.    anyone any idea what this might mean?

    Hi Terence,
    FWIW...
    I just restored my entire iPhoto library from Time Machine.  I'm running Yosemite.  After opening iPhoto for the first time after restoring the DB, it asked me to confirm my library location.  Then it proceeded to update all the thumbnails.  After this was completed, I observed what the OP reported: all photos work normally, but all videos were a.) missing thumbnails; and b.) yielding this error code when attempting to open.
    HOWEVER.  Doing a Reveal in Finder showed the videos on disk, and they were playable.  After quitting iPhoto and restarting it, it *again* said it was updating thumbnails, and now all the videos both have the thumbnails and play correctly from within iPhoto.

  • Any idea what this characher is?

    DB version:10gR2
    Found this character in a table. I don't know how this got inserted. Any idea what this characher is?Even though it appears as a hypen here in OTN, this looks like a miniature square block in sqlplus.
    SELECT DUMP('–') FROM DUAL;
    DUMP('–')
    Typ=96 Len=1: 150Edited by: Citizen_2 on Feb 12, 2009 12:45 AM

    It also depends on the character set being used by your database and the tool that you are displaying the characters in as to how they then get represented...
    For a quick look at your own character set... (assuming 8 bit chr set, but can be adapted for larger sets if necessary)...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select ascii, decode(ascii,7,null,9,null, ch) as ch, col, rn
      2             from (select rownum-1 as ascii
      3                         ,chr(rownum-1) as ch
      4                         ,trunc((rownum-1)/64) as col
      5                         ,row_number() over (partition by trunc((rownum-1)/64) order by rownum) as rn
      6                   from dual connect by rownum <= 256
      7                  )
      8            )
      9  --
    10  select t1.ascii, t1.ch
    11        ,t2.ascii, t2.ch
    12        ,t3.ascii, t3.ch
    13        ,t4.ascii, t4.ch
    14  from (select * from t where col = 0) t1
    15      ,(select * from t where col = 1) t2
    16      ,(select * from t where col = 2) t3
    17      ,(select * from t where col = 3) t4
    18  where t1.rn = t2.rn
    19  and   t2.rn = t3.rn
    20* and   t3.rn = t4.rn
    SQL> /
         ASCII C      ASCII C      ASCII C      ASCII C
             0           64 @        128 Ç        192 └
             1 ☺         65 A        129 ü        193 ┴
             2 ☻         66 B        130 é        194 ┬
             3 ♥         67 C        131 â        195 ├
             4 ♦         68 D        132 ä        196 ─
             5 ♣         69 E        133 à        197 ┼
             6 ♠         70 F        134 å        198 ã
             7           71 G        135 ç        199 Ã
             8           72 H        136 ê        200 ╚
             9           73 I        137 ë        201 ╔
            10           74 J        138 è        202 ╩
            11 ♂         75 K        139 ï        203 ╦
            12 ♀         76 L        140 î        204 ╠
            13           77 M        141 ì        205 ═
            14 ♫         78 N        142 Ä        206 ╬
            15 ☼         79 O        143 Å        207 ¤
            16 ►         80 P        144 É        208 ð
            17 ◄         81 Q        145 æ        209 Ð
            18 ↕         82 R        146 Æ        210 Ê
            19 ‼         83 S        147 ô        211 Ë
            20 ¶         84 T        148 ö        212 È
            21 §         85 U        149 ò        213 ı
            22 ▬         86 V        150 û        214 Í
            23 ↨         87 W        151 ù        215 Î
            24 ↑         88 X        152 ÿ        216 Ï
            25 ↓         89 Y        153 Ö        217 ┘
            26 →         90 Z        154 Ü        218 ┌
            27 ←         91 [        155 ø        219 █
            28 ∟         92 \        156 £        220 ▄
            29 ↔         93 ]        157 Ø        221 ¦
            30 ▲         94 ^        158 ×        222 Ì
            31 ▼         95 _        159 ƒ        223 ▀
            32           96 `        160 á        224 Ó
            33 !         97 a        161 í        225 ß
            34 "         98 b        162 ó        226 Ô
            35 #         99 c        163 ú        227 Ò
            36 $        100 d        164 ñ        228 õ
            37 %        101 e        165 Ñ        229 Õ
            38 &        102 f        166 ª        230 µ
            39 '        103 g        167 º        231 þ
            40 (        104 h        168 ¿        232 Þ
            41 )        105 i        169 ®        233 Ú
            42 *        106 j        170 ¬        234 Û
            43 +        107 k        171 ½        235 Ù
            44 ,        108 l        172 ¼        236 ý
            45 -        109 m        173 ¡        237 Ý
            46 .        110 n        174 «        238 ¯
            47 /        111 o        175 »        239 ´
            48 0        112 p        176 ░        240
            49 1        113 q        177 ▒        241 ±
            50 2        114 r        178 ▓        242 ‗
            51 3        115 s        179 │        243 ¾
            52 4        116 t        180 ┤        244 ¶
            53 5        117 u        181 Á        245 §
            54 6        118 v        182         246 ÷
            55 7        119 w        183 À        247 ¸
            56 8        120 x        184 ©        248 °
            57 9        121 y        185 ╣        249 ¨
            58 :        122 z        186 ║        250 ·
            59 ;        123 {        187 ╗        251 ¹
            60 <        124 |        188 ╝        252 ³
            61 =        125 }        189 ¢        253 ²
            62 >        126 ~        190 ¥        254 ■
            63 ?        127 ⌂        191 ┐        255  
    64 rows selected.
    SQL>
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Any idea what this query is trying to do?

    Do you guys have any idea what this query(used for report generation) is used for? I don't understand the WHERE clause of this query especially what the Pipe operators(|| ' 21:00:00') are used for?
    SELECT c.course_id,
           mph.subject
    from   courses c, main_pgm_hdr mph
    where
    c.classid=mph.classid
        AND
        TO_CHAR(MPH.CLOSE_DATE, 'mm/dd/yyyy hh24:mi:ss') >= TO_CHAR(TRUNC(SYSDATE, 'MM') - 1, 'mm/dd/yyyy')
            || ' 21:00:00'
        AND TO_CHAR(MPH.CLOSE_DATE, 'mm/dd/yyyy hh24:mi:ss') <= TO_CHAR(SYSDATE, 'mm/dd/yyyy')
            || ' 20:59:59'Edited by: user10450365 on Jan 13, 2009 7:11 PM

    They are trying to get the data having CLOSE_DATE between 20:59:59 and 21:00:00 for the present day. But the way its done is wrong. They have converted the date into Char and they are comparing. Its absolutely incorrect.
    One way to do it would be
    SELECT DISTINCT (PS.CARR_ID)                                  AS CARRIER  ,
         MPH.SHPMT_NBR                                          AS TRAILER  ,
         MPH.SHPMT_NBR                                          AS SHPMT_NBR,
         TO_CHAR(MPH.CREATE_DATE_TIME, 'mm/dd/yyyy hh24:mi:ss') AS LOADED   ,
         TO_CHAR(MPH.CLOSE_DATE, 'mm/dd/yyyy hh24:mi:ss')       AS FINALIZED
       FROM PARCL_SERV PS,
         MANIF_PARCL_HDR MPH
      WHERE PS.MANIF_TYPE = MPH.MANIF_TYPE
        AND MPH.CLOSE_DATE >= TRUNC(sysdate)+(21/24)
        AND MPH.CLOSE_DATE <= TRUNC(sysdate)+((20/24)+(59/1440)+(59/86400))Edited by: Karthick_Arp on Jan 13, 2009 1:27 AM

  • Support code 5011, any ideas what this means.

    I purchase a MX452 printer upon start up I'm getting support code 5011, any ideas what this means.

    Hello everyone,
    If the error remains after unplugging the printer for at least 10 minutes, it may require service (and please note that unplugging it will delete any faxes stored in the machine's memory).
    It would be best to get in touch with our technical support team at http://bit.ly/Phone_Support for further assistance.
    Thanks!
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • I am getting an "error -5000" message when I try to backup my iphone 4 to itunes.  Any ideas what this means?

    i am getting an "error -5000" message when I try to backup my iphone 4 to itunes.  Any ideas what this means?

    Take a look at this link, http://support.apple.com/kb/ts1424

  • I have an iphone 3g on the top bar left of the battery symbol i have an icon of a lock with a cirular arrow around the lock any ideas what this is

    hi my 3g ipone has problems connecting to a wifi hotspot,on the top next to battery symbol is a LOCK ICON with a circular arrow around lock .anyone have any idea what this signfies and could it be something to do with the wifi problems

    It's orientation lock. Double tap the home button, swipe left to right, far left is the orientation lock. Tap on/off. Tap home button when finished.

  • TS4431 Hi after trying to update my iPhone 5s while connected to iTunes on the Mac I got a notice saying it could not update the phone (error message: (-1)). Any idea what this error message means? Is it a space issue?

    Hi after trying to update my iPhone 5s while connected to iTunes on the Mac I got a notice saying it could not update the phone (error message: (-1)). Any idea what this error message means? Is it a space issue?

    Resolve iOS update and restore errors

  • Trouble uploading to shootproof, keep getting an error that says "internal error, name not unique, color" any idea what this is and how to resolve it?

    trouble uploading to shootproof, keep getting an error that says "internal error, name not unique, color" any idea what this is and how to resolve it?

    Note that you should be cautious when you get the 'untrusted' error message and that you should never create a permanent exception in cases like this without investigating the cause.
    If you have created a permanent exception then best is to remove it in the Server tab in the Certificate Manager.
    *Tools > Options > Advanced > Certificates/Encryption: View Certificates

  • HT3275 iMac.sparsebundle" is already in use  ...any idea what this is ?

    iMac.sparsebundle” is already in use  ...any idea what this is ?

    If you are running Mountain Lion and getting this message when trying to backup,  try this:
    Open AirPort Utility (If you are in Mountain Lion this will be 6.0 or Higher)
    Select you Time Capsule
    Select the Disk Tab
    Deselect "Enable File Sharing"
    Click OK Let the Time Capsule Re-Boot
    Go Back into AirPort Utility and re-select "Enable File Sharing" and let it Re-Boot again.
    This should fix the problem.
    If you are not running Mountain Lion the advice provided by other should work  (http://pondini.org/TM/C12.html).  The main thing is to reset users.

  • Hi, I'm moving my site from MobileMe to Filezilla and there is apparently a coding error on iWeb that means when I try to get onto my site there's no access online and it says there are too many redirects. Anyone have any idea what this might be?

    Hi, I'm moving my site from MobileMe to Filezilla and there is apparently a coding error on iWeb that means when I try to get onto my site there's no access online and it says there are too many redirects. Anyone have any idea what this might be?

    Well, firstly Filezilla is not a hosting company but an ftp client that helps you upload your site to your new server. You need to purchase a new hosting account first though.
    If you have iWeb 09 then you can publish directly to your new host and you select the publish to ftp option and not MobileMe - MobileMe won't be here after tomorrow.
    You can also publish to a local folder if want to and use Filezilla to upload your site to your server.
    You don't need re-directs as MobileMe won't be here so you need to cancel and delete your domain name from your MobileMe account and then cancel any domain name forwarding that you have at your domain name registrar - that is what the redirects are about.
    Firstly ensure that you have your new hostings account - Filezilla is not a host, rather an ftp client that you use to upload your site.

Maybe you are looking for