How can i get all these values in single row with comma separated?

I have a table "abxx" with column "absg" Number(3)
which is having following rows
absg
1
3
56
232
43
436
23
677
545
367
xxxxxx No of rows
How can i get all these values in single row with comma separated?
Like
output_absg
1,3,56,232,43,436,23,677,545,367,..,..,...............
Can you send the query Plz!

These all will do the same
create or replace type string_agg_type as object
2 (
3 total varchar2(4000),
4
5 static function
6 ODCIAggregateInitialize(sctx IN OUT string_agg_type )
7 return number,
8
9 member function
10 ODCIAggregateIterate(self IN OUT string_agg_type ,
11 value IN varchar2 )
12 return number,
13
14 member function
15 ODCIAggregateTerminate(self IN string_agg_type,
16 returnValue OUT varchar2,
17 flags IN number)
18 return number,
19
20 member function
21 ODCIAggregateMerge(self IN OUT string_agg_type,
22 ctx2 IN string_agg_type)
23 return number
24 );
25 /
create or replace type body string_agg_type
2 is
3
4 static function ODCIAggregateInitialize(sctx IN OUT string_agg_type)
5 return number
6 is
7 begin
8 sctx := string_agg_type( null );
9 return ODCIConst.Success;
10 end;
11
12 member function ODCIAggregateIterate(self IN OUT string_agg_type,
13 value IN varchar2 )
14 return number
15 is
16 begin
17 self.total := self.total || ',' || value;
18 return ODCIConst.Success;
19 end;
20
21 member function ODCIAggregateTerminate(self IN string_agg_type,
22 returnValue OUT varchar2,
23 flags IN number)
24 return number
25 is
26 begin
27 returnValue := ltrim(self.total,',');
28 return ODCIConst.Success;
29 end;
30
31 member function ODCIAggregateMerge(self IN OUT string_agg_type,
32 ctx2 IN string_agg_type)
33 return number
34 is
35 begin
36 self.total := self.total || ctx2.total;
37 return ODCIConst.Success;
38 end;
39
40
41 end;
42 /
Type body created.
[email protected]>
[email protected]> CREATE or replace
2 FUNCTION stragg(input varchar2 )
3 RETURN varchar2
4 PARALLEL_ENABLE AGGREGATE USING string_agg_type;
5 /
CREATE OR REPLACE FUNCTION get_employees (p_deptno in emp.deptno%TYPE)
RETURN VARCHAR2
IS
l_text VARCHAR2(32767) := NULL;
BEGIN
FOR cur_rec IN (SELECT ename FROM emp WHERE deptno = p_deptno) LOOP
l_text := l_text || ',' || cur_rec.ename;
END LOOP;
RETURN LTRIM(l_text, ',');
END;
SHOW ERRORS
The function can then be incorporated into a query as follows.
COLUMN employees FORMAT A50
SELECT deptno,
get_employees(deptno) AS employees
FROM emp
GROUP by deptno;
###########################################3
SELECT SUBSTR(STR,2) FROM
(SELECT SYS_CONNECT_BY_PATH(n,',')
STR ,LENGTH(SYS_CONNECT_BY_PATH(n,',')) LN
FROM
SELECT N,rownum rn from t )
CONNECT BY rn = PRIOR RN+1
ORDER BY LN desc )
WHERE ROWNUM=1
declare
str varchar2(32767);
begin
for i in (select sal from emp) loop
str:= str || i.sal ||',' ;
end loop;
dbms_output.put_line(str);
end;
COLUMN employees FORMAT A50
SELECT e.deptno,
get_employees(e.deptno) AS employees
FROM (SELECT DISTINCT deptno
FROM emp) e;
DEPTNO EMPLOYEES
10 CLARK,KING,MILLER
20 SMITH,JONES,SCOTT,ADAMS,FORD
30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
CREATE OR REPLACE FUNCTION concatenate_list (p_cursor IN SYS_REFCURSOR)
RETURN VARCHAR2
IS
l_return VARCHAR2(32767);
l_temp VARCHAR2(32767);
BEGIN
LOOP
FETCH p_cursor
INTO l_temp;
EXIT WHEN p_cursor%NOTFOUND;
l_return := l_return || ',' || l_temp;
END LOOP;
RETURN LTRIM(l_return, ',');
END;
COLUMN employees FORMAT A50
SELECT e1.deptno,
concatenate_list(CURSOR(SELECT e2.ename FROM emp e2 WHERE e2.deptno = e1.deptno)) employees
FROM emp e1
GROUP BY e1.deptno;
DEPTNO EMPLOYEES
10 CLARK,KING,MILLER
20 SMITH,JONES,SCOTT,ADAMS,FORD
30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
CREATE OR REPLACE TYPE t_string_agg AS OBJECT
g_string VARCHAR2(32767),
STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
value IN VARCHAR2 )
RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
returnValue OUT VARCHAR2,
flags IN NUMBER)
RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
ctx2 IN t_string_agg)
RETURN NUMBER
SHOW ERRORS
CREATE OR REPLACE TYPE BODY t_string_agg IS
STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
RETURN NUMBER IS
BEGIN
sctx := t_string_agg(NULL);
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
value IN VARCHAR2 )
RETURN NUMBER IS
BEGIN
SELF.g_string := self.g_string || ',' || value;
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
returnValue OUT VARCHAR2,
flags IN NUMBER)
RETURN NUMBER IS
BEGIN
returnValue := RTRIM(LTRIM(SELF.g_string, ','), ',');
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
ctx2 IN t_string_agg)
RETURN NUMBER IS
BEGIN
SELF.g_string := SELF.g_string || ',' || ctx2.g_string;
RETURN ODCIConst.Success;
END;
END;
SHOW ERRORS
CREATE OR REPLACE FUNCTION string_agg (p_input VARCHAR2)
RETURN VARCHAR2
PARALLEL_ENABLE AGGREGATE USING t_string_agg;
/

Similar Messages

  • I have to re-install itunes, how can I get all my songs, apps etc back, with no access to my old itunes??

    Itines was deleted from my computer and I need to re-install it but dont want to lose all my songs, apps etc. How can I get all this back onto itunes with no access to my old itunes??

    Itunes was deleted?  Or your itunes library was deleted?
    If it was just itunes, then your music should still be there.  Just reinstall itunes.
    Otherwise just use your backup copy of your comuter to put everything back.

  • How Can I get all the values of a DBMS package?

    Hi all
    I'm using this "dbms_output.put_line(DBMS_DB_VERSION.VERSION || '.' ||DBMS_DB_VERSION.RELEASE);" to show the version. But how Can I get the all the values from DBMS_DB_VERSION ? Is there a common way ?
    Thanks .
    Best
    Laurence

    Hi,
    Don't think that's possible. Even if it were, you wouldn't be able to use/display BOOLEAN type in SQL.
    If you just aim to see what they are, you could do something like this
    select text
      from all_source
    where owner = 'SYS'
       and name = 'DBMS_DB_VERSION'
       and type = 'PACKAGE';Or even
    select dbms_metadata.get_ddl('PACKAGE', 'DBMS_DB_VERSION', 'SYS') from dual;My version is:
    SQL> select * from v$version where rownum = 1;
    BANNER                                                         
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    1 row selectedIn 11g you also have [PL/SCOPE|http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10471/adfns_plscope.htm#ADFNS02203] which might help you even more.
    Regards
    Peter

  • How can I get all the values of a String array profile property using javascript?

    I am trying to build functionality into our site that records all products added to the basket against a user's profile.
    I have so far been able to store the product codes against the profile as a property using Ajax:
           var dataString = ":formid=addProduct&:formstart=/apps/thread/templates/page_product/jcr:content/par/produc t/formstart&:redirect=/content/thread/en/user/cart.html&productId=151515:profile="+profile ;
                         $.ajax({ 
                type: "POST", 
                url: "/content/women/evening/dresses/l-k-bennett-davinadress.html", 
                data: dataString, 
                success: function(data) { 
    In this example I have hardcoded a product ID of 151515.
    In order to save the property as a multi string field you simply replace &productId=151515 with &productId=151515&productId=131313&productId=141414 or as many extra values as you want to build into that string. This stores a productId property against a user profile.
    The issue comes from calling that data back. Using var value = CQ_Analytics.ProfileDataMgr.getProperty("productId") I can get the first value of this array (or the single value if only one is stored).
    However there does not seem to be a way to get any of the other stored values in the array using getProperty. Does anyone know how I can achieve this?

    Hi,
    Don't think that's possible. Even if it were, you wouldn't be able to use/display BOOLEAN type in SQL.
    If you just aim to see what they are, you could do something like this
    select text
      from all_source
    where owner = 'SYS'
       and name = 'DBMS_DB_VERSION'
       and type = 'PACKAGE';Or even
    select dbms_metadata.get_ddl('PACKAGE', 'DBMS_DB_VERSION', 'SYS') from dual;My version is:
    SQL> select * from v$version where rownum = 1;
    BANNER                                                         
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    1 row selectedIn 11g you also have [PL/SCOPE|http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10471/adfns_plscope.htm#ADFNS02203] which might help you even more.
    Regards
    Peter

  • How can i get all values from jtable with out selecting?

    i have one input table and two output tables (name it as output1, output2). Selected rows from input table are displayed in output1 table. The data in output1 table is temporary(means the dat wont store in database just for display purpose).
    Actually what i want is how can i get all values from output1 table to output2 table with out selecting the data in output1 table?
    thanks in advance.
    raja

    You could set the table's data model to be the same:
    output2.setModel( output1.getModel() );

  • How can I get all Login/Logout details

    How can I get all Login/Logout details of all SAP Users from SAP Server/Database of any one year? I am asking about SAP License User. Is their any Table or Report by which I can get these details? For example USR02(Logon Data) Table store the last login/logout details of SAP Users. So in same way is any table which store Users Login/Logout details through out a year or month.

    Hi Sudheer,
    Check this .
    You can find the transactions by a particular user from the transaction SM04.
    SM04 gives you the details of the users logged in,terminals,transactions the user is working on, the time he has logged in,no of sessions user has opened, and the memory used by the user's programs... all of that w.r.t to the client we login. but we can't get info like date and number of times the user has logged in.
    U can see tables:
    USR01 User master record (runtime data)
    USR02 Logon data
    USR03 User address data
    USR05 User Master Parameter ID
    USR12 User master authorization values
    plz rewards points if helpful
    cheers
    srinivas.k
    Edited by: k srinivas on Apr 28, 2008 11:54 AM

  • How can I get all prctr ( profit centers ) ?

    While creating function module,
    I have created import parameter as 'ZIMPORT_PRCTR' for Profit Center
    ( cepc-prctr ) in my zfunction module .
    It takes( imports ) input of multiple values Profit Center.
    Next what I need to do is, if end user enters multiple values of profit center
    ( IF ZIMPORT_PRCTR[] IS NOT INITIAL. )
    Then…  I have to use user entered values for picking up some other data from other tables.
    Ques). IF user don’t enter any profit center value, then
    I need to take all profit centers into consideration and pick up other data from other tables  .
    How can I get all profit centers ( if user does’t enters any value )
    And I don't have any values to use in my where condition ?
    Could you please help me ?

    create one structure in Se11 like
    profit center low
    profit center high
    option
    sign ( Like select-option ,see the rsparams structure),use this strucire in Function module ..
    when compare the data in select query ,in where condition use as in operator,if user does not enter any value ,it gets the all the value from table.

  • How can I get all photos from iPhoto to automatically back up to iCloud from my Mac OSX Version 10.6.8 operating system.  Not enough memory to upgrade.

    How can I get all photos from iPhoto to automatically back up to iCloud from my Mac OSX Version 10.6.8 operating system.  Not enough memory to upgrade.

    You can't.  iCloud is not for general file backup from a Mac. It's for backup up and syncing data between mobile devices and and Macs and  The following is from this Apple document: iCloud: Backup and restore overview.
    iCloud automatically backs up the most important data on your (mobile) device using iOS 5 or later. Once you have enabled Backup on your iPhone, iPad, or iPod touch .....
    What is backed up
    You get unlimited free storage for:
    Purchased music, movies, TV shows, apps, and books
    Notes: Backup of purchased music is not available in all countries. Backups of purchased movies and TV shows are U.S. only. Previous purchases may not be restored if they are no longer in the iTunes Store, App Store, or iBookstore.
    Some previously purchased movies may not be available in iTunes in the Cloud. These movies will indicate that they are not available in iTunes in the Cloud on their product details page in the iTunes Store. Previous purchases may be unavailable if they have been refunded or are no longer available in the iTunes Store, App Store, or iBookstore.
    You get 5 GB of free iCloud storage for:
    Photos and videos in the Camera Roll
    Device settings (for example: Phone Favorites, Wallpaper, and Mail, Contacts, Calendar accounts)
    App data
    Home screen and app organization
    Messages (iMessage, SMS, and MMS)
    Ringtones
    Visual Voicemails
    But not from a Mac.  If you want to backup your photos and other important files I suggest you get an external hard drive and use  it with Time Machine.
    OT

  • I have an ancient laptop (from 2005) that has my entire music library. This laptop barely works and some keys don't type anymore. How can I get all this music transferred to another computer, or available to me on the cloud?

    I have an ancient laptop (from 2005) that has my entire music library. This laptop barely works and some keys don't type anymore. How can I get all this music transferred to another computer, or available to me on the cloud?

    No... do not move programs.
    About the iTunes library files
    Your iTunes library files track the media you add to iTunes, how you've organized it, and other information such as playlists. By default, these two files are in your iTunes folder:
    Mac OS X: /Users/username/Music/iTunes/
    Windows XP: C:\Documents and Settings\username\My Documents\My Music\iTunes\
    Windows Vista: C:\Users\username\Music\iTunes\
    Windows 7: C:\Users\username\My Music\iTunes\
    Windows 8: C:\Users\username\My Music\iTunes\

  • How can I get the default value of a particular preference programatically. I know I can see the default value for some of the preferences in about:config but, I need a programatic way to get the default value.

    <blockquote>Locked by Moderator as a duplicate/re-post.
    Please continue the discussion in this thread: [tiki-view_forum_thread.php?comments_parentId=702631&forumId=1]
    Thanks - c</blockquote>
    == Issue
    ==
    I have a problem with my bookmarks, cookies, history or settings
    == Description
    ==
    How can I get the default value of a particular preference in FireFox?.
    I know I can see the default value for some of the preferences in about:config but, I need a programatic way to get the default value.
    I see some that there are values for preferences in firefox.cs but I am not certain that these are being used as the default values for preferences. prefs.js in user's profile only has the updated values and not the default values.
    Any help towards acheiving this programtically is greatly appreciated.
    If the default values are stored in a file, kindly let me know the format in which it is stored for me to parse it programatically.
    == User Agent
    ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

    Dear Friend,
    Here when you have the callableSattement as ?=proc(?), the first ? is an output parameter. So you should register it as out parameter using registeroutparameter.
    Then you can get the value from the outparameter using callablestatement.getXXX().
    Try that way.
    For free tral versions of JDBC Drivers go to www.Atinav.com

  • How can I get ALL of my Google Calendars to show on the iCal on my iPhone? I see all of my Google Calendars on the iCal on my Mac, but I do not see them in the iCal on my iPhone. I only see one Google Cal, but not the others.

    How can I get ALL of my Google Calendars to show on the iCal on my iPhone?
    I see all of my Google Calendars on the iCal on my Mac, but I do not see them in the iCal on my iPhone. I only see one Google Cal, but not the others.

    https://www.google.com/calendar/iphoneselect

  • My old computer, and external that I had everything backed up on broke. Majority of my music I got from burning CD's that I no longer have. How can I get all my music on my iPod onto my new iTunes?

    Like I said, my back up broke and I can't get all of my music back by transfering purchases because I burned a lot of CD's I had collected from the past. I don't have any of those CD's anymore, so how can I get all of my music onto my new iTunes? Or am I just S.O.L.?

    Phone to Mac,this app lets you easily copy, transfer the music, videos and playlists from any iPod or iPhone directly into iTunes on any Mac.

  • How can I get the edited value from the editor in JTable

    I have a JTextField added as an editor to a cell in JTable.
    I value gets changed when I press enter.
    but in actionPerformed of the JTextField when I say
    String txtEditorValue = txtEditor.getText();
    I am getting the old value. How can I get the edited value? Thanks.

    Hi,
    I guess, your understanding of how JTable works together with its models is not good enough - for example the method getTableCellEditorComponent(...) of the TableCellEditor interface is used to get the component, that should be used as editing component - its second parameter is a value that should be used to setup the editing component - it is normally not the editing component itself.
    JTable uses an underlying TableModel to store the cell values - if you have edited a cell, JTable gets the value of the editing component by itself and stores it in the TableModel using its setValueAt(...) method. To retrieve this data you only need to query the TableModel using row and column of this cell as parameters
    say jt is your JTable, and row and column are the row and column of the cell - so to get the value, simply use
    Object obj = jt.getModel().getValueAt(row,column);
    if you know, that there is a String in this cell use
    String str = (String) jt.getModel().getValueAt(row,column);
    The editor component is used for the view of the JTable - you only want the data, which is stored in the model - you don't have to deal with the GUI components in this case.
    greetings Marsian

  • How can I get all photos from the camera roll onto the photo stream so they will share between iphone and ipad?

    How can I get all photos from the camera roll, and all new pictures taken, to get on the photostream so they can share between iphone and ipad?

    When turning PhotoStream on with photos available in the Camera Roll, only photos captured by the iPhone or saved on the iPhone are placed in the PhotoStream.
    For all photos that were in the Camera Roll prior to turning PhotoStream on, import the photos with your computer and add the photos to your PhotoStream on your computer.

  • How Can I get multi column values from dynamic search help?

    Hi Gurus;
    I'm using dynamic search help in my program.
    I want to get multi column values from search help. But I dont know solution for this issue.
    I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
    How Can I get multi column values from dynamic search help?
    Thanks.

    Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
    I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
    There are like 3 steps.
    You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
    Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined  (just to keep it straight, i will be putting here) data:  It_return type standard table of ddshretval.
    Next step is to call the function module. Make sure you have values in IT_VALTAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
            retfield        = 'FLD2'
            value_org       = 'S'
          tables
            value_tab       = It_VALTAB
            return_tab      = It_return
            dynpfld_mapping = It_dynpfld
          exceptions
            parameter_error = 1
            no_values_found = 2
            others          = 3.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        else.
          perform get_selected_fields tables It_return.
        endif.
    The code within the perform GET_SELECTED_FIELDS  - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
    I need a internal table as well as a work area here. like,
    data: lt_fields type table of dynpread,
            la_fields type dynpread.
      field-symbols: <fs_return> type ddshretval.
    so fill out LT_FIELDS from the IT_RETURN table
    loop at lt_return assigning <fs_return>.
        la_fields-fieldname = <fs_return>-retfield.
        la_fields-fieldvalue = <fs_return>-fieldval.
        append la_fields to lt_fields.
        clear: la_fields.
      endloop.
    Call the FM to update the dynpro
    call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
        tables
          dynpfields           = lt_fields
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    good luck

Maybe you are looking for

  • How to file mask in sender seeburger SFTP adapter

    Hello Gurus, Please help on How to perform a file mask in sender seeburger SFTP adapter? eg. I want to pick all the files but not *.tmp files. thanks Kishore

  • Clear up the supplier's payment term

    Dear all,       Up to now, there have 474 supplier's payment term in our R/3 system. We plan to clear up the supplier's payment term so that only 60 supplier's payment term will be reserved. The others payment term are not been used in vendor master

  • Cannot start Adobe Reader 8 on WinXP

    For months, Adobe Reader 8 was working fine. I'm not sure what changed, but a couple of weeks ago, it quit working at all. * When I double-click the Reader icon on my desktop, nothing happens. * When I double-click a .pdf file, nothing happens. * Whe

  • Passing function value into another procedure

    Hi From this package the value returned by the function " FIRST " needs to pass into another procedure as parameter in the same package, how could i do that in a better way.Oracle Version 8.1.7.4.0. CREATE OR REPLACE package body PKG_CUST_CHECK is FU

  • Transfer address book to Lion

    How do I translate the address book info from a previous system to Lion's address book?