How to concat columns from more than one record?

I have a function that takes an Oracle long and returns it as a varchar so that I can use it in the Microsoft world. My problem is that the SELECT returns more than one row (which is valid) and I need the Long fields to be concatenated into the one varchar returned. Currently I get an error saying more than one record is returned. This is my function:
CREATE or replace function m4owner.Get_Request_Text
(av_REQUEST_ID varchar2, av_REQUEST_LINE number, av_TEXT_LINE_CODE varchar2)
RETURN varchar2
IS
long_var LONG;
BEGIN
SELECT TEXT INTO long_var
FROM M4OWNER.REQUEST_TEXT
WHERE REQUEST_ID = av_REQUEST_ID
AND REQUEST_LINE = av_REQUEST_LINE
AND TEXT_LINE_CODE = av_TEXT_LINE_CODE;
return long_var;
END;

  CREATE or replace function m4owner.Get_Request_Text (av_REQUEST_ID varchar2,
                                                       av_REQUEST_LINE number,
                                                       av_TEXT_LINE_CODE varchar2) RETURN varchar2 IS
    long_var LONG;
  BEGIN
    for t1 in  (SELECT TEXT FROM M4OWNER.REQUEST_TEXT
                 WHERE REQUEST_ID = av_REQUEST_ID
                   AND REQUEST_LINE = av_REQUEST_LINE
                   AND TEXT_LINE_CODE = av_TEXT_LINE_CODE) loop
      long_var := long_var || t1.text;
    end loop
    return long_var;
  END; note: untested

Similar Messages

  • JDBC-XI-FILE scenario. How to extract data from more than one table in JDBC

    Hi,
    I was asked a question like in JDBC-XI-FILE scenario........ How to extract data from more than one tables (i.e from JDBC system) ?? What is the logic to do the same ??
    I am not sure whether this is a valid question..........but any help in this regards is highly appreciated.
    Regards
    Kumar

    HI,
    Yes it can be possible ,please see the following links
    JDBC  Receiver with Oracle Stored Procedures
    configuring jdbc adapter with multiple tables
    RFC -> XI -> JDBC Scenario Updating Multiple Tables
    /people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
    JDBC Adapter multiple Selects
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=jdbc%20with%20multiple%20tables&cat=sdn_all
    Regards
    Chilla..

  • How to pull groups from more than one OU using weblogic "All Groups Filter" from AD.

    Hi,
    Please help me for pulling groups from more than one OU using weblogic "All Groups Filter" from AD.
    AD structure is:
    c001639domain.local
           ||
           ||
        OU=Security_Groups
                      ||
                      ||
                      >> OU=CORP_ECM---> n number of group
                      >> OU=CORP_hodata--> n number of group
                      >> OU=CORP_citrix--> n number of group
                      >> OU=CORP_driver --> n number of group
                      >> OU=CORP_temp --> n number of group
    Requirement is i want to filter groups from OU=CORP_ECM and OU=CORP_hodata.
    Thanks,
    Jagan.

    I used below option but its not working getting zero groups.
    (&(objectClass=group)(|(ou=CORP_ECM,dc=Domain,dc=com)(ou=CORP_hodata,dc=c001639domain,dc=local)))

  • How do i print from more than one computer?

    How do I set up my HP 4500 Envy printer to print by wireless for more than one laptop user?

    Hi @MHorton,
    Welcome to the HP Forums! 
    I understand that you are wondering how to set up your HP 4500 Envy printer to print by wireless for more than one laptop user.
    In short, you will need to install the full feature software and drivers for each laptop, and make sure they are connected to the same wireless network as the printer.
    Please see this guide, Installing the Printer Software for a Wireless Network Connection, for further assistance.
    If you do not know the Operating System you are using, please visit this website. Whatsmyos.
    Hope this information helps, please let me know if you have any other questions!
    RnRMusicMan
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to say “Thanks” for helping!

  • How to remove tooltips from more than one field at a time?

    I use the wizard and now there are more than 2000 fields with useless tooltips on each of them. How do I remove all the tooltips at once?

    Run this code from the JS console:
    for (var i=0; i<this.numFields; i++) {
        var f = this.getField(this.getNthFieldName(i));
        if (f==null) continue;
        f.userName = "";

  • Basic, basic question - how to order prints from more than one album at onc

    I am having two problems with iphoto - I would be most grateful for any help. First, when I go to upload my photos to a web-based printing company (like shutterfly or snapfish), and I click on the vendor's "browse" photos to find the album to upload, the way the photos come up does not correspond to my album titles in iphoto, so I can't find them. I have my photos sorted in labeled albums, and would like to upload them as such, but when I click on iphoto library, it brings up all kinds of other files that don't correspond to my current file labels. Can anyone help?
    Equally irritating, when I use apple's "order print" features, it only lets me order from one album at a time. I'd like to order from multiple albums all at once, without paying shipping for each one. Any ideas? Again, most grateful for any advice.

    Hi, Sestew, and welcome to Apple Discussions.
    Problem 1: Export the photos you want printed from iPhoto to a folder on the desktop. Use the printer's browser to navigate to that folder and upload them to the printing company from it. After uploading them, trash the folder that contains the exported copies. The pictures are still safe in your iPhoto library.
    Problem 2: Create a new album and place all the pictures you want printed in it. (A photo can appear in any number of albums, so doing this won't remove any of the pictures from the other albums they're already in.) Then order that album printed. Delete the album after ordering, if you wish — the pictures will remain in whatever other albums you've placed them in.

  • How to delete keywords from more than one image at once?

    Is there any way to delete all the keywords from a selected group of images all at once?
    I've selected a group of images, but when I delete the keywords, it only deletes them from the highlighted (targeted?) image and not from the other selected images. I've also tried syncing metadata and I get the same results.
    Help would be appreciated.
    Antonio

    Interesting bug I just found, I think.
    When the Grid is up on the second monitor, only one images is affected by the deletion of the keywords. When I put the Grid mode back on the main screen, I was able to delete keywords from all the selected images.
    Shouldn't it work the same no matter what screen the Grid mode is on?

  • Multiple columns for more than one record?

    Crystal Reports Xi
    I have a list of addresses, etc.  with attached route numbers.  If an address has 2 different route numbers, it will appear as two records.  Is there a way that I can list the address once, and have the route numbers just grow to more columns?
    Example - Change this...
    ADDRESS               ROUTE
    100 Main St.             1234
    100 Main St.             1235
    To This...
    100 Main St.            1234      1235
    Note:  An address may have one route number attached, or several route numbers attached.
    I tried playing around with the multiple columns, etc, but it kept on having everything in the section become multiple columns, etc.  Any help is appreciated.

    multiple columns only work in detail section.
    place your address without the route in the 1st details
    then insert a 2nd details and place the route in the details then select multiple columns for that details section.
    then underlay the first detail section and it should line up.

  • How to from more than one delivery note - conversion into one invoice

    Dear Experts,
    How to from more than one delivery note - conversion into one invoice?
    Thanks and best regards,
    Wilson Hong

    Dear Wilson Hong,
    Single invoice for multiple deliveries will takes place based on these criterion
    1.If you want single billing document for multiple deliveries these data should be same in all order for all items.
    -> Payer
    -> Inco term
    -> Payment term
    -> Actual GI Date from Delivery
    -> Shipping Condition
    -> Account Assignment Group
    -> Exchange rate (in case of export sale order)
    -> Foreign trade data.
    2.In addition to this you need to maintain proper copy control settings between delivery and invoice.
    Go to VTFL transaction input your delivery type and invoice type then go in to the item level settings here you find field Data VBRK/VBRP maintain this field with routine 3-Single invoice.
    If the above data and settings are exists you can do single invoice for multiple deliveries.
    I hope this will help you,
    Regards,
    Murali.

  • How to load an infocube from more than one source system?

    HI all,
    Can u please tell me how to load an info cube from more than one source sytem?

    Hi,
    same confiig is required for one or more source system. (From Data source to update rule, obviously cube remains the same).
    Its the infopackage execution which loads the data from different source system.
    Regards,
    Nawanit

  • How can you set up more than one device on iTunes. I have an iPad, iPod, itouch and iPhone. I don't want the same on all devices.

    How can you set up more than one device on iTunes? I have an iPad, iPod, itouch and iPhone. I don't want the same on all devices. I have all my music/videos on iTunes on my mac book pro. Can you set up separate folders for each device and drop in what ever music/videos from the main iTunes library?

    In itunes it is called syncing and you can choose exactly what content to sync to all devices and it can be different for all of them
    How to sync

  • How do people register for more than one person on a form?

    We had a lot of complaints last year from organizations who sent several employees to our training.  It took a long time for them to process these one at a time.  How do people register for more than one person on a form?

    Hi thearcca,
    This entirely depends on the form you create, you can add multiple choice button and ask for the no. of employees the organization wants to register.
    Also, you can add corresponding text field for the names.
    Thanks,
    Vikrantt Singh

  • Reporting from more than one infocube and also from multiple ODS

    Hi all,
            Someone please help me in these issues.
    How can we do reporting from more than one cube ( if data in all the cubes are required, but only a few fields from each cube). And how to do the same with more than one ODS.
    Thanks in advance,
    Sekhar

    Hi Sekahr
    Can u jus create a multiprovider.
    Before creating the multiprovider..Just check the Common charcterstics avilable in
    all the ods based on that give the mapping ..
    and then once u have completd the creation of multiprovider execute the same in
    the tcode <b>Listcube</b> and then create the querys as per the user thats it...
    Regards
    R M K
    Assining points is the only way of saying thanx in SDN ***

  • Can takes from more than one track be comped at the same time?

    Greetings,
    I know that this question has been asked recently in this forum (http://discussions.apple.com/thread.jspa?messageID=9527542&#9527542), but I don't think that the respondents completely understood the question... Or perhaps I did not understand the suggested solutions to the problem. I will ask the question in a slightly different way...
    Suppose that I record guitar with 2 microphones (a pickup mic, and a room mic). The first microphone is recorded onto track 1, the second microphone is recorded onto track 2. Multiple takes are done in this manner. When it comes time to comp the tracks, how is it done? Can the takes from more than one track be comped together at the same time? I have tried to do this by grouping both tracks together, but it does not work.
    Any suggestions?
    Thank you.

    You had the right idea grouping the tracks together. You must make sure that in the group settings, the box titled "region selection (edit)" is checked. This will allow you to make the same cuts (or in this case, swipes) on all regions in the group.

  • How to make manager approve more than one request in one time in SSHR

    Dear All,
    Anyone has an idea on how to make manager approver more than one request in one time in SSHR??
    for example, manager is having 20 requests to approve on Change Pay Function, he don't want to check one by one and approve it, he want to approve the 20 requests directly from one time, is there any solution for that??
    Thanks and Regards

    Hi Adel,
    As Vignesh has mentioned we don't have any standard functionality which will allow bulk approvals. We had same kind of requirement in performance management where the business was asking for a bulk approval feature which should be available to Skip level manager for approving the rating suggested by line manager. We had created a custom page which will list all the notifications and user can select the ones which S/He wants to bulk approve and click submit button. Internally we had called the workflow with item key and other required parameter and do the approval.
    You can have a work with your technical guy and can work on the same lines.
    Thanks,
    Sanjay

Maybe you are looking for