Need to get result in vertical way

Hi,
declare
string_to_parse varchar2(2000) := 'abcdefg,hiklmnopqrst';
l_count number;
l_value varchar2(2000);
begin
string_to_parse := string_to_parse||',';
l_count := length(string_to_parse) - length(replace(string_to_parse,',',''));
-- In oracle 11g use regexp_count to determine l_count
for i in 1 .. l_count loop
select regexp_substr(string_to_parse,'[^,]+',1,i) into l_value from dual;
dbms_output.put_line(l_value);
end loop;
end;
if i run this i get ans as
abcdefg
hiklmnopqrst
but i need the answer like
a
b
c
could any one help me to get like this

To add something to Lee's code
declare
     string_to_parse varchar2(2000) := 'abcdefg,hiklmnopqrst';
     l_count number;
     l_value varchar2(2000);
     i number := 1;
begin
     l_count := length(string_to_parse);
     l_value := substr(string_to_parse,1,instr(string_to_parse,',')-1);
     l_value := l_value || substr(string_to_parse,instr(string_to_parse,',')+1,l_count);
     l_count := length(l_value);
     while i <= l_count loop
          dbms_output.put_line(substr(l_value,i,1));
          i := i + 1;
     end loop;
end;
/I know I missed out the comments, if you want me to explain, I can do it.

Similar Messages

  • How to get result of Select from stored function.

    I need to get result of select from a stored function.
    In the end of my stored function I makes final select (four columns).
    How it can be retrived from function?

    Hi,
    A function can only return one value, but it sounds like you want to return 4 values.
    The one value that you return can be a record, with many columns, such as a ROWTYPE, or a TYPE that you define.
    You can return an XMLTYPE that has whatever elements you want.
    You can write a procedure that has several OUT parameters. (You can have OUT parameters in a function, but a lot of people find that confusing.)
    In very special circumstance, you might consider returning a string that is a delimited list of values, such as '7639,SMITH,,17-DEC-1980'.
    Someoneelse has a good point.
    We could give a better answer if you ask a specific question, like:
    "I have this table ...
    I want a function such that, if I call it with these parameters ... I get ...
    but if I call it like this ... then I get ..."

  • How to get result of MDM validation expression with type warning?

    I need  to get result of MDM validation expression with type WARNING (in automatic execution),
    but - method validationResult.getFailedValidations(..) returns validation if it has type ERROR,
    so all Warnings treated only as success despite it returned false or true.
    My question - how can I get that 'false or true' expression resut for validation.
    thanks

    Hello Vladimir
    By my opinion, hook warning exception isn't make sense because after warning message data will be change(upload).
    Moreover  if you start validation from WF Warning exception doesn't work at all.
    If you want to do some data changes you should use and hook Error exception.
    Regards
    Kanstantsin Chernichenka

  • So I'm trying to get a window to fit my mac. Its a window on pokerstars if that helps, so no minimize/maximize. The window is actually too long vertical ways to fit the screen so the bottom is cut off? I hid bottom toolbar but still no help :-/ any help?

    So I'm trying to get a window to fit my mac. Its a window on pokerstars if that helps, so no minimize/maximize. The window is actually too long vertical ways to fit the screen so the bottom is cut off? I hid bottom toolbar but still no help :-/ any help? Yeah i have no fit screen button, the top toolbar doesnt have zoom/minimize available... any help???

    Hi RobSten1306
    Send us an email if you need help on this case and we can help look into this for you.
    You can email us using the contact the mods link in my profile under the section 'About Me'.
    Thanks
    Stuart
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • Need help to get alternate or better way to write query

    Hi,
    I am on Oracle 11.2
    DDL and sample data
    create table tab1 -- 1 millions rows at any given time
    id       number       not null,
    ref_cd   varchar2(64) not null,
    key      varchar2(44) not null,
    ctrl_flg varchar2(1),
    ins_date date
    create table tab2 -- close to 100 million rows
    id       number       not null,
    ref_cd   varchar2(64) not null,
    key      varchar2(44) not null,
    ctrl_flg varchar2(1),
    ins_date date,
    upd_date date
    insert into tab1 values (1,'ABCDEFG', 'XYZ','Y',sysdate);
    insert into tab1 values (2,'XYZABC', 'DEF','Y',sysdate);
    insert into tab1 values (3,'PORSTUVW', 'ABC','Y',sysdate);
    insert into tab2 values (1,'ABCDEFG', 'WYZ','Y',sysdate);
    insert into tab2 values (2,'tbVCCmphEbOEUWbxRKczvsgmzjhROXOwNkkdxWiPqDgPXtJhVl', 'ABLIOWNdj','Y',sysdate);
    insert into tab2 values (3,'tbBCFkphEbOEUWbxATczvsgmzjhRQWOwNkkdxWiPqDgPXtJhVl', 'MQLIOWNdj','Y',sysdate);I need to get all rows from tab1 that does not match tab2 and any row from tab1 that matches ref_cd in tab2 but key is different.
    Expected Query output
    'ABCDEFG',  'WYZ'
    'XYZABC',   'DEF'
    'PORSTUVW', 'ABC'Existing Query
    select
       ref_cd,
       key
    from
        select
            ref_cd,
            key
        from
            tab1, tab2
        where
            tab1.ref_cd = tab2.ref_cd and
            tab1.key    <> tab2.key
        union
        select
            ref_cd,
            key
        from
            tab1
        where
            not exists
               select 1
               from
                   tab2
               where
                   tab2.ref_cd = tab1.ref_cd
        );I am sure there will be an alternate way to write this query in better way. Appreciate if any of you gurus suggest alternative solution.
    Thanks in advance.

    Hi,
    user572194 wrote:
    ... DDL and sample data ...
    create table tab2 -- close to 100 million rows
    id       number       not null,
    ref_cd   varchar2(64) not null,
    key      varchar2(44) not null,
    ctrl_flg varchar2(1),
    ins_date date,
    upd_date date
    insert into tab2 values (1,'ABCDEFG', 'WYZ','Y',sysdate);
    insert into tab2 values (2,'tbVCCmphEbOEUWbxRKczvsgmzjhROXOwNkkdxWiPqDgPXtJhVl', 'ABLIOWNdj','Y',sysdate);
    insert into tab2 values (3,'tbBCFkphEbOEUWbxATczvsgmzjhRQWOwNkkdxWiPqDgPXtJhVl', 'MQLIOWNdj','Y',sysdate);
    Thanks for posting the CREATE TABLE and INSERT statments. Remember why you go to all that trouble: so the people whop want to help you can re-create the problem and test their ideas. When you post statemets that don't work, it's just a waste of time.
    None of the INSERT statements for tab2 work. Tab2 has 6 columns, but the INSERT statements only have 5 values.
    Please test your code before you post it.
    I need to get all rows from tab1 that does not match tab2 WHat does "match" mean in this case? Does it mean that tab1.ref_cd = tab2.ref_cd?
    and any row from tab1 that matches ref_cd in tab2 but key is different.
    Existing Query
    select
    ref_cd,
    key
    from
    select
    ref_cd,
    key
    from
    tab1, tab2
    where
    tab1.ref_cd = tab2.ref_cd and
    tab1.key    <> tab2.key
    union
    select
    ref_cd,
    key
    from
    tab1
    where
    not exists
    select 1
    from
    tab2
    where
    tab2.ref_cd = tab1.ref_cd
    Does that really work? In the first branch of the UNION, you're referencing a column called key, but both tables involved have columns called key. I would expect that to cause an error.
    Please test your code before you post it.
    Right before UNION, did you mean
    tab1.key    != tab2.key? As you may have noticed, this site doesn't like to display the &lt;&gt; inequality operator. Always use the other (equivalent) inequality operator, !=, when posting here.
    I am sure there will be an alternate way to write this query in better way. Appreciate if any of you gurus suggest alternative solution.Avoid UNION; it can be very inefficient.
    Maybe you want something like this:
    SELECT       tab1.ref_cd
    ,       tab1.key
    FROM           tab1
    LEFT OUTER JOIN  tab2  ON  tab2.ref_cd     = tab1.ref_cd
    WHERE       tab2.ref_cd  IS NULL
    OR       tab2.key     != tab1.key
    ;

  • I am trying to make a pdf of a file and I need to get the file size to be no bigger than 10MB. What is the best way to do this

    I am trying to make a pdf of a file and I need to get the file size to be no bigger than 10MB. Even when I save it, the image quality at minimum the file size is 10.9 MB. What is the best way to do this

    @Barbara – What purpose is that PDF for? Print? Web?
    If web purpose, you could convert CMYK images to sRGB. That would reduce the file size as well.
    A final resort to bring down file size is:
    1. Print to PostScript
    2. Distill to PDF
    That would bring file size down even more. About 20%, depending on the images and other contents you are using, compared with the Acrobat Pro method. If you like you could send me a personal message, so we could exchange mail addresses. I could test for you. Just provide the highres PDF without any downsampling and transparency intact. Best provide a PDF/X-4.
    I will place the PDF in InDesign, print to PostScript, distill to PDF.
    Uwe

  • My computer crashed and I have to get my data from my old drive to another computer, to ensure I get all my data what do I need to get.  I have and ipad and an iphone.  I need to get apps, contacts, pictures, etc.  Is there a way to do this?

    My computer crashed and I have to get my data from my old drive to another computer, to ensure I get all my data what do I need to get.  I have and ipad and an iphone.  I need to get apps, contacts, pictures, etc.  Is there a way to do this? It was a vista pc and the new is win 7. I can grab the backup files, and music, but what about my apps? I do not want to sync on the new pc since the apps aren't there.  Were are the app files located in itunes? Can I just copy them to the new computer?

    You can transfer itunes purchases:  File>Devices>Transfer Purchases
    The iphone is not a storage/backup device.  The sync is one way - computer to iphone.  The exception is itunes purchases.
    It has always been very basic to always maintain a backup copy of your computer.  Use your backup copy to put everything back.

  • I've recently messed up my Mac OS X Lion by deleting Aperture, but I need to get my data out of the computer. And by the way, I've got an important project in Final Cut Pro X. Is there any way I can back it up (including fxs and positions of the clip) ?

    Hello everyone
    I've recently messed up my Mac OS X Lion by deleting Aperture, but I need to get my data out of the computer. I've tried to repair it using DU, but it said I needed to backup all my data and reinstall the OS. How do I backup my data to an external drive?
    And by the way, I've got an important project in Final Cut Pro X. Is there any way I can back it up (including fxs and positions of the clip) ?
    Hope you guys can help me!

    You need to back up 2 folders, Final Cut Events and Final Cut Projects which by default are located on your Movies Folder. You can always check by clicking on a clip inside Fianl Cut X and selecting Show in Finder in the contextual menu for the selected clip.

  • I am moving from Southern California to Maui, Hawaii and I need to figure out the best way to get my 24 inch iMac across the ocean. Does anyone know the best way to do this?

    I am moving from Southern California to Maui, Hawaii and I need to figure out the best way to get my 24 inch iMac across the ocean. Does anyone know the best way to do this? I have found GearGrip's LCD harness so that I can do carry-on onto the plane...  Or maybe use a Pelican Case to do it as a "checked bag"? Or any other suggestions??! Please help!
    Thanks so much!!

    I don't recommend you send the iMac in a checked bag. Might get damaged.
    Check the airlines website for carry on guidelines.
    Or, if you have the original box that the iMac came in, if you have someone who can pick up the iMac for you, send it ahead Fed Ex and insure the package.
    Just make sure the display is covered to protect it. A blanket perhaps.
    Aloha ...

  • HT1338 My Mac Book Pro is currently runnng OS X v10.5.8. When I check for updates by clicking the apple icon it tells me that my computer is up to date.  What is the easiest way to upgrade to OS X Lion?  Do I need to get OS X Snow Leopard first?

    My Mac Book Pro is currently runnng OS X v10.5.8. When I check for updates by clicking the apple icon it tells me that my computer is up to date.  What is the easiest way to upgrade to OS X Lion?  Do I need to get OS X Snow Leopard first?

    Yes, there's been no updates to 10.5.8 for quite awhile, next is paid Upgrades.
    Snow Leopard/10.6.x Requirements...
    General requirements
       * Mac computer with an Intel processor
        * 1GB of memory (I say 4GB at least)
        * 5GB of available disk space (I say 30GB at least)
        * DVD drive for installation
        * Some features require a compatible Internet service provider; fees may apply.
        * Some features require Apple’s MobileMe service; fees and terms apply.
    Which apps work with Mac OS X 10.6?...
    http://snowleopard.wikidot.com/
    It looks like they might still have it...
    http://store.apple.com/us/product/MC573Z/A?fnode=MTY1NDAzOA
    If it's a core Duo & not a Core2Duo, then it'll only run in 32 bit mode.
    Lion/101.7 System requirements
        •    x86-64 processor (Macs with an Intel Core 2 Duo, Intel Core i3, Intel Core i5, Intel Core i7, or Xeon processor.)
        •    At least 2GB of memory, I say 6 GB
        •    Latest version of Mac OS X Snow Leopard (10.6.8), with the Mac App Store installed
        •    At least 4GB of disk space for downloading, I say 50 GB.
    Like Snow Leopard, Lion does not support PowerPC-based Macs (e.g., Power Macs, PowerBooks, iBooks, iMacs (G3-G5), eMacs).
    Lion also does not support 32-bit Intel Core Duo or Core Solo based Macs. Rosetta is no longer available in Lion, which means Lion no longer supports PowerPC applications.
    http://en.wikipedia.org/wiki/Mac_OS_X_Lion#System_requirements
    http://www.apple.com/macosx/how-to-buy/
    What applications are not compatible with Mac OS X 10.7 "Lion"?
    http://ow.ly/5Iz09
    http://roaringapps.com/apps:table

  • I have an 8gb iPhone 4 and i need more space, is there a way to get more space rather then buying a whole new phone?

    I have an 8gb iPhone 4 and i need more space, is there a way to get more space rather then buying a whole new phone?

    No. Sell the 8gb and buy one with more capacity.

  • I deleted a very important paper that i really need to get back is there any way that i can????

    I deleted a very important paper on pages that I really need to get back. Is there a way????? PLEASE HELP ME!!!!!!!

    I Am no expert for sure but my Mac does auto save on most everything I do.  If you've saved previous versions you might be able to find a previous version of the document.  I'd look for previous versions.  Hope an expert helps you.  Good luck.

  • I sent my Iphone 5c in for repair and when they sent it back my sim card wasn't in it is there any way i can have them send it back or do I need to get a new sim card for it?

    I sent my Iphone 5c in for repair and when they sent it back my sim card wasn't in it is there any way i can have them send it back or do I need to get a new sim card for it?

    You'll have to get a new one from your carrier. I believe the shipping instructions for mail in service explicitly tell you to take it out as you will most likely not receive the same phone back. Apple doesn't repair most phones, they replace them.

  • HT3964 I am getting the error message "No AirPort card installed" Restarting my iMac desktop does not solve this (Apple help says I need to reset the SMC this way, but nothing changes. Can somebody advise, please?

    I am getting the error message "No AirPort card installed" Restarting my iMac desktop does not solve this (Apple help says I need to reset the SMC this way, but nothing changes). Can somebody advise, please?

    Thanks for the flag J.K. - they contaced me and solved my problem.  On this account (which I created just to ask this question), I log in with my email rather than my user name (mtalldud). On the account that I was having trouble with, they told me to use my user ID instead of my email to log in and it worked. This is a bit confusing and seems a bit inconsistent but at least I don't need this temporary account any more to get into this community and find answers!

  • HT201441 i bought my iphone secondhand, and the previous owner didnt deltete his find my iphone account, so when i restored it i know cant access my phone, i need help as i have no way of getting intouch with the previous owner whatsoever :/ help!

    i bought my iphone secondhand, and the previous owner didnt deltete his find my iphone account, so when i restored it i know cant access my phone, i need help as i have no way of getting intouch with the previous owner whatsoever :/ help!

    Welcome to the Apple community.
    Unfortunately, you cannot do very much with your phone unless you get assistance from the previous owner, they should either provide you with the password to unlock it or remove their account from the phone entirely remotely through iCloud.com > Find My Phone.

Maybe you are looking for