Merge function and make one sqlquery

Hello ,
can anyone make this below query tune... i mean make the function remove and i want single sql query without any function.HELP is highly appreciated
SELECT usr.employee_id as employeeId, usr.last_name||','||usr.first_name as EmployeeName, obj.Title as Gaoltitle,
dic_elms_wgt.name as weightage, dic_elms_eec.name as EEComplete, dem_grph.value as citystatecode,
mgr.last_name||', '||mgr.first_name as managerName, kcfun_rating_k(241,obj.id) as managerselectedcomplete,
kccabelas.row_concat_user(obj.user_id) as businessUnit
FROM ************** WHERE usr.id = obj.user_id
AND usr.status_id = 251
and mgr.id = usr.manager_id
AND obj.status_id = 300
AND obj.type_id != 363
AND obj.time_frame_id = 2010
AND obj.is_deleted = 'N'
AND obj.parent_id = 0
AND obj.is_individual = 'Y'
AND dic_elms_wgt.id = obj.weight_id
AND dic_elms_eec.id = obj.percent_complete_id
AND dem_grph.id = usr.custom_field_5;
create or replace FUNCTION row_concat_user(userid in number) RETURN VARCHAR2 IS
ret VARCHAR2(4000);
cursor cmulti1 is select value from ****where id in (select ****from ****_2 where user_id =userid) ;
BEGIN
for i in cmulti1 LOOP
IF ret IS NULL THEN
ret := i.value;
ELSE
ret := ret || ',' || i.value;
END IF;
END LOOP;
return ret;
end;
sorry this post was closed thanku for response....
Edited by: OraHungry on Mar 21, 2011 5:15 PM

>
stragg is not a built in oracle function, it's a 3rd party function, so unless you point people to the source code, don't recommend it.
>
Well it is now a built in oracle function if you are using Oracle 11.2 but, it's undocumented like wm_concat.
sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Mar 21 11:56:09 2011
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> desc stragg;
FUNCTION stragg RETURNS VARCHAR2
Argument Name                  Type                    In/Out Default?
INPUT                          VARCHAR2                IN
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> show user
USER is "SYS"
SQL> desc stragg;
FUNCTION stragg RETURNS VARCHAR2
Argument Name                  Type                    In/Out Default?
INPUT                          VARCHAR2                IN
SQL> select text from user_source
  2  where name = 'STRAGG';
TEXT
FUNCTION stragg(input varchar2 )
RETURN varchar2
AGGREGATE USING string_agg_type;
SQL> select text from user_source where name = 'STRING_AGG_TYPE' and type = 'TYPE';
TEXT
type string_agg_type
-- OID '00000000000000000000000000020101'
as object
   key      raw(8),
   static function
        ODCIAggregateInitialize(sctx IN OUT string_agg_type, outopn IN RAW,
                                inpopn IN RAW)
        return pls_integer
        as language c
        library xmltype_lib
        name "STRAGG_INITIALIZE"
        with context
        parameters (
          context,
          sctx, sctx INDICATOR STRUCT, sctx DURATION OCIDuration,
          outopn OCIRaw, inpopn OCIRaw,
          return int
...I would still recommend using listagg compared to stragg as it outperformed in one of our recent benchmarking exercise.
Thanks
Raj

Similar Messages

  • My contacts don't sync on icloud on my iphone some contacts disapear on iphone and some contacts hae been merged together to make one contact when they are not related. Can anyone help?

    My contacts don't sync on icloud on my iphone some contacts disapear on iphone and some contacts hae been merged together to make one contact when they are not related. Can anyone help?

    If you log into Icloud.com, are all your contacts correct there? If the answer is Yes, I would then turn contacts OFF on your phone, and then turn them back on. Do not merge, but replace with Icloud content.
    This is usually the quickest way to edit a bunch of contacts, through the web interface.

  • I wish to del one apple id and make one common for mac and i phone, please suggest

    i wish to del one apple id and make one common for mac and i phone, please suggest

    You cannot delete an Apple ID, you just stop using it. Understand that any apps purchased using that ID can only be updated with it. Apps are tied that ID used to purchase them. If you want to use a new ID for everything, you will need to repurchase any old apps using the new ID.

  • It's simple... I want the Illustrator pen tool to ALWAYS make corner annchor points and NEVER smooth.  Right now I have to convert every single one of them, or I have to do a work around every time I draw a line and make one of the handles disappear.  Is

    It's simple... I want the Illustrator pen tool to ALWAYS make corner annchor points and NEVER smooth.  Right now I have to convert every single one of them, or I have to do a work around every time I draw a line and make one of the handles disappear.  Is there some simple setting out there that will just "make it so?"@

    The video I am watching this guy is just dragging every line to make curves.  And every anchor point is a corner.  He is not switching back and forth between the pen and the anchor points tool, and he is not using the convert points tool.  He draws a curved line and starts another straight line only to curve it with a click and a drag.  It is super efficient, and I could save a world of time if I could figure out what he is doing.

  • "SCR24 style lid with window function".And only one adaptor for DK48

    I recently purchased the product "SCR24 style lid with window function". The contents of the box is the adapter for the "dock" DK48, the problem that I find is that I have two DK48 and only one adapter. Is official that the Sony's answer is:" every time you want to charge, remove from the dock and put on the other. There is no spare part, cant purchase it separately"?.

    I've searched the places I use for parts and cases etc but no adaptors - The only thing I can think of doing is to buy a magnetic charging cable and use that
    For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled.   Richard P. Feynman

  • Add stroke to graphic and make one graphic

    HI, not sure how to phrase this one, but I have a letter form that I made into a graphic. It's kind of thin and I want it thicker. I can add a stroke, but how do I make stroke + letter all one piece so  I can reverse it out of a color block?
    thanks in advance.
    Rasterizing it won't allow me to alter the color.

    Is this what you need?  The letter is shown on the left, letter with stroke on the right. Below is the letter with stroke reversed out of the black field using the transparency dialog box.

  • How do you get the screensaver that takes your iPhoto pictures and make one big picture? Used to have it on 10.6.8 but cant find it

    Used to have it on 10.6.8 but cant find it. It took all the pics from iPhoto I think then made a pic out of them as a screen. Help?

    Ah, welcome to my world...the world of progressive vs interlaced, RGB vs YUV, compression/decompression,10 bit or 8 bit, 4:4:4 vs 4:0:1 vs 4:1:2, color space (etc, etc, etc..!)
    There's HD, DV, HDV, NTSC, PAL and more - its a place where acronyms roam free and multiply daily.
    You're in for a fascinating journey that will soon have you understanding things you never dreamt you'd need to know, then when you think you've got to grips with 'em, you'll discover you don't really know the first thing about them...!
    Fortunately you've got Bogie, Patrick, Shane, David and more to take you along for the ride.
    I will suggest (and probably be corrected) that what you're seeing is probably interlaced footage on your progressive monitor. (You mentioned you're watching the DVD on your computer.) Your TV has far fewer lines of resolution than your computer monitor, so FCP works within those constrictions. Also your TV runs at 29.97 frames a second, which is actually 60 frames a second as each frame is divided into two fields, which comb together to for one frame. These combs are very much evident when watching a DVD on a computer. Even high budget Hollywood films have this problem, especially when the camera or subject is moving. There is no way around this if you're outputting on DVD or NTSC.
    You could create an Progressive file, which won't do this on your monitor, but thats a whole other ball of wax...
    Welcome though. Its all good. (And the people on this site are very helpful, I've learnt a lot over the last 5 years by simply reading these posts.)

  • Is there a way to take single songs and make one album out of?

    If you have asst songs from an artist and want to make your own mix mpg albums to put on ipod, can this be done? If so how?

    sound like you want to make a play list.
    try here: http://docs.info.apple.com/article.html?artnum=93045

  • How do I make one long WAV (or mp3) from downloaded fil

    Just picked up my Zen Xtra (30GB) yesterday, and I think I'm gonna love it, except for those ga
    ps.
    Regarding those gaps, after some research here and elsewhere, I found that I can use EAC's "Copy Image and create CUE Sheet" function to make one large file of all the tracks on a CD merged together and then send that image to the Zen Xtra, and this clears up the ga
    ps.
    My problem is that most of the music I plan on putting on the player is downloaded li've music (legal, of course), and I can't for the life of me figure out how to create one long file from the tracks when they're on the computer, not a CD (and burning a CD just to create a file kind of defeats my purpose for getting the Zen Xtra... I'm sick of burning).
    The gaps haven't really affected me with other music I've put on, but it's going to annoy the heck out of me if I get one in the middle of a sweet Scarlet > Fire ;-)
    Thanks for any help in advance...
    -JoshMessage Edited by joshamy0 on 04-20-2005 09:05 AM

    Or you read the?BEFORE you post, READ THIS FIRST (FAQ) post (search on "gapless playback")
    I know that?Easy CD-DA Extractor will encode all as one file, but this is shareware, and I'm sure there are freeware solutions.

  • Save and make file name change

    When I save as, I want the image to be the name of the file I type so that all subsequent changes can be saved only by clicking "save" and not having to browse to and rename the file EVERY TIME. Sometimes this works properly, sometimes it doesn't. It seems very random.
    I think it has something to do with "save as a copy" but more often than not, that option is greyed out so I couldn't set it if I wanted to.

    Photoshop invokes "Save As Copy" functionality when it senses you can't save all the things in your image document in the format you've chosen.
    For example, if an image has layers, or channels beyond R, G, and B, or is in 16 bit mode, it will not be able to save all these things in a JPEG.  Thus it invokes "Save As Copy" functionality, and makes the assumption you'd like to save the whole document, including all the extra stuff, in a separate master file in a format that can handle everything - e.g., .psd.
    This leads to this (normal) behavior:
    1.  You work on a design or photo that has a bunch of fancy stuff in it (e.g., some layers, some masks, some extra channels, in 16 bit modes).
    2.  You Save As a master .psd file.  This does NOT invoke Save As Copy, and DOES set the default save filename.
    3.  You work on it some more.
    4.  You Save As a .jpg file - for example to prepare for publishing it.  This invokes Save As Copy and the default filename remains .psd.
    5.  You try to exit Photoshop and it tells you that you haven't saved your .psd master file, so you save it.
    If you want the Save As operation to reset your default filename, flatten it, remove channels, lower color depth, or whatever to make it compatible with the format you're saving, so that Save As Copy isn't forced.  Or Save As another different .psd or .tif that can handle all those features.
    Hope this helps with understanding.
    -Noel

  • Stepper motor 8SMC1-USBhF and power meter PM100D: how to merge the two VIs into one and make a XY graph of the current position and the power

    Hi there,
    I have a stepper motor (8SMC1-USBhF) and a power meter (PM100D). I want to measure the power while the stepper motor is moving, and obtain an XY graph with the current position on x axis and the power on y axis. So I just merged the two VIs together by copying and pasting, and created local variables for current position and readout value, and changed them to read, and then linked them to the XY graph, but apparently it doesnt work.
    So could you please instruct me how to merge them and obtain an XY graph appropriately?
    Attached are the two VIs.
    Thank you!
    Attachments:
    PM100D Simple Example.vi ‏42 KB
    StepperMotor.vi ‏97 KB

    Hello,
    The XY graph requires that each datapoint on the X axis corresponds to a datapoint on the Y axis.  To create XY data you will need to creat two arrays of X data and Y data with the same amount of elements then cluster the two arrays together to wire into the XY graph.  As an example take a look at the VI snippet below.  Is there a specific error being thrown?
    Regards,
    Isaac S.
    Applications Engineer
    National Instruments

  • Mail merge and print one document at a time?

    Hi all. I'm an Apple revert. I'm currently using the i7 iMac. Previous Apple computer was a //e.
    I print an 8 or 12 page newsletter for my work. I want my printer/copier to fold and staple each document individually. Pages seems to send all documents to the printer in one huge file. How do I mail merge and print one document at a time?
    [In Windows Publisher, there's a registry hack to make Pub print one at a time. Anything similar on a Mac?]
    Mike

    Hello
    As you saw wrongly my first name I'm not too surprised that you missed the beast
    In fact it's not surprising that you missed it.
    I prepared the archive but forgot to upload it
    Download :
    For_iWork:iWork '09:découpe_PDFs.zip
    Yvan KOENIG (VALLAURIS, France) samedi 27 août 2011 11:29:37
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • Can I creat an new iCloud account and make it the primary one for my backups and buy extra iCloud storage for it?  Thank you

    Can I creat an new iCloud account and make it the primary one for my backups and buy extra iCloud storage for it?  Thank you

    Hey Hindfromlondon,
    Welcome to Apple Support Communities.  Since you are posting here, I take it you already have an Apple ID.  
    You can setup that Apple ID to work with iCloud.  See:
    Set up your Apple ID for iCloud and iTunes - Apple Support
    And you usually want to stick with one Apple ID as having multiples can cause confusion (especially with purchases).
    Frequently asked questions about Apple ID - Apple Support
    What is an Apple ID?
    An Apple ID is a user name you use for everything you do with Apple. Creating an account for an Apple service, such as the iTunes Store or the App Store, creates an Apple ID. Apple ID allows you to access other Apple services. You don't have to create a new account for each service—just use your Apple ID.
    For a complete list of all of the places you can use an Apple ID, see Where do I use an Apple ID.
    and further down:
    I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?
    Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs. 
    If you are wondering how using multiple Apple IDs relate to iCloud, see Apple IDs and iCloud.
    Regarding iCloud storage check out
    iCloud storage upgrades and downgrades - Apple Support
    I encourage you to read all about it as there's lots of information out there.
    Take care,
    Nubz

  • I need to convert PDF to Excel, however, columns and tabs make many merged cells and many blank columns. In addition to not separate the columns correctly, I see many not separate lines together in the same cell. I'm even thinking that Adobe Acrobat Pro D

    I need to convert PDF to Excel, however, columns and tabs make many merged cells and many blank columns. In addition to not separate the columns correctly, I see many not separate lines together in the same cell. I'm even thinking that Adobe Acrobat Pro DC has limitations. There is no way to define what points in columns to force break column? Nor create many columns that are useless? How does text to column in Excel, fixed size when we import text, and define where the breaks have columns?
    Google Tradutor para empresas:Google Toolkit de tradução para appsTradutor de sitesGlobal Market Finder
    Desativar tradução instantâneaSobre o Google TradutorCelularComunidadePrivacidade e TermosAjudaEnviar feedback

    PDF does not contain columns, rows, formats, styles, or other aspects of word processing or spreadsheet file formats.
    This is because PDF is decidedly not a word processing or spreadsheet file format or something "like" one of those.
    (see ISO 32000 for what PDF "is")
    What can optimize the export of PDF page content is to start with a well-formed tagged PDF (ISO 14289-1, PDF/UA-1 compliant).
    Without that export is what it is and one performs whatever content cleanup is needed using the native application for the export file (MS Word or Excel).
    Be well...

  • I have 3 iTunes accounts and want to merge them into only one of them. I also have money on all 3 accounts

    I have 3 iTunes accounts and want to merge them into only one of them. I also have money on each account. Not sure how to go about this.

    You cannot merge the accounts.
    Sorry.

Maybe you are looking for