How I can display the values in one row when they come from the same colum

This query
SELECT
sorints_ints_code
FROM
saturn.sorints a,
connman.cc_adm_prospect_master
WHERE
sorints_ints_code like 'Z%'
and sorints_pidm = prospect_pidm
give me the results of
ZA
ZB
ZC
I want to use this query in a cursor to update a column in another table, the problem is that I need to update the table concatenating the values ZA,ZB,ZC
I have 24 different codes stored in the column sorints_ints_code, so I don’t want to use 24 different cursors and I don’t to use cross reference, It is there any way that I DON’T know to display the data like this za,zb,zc without using cross reference, I don’t want to use the table 24 times…
Like THIS, this is only for two values…
SELECT
a.sorints_ints_code,
b. sorints_ints_code
FROM
saturn.sorints a,
saturn.sorints b
connman.cc_adm_prospect_master
WHERE
a.sorints_ints_code = ‘ZA’
AND a.sorints_ints_code = ‘ZB’
and a.sorints_pidm = prospect_pidm
and b.sorints_pidm = prospect_pidm
REMEMBER, I have 24 different values
I am trying to write a procedure like this;
Someone suggest this v_int_code1 := v_int_code1||interest_coach_rec.sorints_ints_code;
BUT IT IS NOT WORKING!!!
PROCEDURE prospect_coach_interest_upd
p_prospect_term_code IN srbrecr.srbrecr_term_code%TYPE,
p_prospect_admin_err_code OUT VARCHAR2,
p_ora_err_code OUT NUMBER,
p_ora_err_msg OUT VARCHAR2
) IS
v_out_path VARCHAR2(40) := '/home/connman/student';
v_out_file VARCHAR2(40) := 'cc_adm_prospect_'||p_prospect_term_code||'_'||TO_CHAR(SYSDATE,'YYYYMMDDHH');
v_file_handle UTL_FILE.FILE_TYPE;
v_pidm NUMBER;
v_int_code1 varchar2(30);
v_int_code2 varchar2(2);
v_int_code3 varchar2(2);
CURSOR cur_pidms IS
SELECT prospect_pidm
FROM connman.cc_adm_prospect_master
WHERE prospect_term_code = p_prospect_term_code
FOR UPDATE;
CURSOR interest_coach_cur is
SELECT
sorints_ints_code
FROM
saturn.sorints
WHERE
sorints_ints_code like 'Z%'
and sorints_pidm = v_pidm ;
interest_coach_rec interest_coach_cur%ROWTYPE;
BEGIN
UTL_FILE.FCLOSE_ALL;
v_file_handle := UTL_FILE.FOPEN (v_out_path, v_out_file, 'a');
UTL_FILE.PUT_LINE (v_file_handle,
CHR (10) || TO_CHAR (SYSDATE, 'DD-MON-YYYY HH:MI:SS')
UTL_FILE.PUT_LINE (v_file_handle, 'Entering the Admin Name procedure.');
--- BEGIN
FOR rec_pidms IN cur_pidms
LOOP
EXIT WHEN cur_pidms%NOTFOUND;
v_pidm := rec_pidms.PROSPECT_pidm;
v_int_code1 := v_int_code1||interest_coach_rec.sorints_ints_code;
IF interest_coach_cur%ISOPEN
THEN
CLOSE interest_coach_cur;
END IF;
OPEN interest_coach_cur;
FETCH interest_coach_cur
INTO interest_coach_rec;
IF interest_coach_cur%FOUND
THEN
UPDATE
connman.cc_adm_prospect_master
SET
PROSPECT_COACH_INTEREST = interest_coach_rec.sorints_ints_code
WHERE CURRENT OF cur_pidms;
END IF;
END LOOP;
COMMIT;
p_prospect_admin_err_code := '0';
UTL_FILE.put_line (v_file_handle, 'Successful Completion.');
EXCEPTION
WHEN OTHERS
THEN
p_prospect_admin_err_code := '1';
p_ora_err_msg := SUBSTR (SQLERRM, 1, 2000);
p_ora_err_code := SQLCODE;
END; -- prospect_coach_interest_upd;

Search in the forum or web you will find many solutions
Return multi-row result as one comma-delimited row
http://www.oracle-developer.net/display.php?id=412

Similar Messages

  • I recently bought a Macbook Air and a Thunderbolt Display and the laptop's power is supposed to come from the display, but the power cable on the display does not fit into the Macbook Air.

    I recently bought a 11" Macbook Air and a 27" Thunderbolt Display.The laptop's power is supposed to come from the display when connected, but the power cable on the display does not fit into the Macbook Air.

    If your MBair is a 2012 model, it has a Magsafe 2 power connection.  The monitor probably has the old magsafe connection.  If this is the case, you need this adapter.
    http://store.apple.com/us/product/MD504ZM/A?fnode=5a

  • How do I add HD space on one side and take away from the other?

    Hi All,
    I'm looking for some help and I have faith some people here can assist.
    I recently used Apple's Boot Camp to put Windows XP on my MacBook Pro. So, I currently have 1 hard drive that is partitioned into two -- one for the mac, and the other for the PC.
    I would like to add more hard drive space on the MAC side of things, and take away from some of the space on the PC side. What is the best way to go about doing this?
    I've been told a program like Partition Magic or something might work...but I'm looking to see what people have done in the past and what the most successful route would be. I'm sure I'm not the only one that has done this.
    Thanks so much,

    Hi,
    WinClone can do this http://twocanoes.com/winclone/
    And in the WinClone FAQs https://www.twocanoes.com/forums/viewtopic.php?t=515 - Section "My current Windows partition is the wrong size, and I want to make it larger. How do I do this?" you find a how-to.
    Some payable apps like iPartition and/or Drive Genius also claim to be able to resize.
    Regards
    Stefan

  • How can I be sure the popups asking for my master password come from the Software Security Device ?

    I did setup a master password on my Firefox. I therefore have the Software Security Device asking for my master password now and then as a popup, but I have no way to be sure that the popup is coming from the Software Security Device.
    How can I be sure that it's not coming from a website or an extension trying to steal my passwords ?

    That message will not be from Mozilla, there are rogue sites that use this method to try to get people to install malware/viruses/trojans. Do not install anything from that site.

  • What are the values and meaning of PaymentStatusID and statusTypeId from the API

    What are the values of PaymentStatusID and statusTypeId from the API?
    The WSDL just list the fact tht these exists but not the values and meaning.

    Found more info on the BC site, figured I'd include it all.
    PaymentMethodType
    CreditCard = 1
    Cheque = 2
    Cash = 3
    EFT = 4
    PayPal = 5
    HostedCreditCard = 7 - like google checkout etc.
    DirectDebit = 8
    GiftVoucher = 9
    Free = 10
    PaymentStatusID
    Unknown = -1
    Succeeded = 0
    Failed = 1
    Pending = 2
    Denied = 3
    AddressTypeId  - AddressType
    Home Address = 1
    Work Addres = 2
    PO Box = 3
    Not Used = 4
    Shipping Address = 5
    Pickup Address = 6
    Storage Address = 7
    Billing Address = 8
    OrderType
    Quote = 1
    Invoiced = 2

  • When i send imessages they come from the wrong number, how do i change this to my number?

    When I send an imessage the receiver see's the number that came with the phone before my number was transfered from old provider. This was also the number that was listed under contacts as "my number". how do I change this?

    I had a similar problem when changing SIM cards during a journey to abroad. The new number was accepted, but after changing my SIM that number didn't disappear anymore. I wanted my number to be showed up in iMessage and FaceTime but no chance.
    Just to make it clear I'm not talking about the number you are able to change in the settings, I'm talking about the number related within your iMessage and FaceTime settings. I found out that the phone number remains, even if you change your Apple ID or your SIM card.
    Finally that worked for me:
    1. disable SIM PIN and remove your SIM card
    2. remove your Apple ID from the  iMessage and FaceTime settings
    3. restart your phone
    4. insert your SIM card
    5. activate iMessage without your Apple ID (wait a few minutes)
    6. send an iMessage to an iMessage compatible Email account (the phone should now use your actual phone number)
    7. activate your Apple ID within iMessage
    That worked for me.

  • Is the iphone4  unlocked one? i got it from the store in France

    the iphone 4 16g, it cost me 640 euros, i just want to know is it a unlock one?

    I am wondering, where you bought the unlocked Iphone 4?
    I see from the French and Uk Apple stores there is a 3 week delivery on them...
    Any help would be great.
    Thanks

  • Why can't I add Birthdays in iCal unless they come from Address Book !

    I don't get it. I have a Birthdays calendar that seems to only allow birthdays to be created from the Address Book. If I go to iCal, and select the Birthdays calendar and then try to double click on a date, I just get the message that reads; "Read Only Calendar. You can not change events or ToDo in a read only calendar". I can select any other calendar and add an Birthday "event" that repeats every year. But, Come On !!!! How lame is that!
    Who knows, maybe this is a problem with Address Book not allowing multiple Birthdays per entry (for example one email address per family but there are 4 people in that family). I do not intend to create a separate Address book entry for my friend /family young children just so I can see their Birthday's in iCal. That would be ugly.
    Does anyone have a solution. Is there any hope that Apple would even consider this type of fix?
    Thanks in advance,
    Brad.

    Thanks for the suggestion Austin, however that would still not solve the problem where Address Book only allows 1 Birthday entry per address book entry. My brother, his wife and 2 children all share 1 email address for their household. So, I only have 1 entry in Address book. I used the "+" button in Address book to add the wife and kids, just like you can do for many of the items when editing an address book entry. That is Except Birthday!
    Oh well, I have given up on address book except to store basic info. For the birthdays, I decided to just creats "events" in iCal itself that repeat every year. No sence over complicating things I guess.

  • The dialog box open twice when open file from the server

    I use the following code to download/open file from the server:
    <%
    String filename = "MengxianhuiDocTest.doc";
    String filepath = "D:\\";
    response.setContentType("APPLICATION/OCTET-STREAM");
    response.setHeader("Content-Disposition",
    ??attachment; filename=\"" + filename + "\"");
    java.io.FileInputStream fileInputStream =
    new java.io.FileInputStream(filepath + filename);
    int i;
    while ((i=fileInputStream.read()) != -1) {
    out.write(i);
    fileInputStream.close();
    out.close();
    %>
    If the application runs, the Open or Save dialog box display.When I select open the file,
    the dialog box will display twice.
    Pls help me.
    Thanks.

    thx
    but I tried it and it did't work.
    The dialog box also display twice.

  • What are the authorities listed in the certificate manager and where did they come from?

    I am being blocked from some websites and cannnot figure out how. I am not a student nor am I trying to access sites from work. This is occurring at my home. While trying to fix things I stumbled upon the Authorities list in the Certificate Manager. What is this list for? And also, where did the items in the list come from?

    That are the build-in root certificates and intermediate certificates from servers that you have visited.
    See http://en.wikipedia.org/wiki/Root_certificate

  • How can I hide the main front panel when I run from the executable?

    Hopefully this is an easy question. I have an application where the front panel is not the main GUI and I would like to hide it when the program runs, but only when it runs from the executable. How can I do this?

    NIquist wrote:
    Yeah, don't do that. Executables built in LV require at least one front panel to be open. If it isn't, the run-time engine automatically closes the executable. I haven't checked recently, but I assume this is still the case.
    Instead, you can set the FP state to minimized (as suggested earlier) or (better) to hidden.
    P.S. one side point - the property and invoke nodes have a shortcut - if you use the Application or VI classes and don't connect a reference, they default to the current app or VI. That means you don't have to open the reference.
    Try to take over the world!

  • Change value of one row

    Microsoft SQL Server 2014 - 12.0.2254.0 (X64)
     Jul 25 2014 18:52:51
     Copyright (c) Microsoft Corporation
     Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: )
    Hi,
    I have a little bit problem. I would like to change the value of one row calculated in this way:
    SELECT distinct ID,s7.Name_Account ,
    sum (s7.Y2006* 1.0 / t7.Y2006) as V2006,sum (s7.Y2007* 1.0 / t7.Y2007) as V2007,sum (s7.Y2008* 1.0/ t7.Y2008) as V2008,sum (s7.Y2009* 1.0/ t7.Y2009) as V2009,
    sum (s7.Y2010* 1.0/ t7.Y2010) as V2010,sum (s7.Y2011* 1.0 / t7.Y2011) as V2011,sum (s7.Y2012* 1.0/ t7.Y2012) as V2012,sum (s7.Y2013* 1.0/ t7.Y2013) as V2013
    FROM sumas7 as s7 , total1 as t7
    Where ID IS NULL and Name_Account IS NULL
    GROUP BY Name_Account, ID
    WITH ROLLUP
    As we know this Transact- SQL produce a NULL value as total. My intention is to change this value (NULL) by text value, for example, "NON Current Assets" . Is it possible?  and if it is possible How could I do it?
    Thanks in advance
    Un saludo

    which column has NULLs
    as per posted code I guess it should be Name_Account
    in which case what you need is this
    Also distinct here is meaningless as you're already applying GROUP BY
    SELECT ID,
    COALESCE(s7.Name_Account,'Non Current Assets') AS Name_Account,
    sum (s7.Y2006* 1.0 / t7.Y2006) as V2006,sum (s7.Y2007* 1.0 / t7.Y2007) as V2007,sum (s7.Y2008* 1.0/ t7.Y2008) as V2008,sum (s7.Y2009* 1.0/ t7.Y2009) as V2009,
    sum (s7.Y2010* 1.0/ t7.Y2010) as V2010,sum (s7.Y2011* 1.0 / t7.Y2011) as V2011,sum (s7.Y2012* 1.0/ t7.Y2012) as V2012,sum (s7.Y2013* 1.0/ t7.Y2013) as V2013
    FROM sumas7 as s7 , total1 as t7
    Where ID IS NULL and Name_Account IS NULL
    GROUP BY Name_Account, ID
    WITH ROLLUP
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • HT5731 If I purchase the whole season of a tv show (example; PLL 4) but not all episodes are avalible or out yet will I be able to just download them when they come out or will I have to pay extra for them?

    I want to download a tv show but all the season havent come out yet and so half the season is unavalible. When they come out can Ijust download them straight away or will I have to pay for them again even though im buying the whole season?

    Once you pay for a season, you get the entire season as it is released.

  • How to get all the values in one column of a JTable

    How to get all the values in one column of a JTable as a Collection of String.
    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column.

    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column. You could always write a custom TableModel that stores the data in the format you want it. It would probably be about 50 lines of code. Or you could write a loop in 3 lines of code. I'll let you decide which approach you want to take.

  • I have a new MAC MINI and I want to install a second monitor.  I have one connected to the HDMI and it works.  I can't get a signal to the other one.  It is connected from the thunderbolt to its HDMI port.  How can I make it work?

    I have a new MAC MINI and I want to install a second monitor.  I have one connected to the HDMI and it works.  I can't get a signal to the other one.  It is connected from the thunderbolt to its HDMI port.  How can I make it work?

    Could be a bad cable or bad Thunderbolt port.
    You have 90 days of free telephone support on a new device. You can call them at 1-800-MY-APPLE. Have your Mini's serial number handy
    You can also make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar

Maybe you are looking for

  • Windows 8.1 Firewall + Microsoft Account Logon

    Hi, I am a frequent SkyDrive user. With Windows 8.1, the SkyDrive integration has changed. In order to use SkyDrive, I have to register with my Microsoft account at my local machine now. I am actually fine with that design decision of yours. But I al

  • What's the best way to connect the audio out of my Mac to my stereo receiver?

    I want to listen to my mp3 collection through my home theatre stero receiver. I have 2 audio interfaces that I connect to my mac through USB and Firewire: Digi Design Mbox mini and Maudio ProFire 610. I've tried going from a headphone 1/8'' connector

  • Can I use both Education discount and Black Friday discount

    Hi Can anyone tell me if both the education discount and the black friday discount be used together. I plan to buy a macbook. Ajju

  • Closing Window with component usage in used component

    Hi, I create a popup with the following code.   DATA lo_window_manager TYPE REF TO if_wd_window_manager.   DATA lo_api_component  TYPE REF TO if_wd_component.   DATA lo_window         TYPE REF TO if_wd_window.   lo_api_component  = wd_comp_controller

  • Weblogic 8.1 Remote Debugging Setup

    I am requesting help on a problem I am encountering using remote debugging with eclipse and Weblogic 8.1.2. I have successfully used remote debugging in the past with other application servers, but I have been unsuccessful with Weblogic 8.1. I have s