Procedure to get semicolon seperated values using select query

I have got a requirement where I need to return a string with semi colon separated values. Input will also be a semi colon separated values I need to fetch data from tables and append those values into a string seperated by a semi colon.
Example
CREATE OR REPLACE
PROCEDURE GET_MAIL_IDS_FROM_ROLES
(roleIds IN varchar, mailIds OUT varchar)
select * from xxx where roles in (roleIds )
Thankyou

Haven't tested it, but this could be a start:
CREATE OR REPLACE PROCEDURE GET_MAIL_IDS_FROM_ROLES
(roleIds IN varchar, mailIds OUT varchar)
type mailid is table of owner.xxx.mailid%type indexed by pls_integer;
mail_id mailid;
cursor c1
  select mailid from xxx where roles in (roleIds);
begin
open c1;
fetch c1 bulk collect in mail_id;
mailIds := mail_id(1);
for i in 2 .. mail_id.count loop
   mailIds := mailIds||';'||mail_id(i);
end loop;
close c1;
end;

Similar Messages

  • Fetching values using select query

    Hi i want to get the details of belnr and bukrs using the where codn fields bukrs,anlkl,brdatu,ktansw,budat,WBS element.
    1)The value of bukrs is entered in the selection screen
    2)the value of asset class is optional and present in the anka
    3)brdatu is already fetched and placed in a table.field brdatu is present in table j_ittaxdep
    4)ktansw is entered in the selection screen and present in table j_ittaxdep
    5)budat is fetched and placed in a table.
    6)wbs element already fetched and  is present in prps table.
    Can anyone please tell how to code.actually the values of bukrs,anlkl ktansw, are present in structure anlav,brdatu is present in structure rbada and budat is present in structure anek.By using this structure is there way to get the belnr and bukrs value.

    Hi,
    Hema,
    things are not so flate as you are thinking.
    first u understand for which application u are using these Queries.Ask ur functional guy to confirm the usage tables.Then use thsee tables to get the data into u r internal tables and for these internal tables value u have to fetch belnr bukrs fronm bseg or FI table .
    so first confirm the tables the plan how to get data.
    if u need my help the write me in brief?
    Regards
    Ricky

  • How to get Metadata column values using powershell(CSOM)

    Hi,
    I am trying to get list column values using Powershell (CSOM), but I am getting for Metata data columns.
    I am getting internal value as System.Collections.Generic.Dictionary`2[System.String,System.Object] 
    Can anybody let me know how to get the values for metadata columns?
    Any help would be greatly appreciate.
    Thank you.
    AA.

    Hi
    Go through the links. It'll help.
    SharePoint 2013 Code Tips – Setting a Managed Metadata Field with the Client Object Model(CSOM and JSOM)
    Indul Hassan
    Microsoft Community Contributor
    http://www.indulhassan.com
    You Snooze.. You Lose !!

  • How to get STPOV structure values using BOM number and Plant number

    hello All,
    could you please help me out
    'How to get  STPOV structure values using BOM number and Plant number'
    is there any function module where can i give input as bom and plant number .
    waiting for your response.
    regards
    srinivas

    I did a quick where-used lookup in SE11 on the structure STPOV in function module interfaces and came up with the following:
    Function Module                             Short Description                                          
    CK_F_TOTALCOST_COMPUTE                                                                      
    CS_ALT_SELECT_COUPLED_PRODUCT                                                               
    CS_WHERE_USED_CLA                Bills of material; class use                               
    CS_WHERE_USED_CLA_ANY        Bills of material; direct class use or via other class     
    CS_WHERE_USED_CLA_VIA_CLA        Bills of material; class use via classes                   
    CS_WHERE_USED_COP                                                                           
    CS_WHERE_USED_DOC                Bills of material; document use                            
    CS_WHERE_USED_DOC_ANY:Bills of material; direct and (indirectly) document use via
    CS_WHERE_USED_DOC_VIA_CLA        Bills of material; document use via classes                
    CS_WHERE_USED_KNO                Bills of material; use object dependency                   
    CS_WHERE_USED_MAT                Bills of material; where-used list                         
    CS_WHERE_USED_MAT_ANY:Bills of material; where-used list as article or class item
    CS_WHERE_USED_MAT_VIA_CLA        Bills of material; where-used list via classes             
    EXIT_SAPMC29M_001                BOM; Article Where-Used List   
    It appears that this structure is primarily used for where-used look-ups for components within the BOM.  I don't know if any of these are what you're in need of.
    Hope this helps,
    Mark Schwendinger

  • To display 01 to 10 using select query

    Hi all,
    using select query...
    In where clause...,
    If u give 1 to 9 it should display 01 to 09 and
    If u give 10 it should display as 10.
    I want it in a single query .
    Thanks & Regards,
    Hariharan ST.

    Just need to build a where condition to the query posted by ascheffer -
    Something Like this -
      1  Select rn
      2  From   ( Select To_Char(ROWNUM, '09')  rn
      3           From   Dual
      4           Connect By rownum < 11
      5         )
      6  Where  (     (       Trim(rn) < 10
      7                 And '&Param' = '1 to 9'
      8               )
      9           Or (       Trim(rn) = LPAD('&Param', 2, 0)
    10              )
    11*        )
    SQL> /
    Enter value for param: 10
    old   7:                And '&Param' = '1 to 9'
    new   7:                And '10' = '1 to 9'
    Enter value for param: 10
    old   9:          Or (       Trim(rn) = LPAD('&Param', 2, 0)
    new   9:          Or (       Trim(rn) = LPAD('10', 2, 0)
    RN
    10
    SQL> /
    Enter value for param: 7
    old   7:                And '&Param' = '1 to 9'
    new   7:                And '7' = '1 to 9'
    Enter value for param: 7
    old   9:          Or (       Trim(rn) = LPAD('&Param', 2, 0)
    new   9:          Or (       Trim(rn) = LPAD('7', 2, 0)
    RN
    07
    SQL> /
    Enter value for param: 4
    old   7:                And '&Param' = '1 to 9'
    new   7:                And '4' = '1 to 9'
    Enter value for param: 4
    old   9:          Or (       Trim(rn) = LPAD('&Param', 2, 0)
    new   9:          Or (       Trim(rn) = LPAD('4', 2, 0)
    RN
    04
    SQL> /
    Enter value for param: 1 to 9
    old   7:                And '&Param' = '1 to 9'
    new   7:                And '1 to 9' = '1 to 9'
    Enter value for param: 1 to 9
    old   9:          Or (       Trim(rn) = LPAD('&Param', 2, 0)
    new   9:          Or (       Trim(rn) = LPAD('1 to 9', 2, 0)
    RN
    01
    02
    03
    04
    05
    06
    07
    08
    09
    9 rows selected.Shailender Mehta

  • How to call an Oracle Procedure and get a return value in Php

    Hi Everyone,
    Has anyone tried calling an Oracle procedure from Php using the ora functions and getting the return value ? I need to use the ora funtions (no oci)because of compatibility and oracle 7.x as the database.
    The reason why I post this here is because the ora_exec funtion is returning FALSE but the error code displayes is good. Is this a bug in the ora_exec funtion ?
    My code after the connection call is as follows:
    $cur = ora_open($this->conn);
    ora_commitoff($this->conn);
    $requestid = '144937';
    echo $requestid;
    $rc = ora_parse($cur, "begin p_ins_gsdata2
    (:requestid, :returnval); end;");
    if ($rc == true) {
    echo " Parse was successful ";
    $rc2 = ora_bind ($cur, "requestid", ":requestid", 32, 1);
    if ($rc2 == true) echo " Requestid Bind Successful ";
    $rc3 = ora_bind ($cur, "returnval", ":returnval", 32, 2);
    if ($rc3 == true) echo " Returnval Bind Successful ";
    $returnval = "0";
    $rc4 = ora_exec($cur);
    echo " Result = ".$returnval." ";
    if ($rc4 == false) {
    echo " Exec Returned FALSE ";
    echo " Error = ".ora_error($cur);
    echo " ";
    echo "ErrorCode = ".ora_errorcode($cur);
    echo "Error Executing";
    ora_close ($cur);
    The Oracle procedure has a select count from a table and it returns the number of records in that table. It's defined as:
    CREATE OR REPLACE procedure p_ins_gsdata2 (
    p_requestid IN varchar2 default null,
    p_retcode OUT varchar2)
    as
    BEGIN
    SELECT COUNT (*) INTO p_retcode
    FROM S_GSMRY_DATA_SURVEY
    WHERE request_id = p_requestid ;
    COMMIT;
    RETURN;
    END;
    Nothing much there. I want to do an insert into a table,
    from the procedure later, but I figured that I start with a select count since it's simpler.
    When I ran the Php code, I get the following:
    144937
    Parse was successful
    Requestid Bind Successful
    Returnval Bind Successful
    Result = 0
    Exec Returned FALSE
    Error = ORA-00000: normal, successful completion -- while
    processing OCI function OBNDRA
    ErrorCode = 0
    Error Executing
    I listed the messages on separate lines for clarity. I don't understand why it parses and binds o.k. but the exec returns false.
    Thanks again in advance for your help. Have a great day.
    Regards,
    Rudi

    retcode=`echo $?`is a bit convoluted. Just use:
    retcode=$?I see no EOF line terminating your input. Your flavour of Unix might not like that - it might ignore the command, though I'd be surprised (AIX doesn't).
    replace the EXEC line with :
    select 'hello' from dual;
    and see if you get some output - then you know if sqlplus commands are being called from your script. You didn't mentioned whether you see the banner for sqlplus. Copy/paste the output that you get, it will give us much more of an idea.

  • Issue in getting current row value using getCurrent Value

    Issue:When I call ththe method executeSearchVO from controller class
    with Row row = personalActionSearchVO.first();
    I am getting the corresponding value.
    but my requirement is I have multiple record , If i press action on any of the record, I need to read SITName value for the particular record and need to pass it as parameter to other pager(i mean If i select any record, I need to get corresponding value in the attribute for the record.)
    if i comment personalActionSearchVO.first(); i am getting null pointer exception.
    Pl. helpme how to get current row instead of first row always.
    AMIMPL Clause
    public void executeSearchVO(String loginPersonId)
    XXHRPersonalActionSearchVOImpl personalActionSearchVO =getXXHRPersonalActionSearchVO1();
    personalActionSearchVO.initQuery(loginPersonId);
    // Row row = personalActionSearchVO.first();
    row = personalActionSearchVO.getFirstFilteredRow("action","1");
    Row masterRow = row;
    personalActionSearchVO.setCurrentRow(masterRow);
    OARow Row1 = (OARow)personalActionSearchVO.getCurrentRow();
    System.out.println("Org "+Row1.getAttribute("Organization"));
    calling this method from controller clause
    if("action".equals(pageContext.getParameter(EVENT_PARAM)) )
    System.out.println("Person Id "+ pageContext.getParameter("XXHRPersonId"));
    Serializable methodParams[] = {pageContext.getEmployeeId()+""};
    applicationModule.invokeMethod("executeSearchVO",methodParams);
    need it urgently. pl. help
    thanks
    siva

    Timo,
    I am new to Jdevloper. I will explain the issue in detail.
    Version: Oracle 9i Jdeveloper
    I have a query page with multiple records. when I perform action , I need to pass 2 parameters from query screen to my actual page.
    1 parameter is Login person Id,. Now the issue is with getting current value for 2nd paramenter. 2nd Parameter will be changed depends upon record i am choosing in my query page: column is : Information Name.
    when I use getcurrentrow , I am getting null pointer exception.
    My controller class when I click action button :
    if("action".equals(pageContext.getParameter(EVENT_PARAM)) )
    Serializable methodParams[] = {pageContext.getEmployeeId()+""};
    applicationModule.invokeMethod("executeSearchVO1",methodParams);
    {color:#993300}
    // Here I need to get InformationName value based on the record I am choosing{color}
    HashMap hashMap = new HashMap(2);
    hashMap.put("XXHRPersonId", pageContext.getParameter("XXHRPersonId"));
    // hashMap.put("InformationName", methodParams);
    pageContext.forwardImmediately(
    "OA.jsp?page=/xxhr/oracle/apps/xxhr/selfservice/personalaction/webui/XXHRPersonalActionPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    hashMap,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO
    my AMIMPL Clause :
    I am just pasting whatever I have tried. Pl. suggest me If my code is wrong.
    *{color:#993300}I need to get current row information value from the below method*
    *{color}*
    public void executeSearchVO1(String loginPersonId)
    XXHRPersonalActionSearchVOImpl personalActionSearchVO =getXXHRPersonalActionSearchVO1();
    personalActionSearchVO.initQuery(loginPersonId);
    System.out.println("Row count "+personalActionSearchVO.getRowCount());
    // Row row = personalActionSearchVO.first();
    Row row = personalActionSearchVO.getCurrentRow();
    System.out.println("Informaton Name "+row.getAttribute("InformationName");
    In this , If i initialzie with Row row = personalActionSearchVO.first();I am able to get value for my column Information Name.
    whereas, if I use directly Row row = personalActionSearchVO.getCurrentRow();, i am getting null pointer exception.
    Pl. let me know how to get current row value for Information Name.
    Looking for the reply at the earliest.
    Thanks
    siva

  • How to Get the Job, Cost center, Position description using select query

    Hi all,
    How to get the  Job, Cost center, Position description through select query without using the Function module?
    thanks,
    Prasad

    use adhoq query and take the report chose both text and value

  • Wildcard search for numeric values using select ?

    Hi,
    I want do wildcard search for numeric fields of the table.
    For charcter/string i have used - select * from XX_TABLE where param1 like 'SS%'. But this query doesnt work when para1 is numeric. Please let me know first whether this is possible ? if yes how to achieve it ?
    Thanks in advance,
    Shrinivas

    Hi Jack,
    The numeric field is of  8 digits, so when i give search critera as '66', it should return values 66000000, 660000, 6600 etc. so i was not able to give between some range. I also tried storing all these values in internal table and the segregate the values it contains '66*'. This worked well but requires lot of coding effort.Please suggest if you guys have any better method ?
    Thanks,
    Shrinivas

  • Want to get id's value using xpath.

    Hi all,
    I want to get id attribute's value using xpath.
    my xml file as follows:
    <book>
         <person id="1">
                <first id="2">Kiran</first>
                <last id="3">Pai
                        <name id="4">das</name>
                </last>
                <age id="5">22</age>
         </person>
         <person id="6">
                <first id="7">Bill</first>
                <last id="8">Gates</last>
                <age id="9">46</age>
         </person>
         <person id="10">
                <first id="11">Steve</first>
                <last id="12">Jobs</last>
                <age id="13">40</age>
         </person>
    </book>I want to get the id value of name. using xpath-->//book[0]/person[0]/last[0]/name[0]/[@id]..is this a valid xpath to get the id's value? my java code as follows:
    import java.io.File;
    import java.util.HashMap;
    import java.util.Map;
    import java.util.Stack;
    import javax.xml.parsers.*;
    import javax.xml.xpath.*;
    import org.w3c.dom.Document;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    public class Evaluate {
         public static void main(String[] args) {
              String xp = "//book[0]/person[0]/last[0]/name[0]"+"/[@id]";
              String id="";
          try{
               // parse the XML as a W3C Document
              DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();// Create the parser
            Document doc = docBuilder.parse(new File("book.xml"));
             XPath xpath = XPathFactory.newInstance().newXPath();
             doc.getDocumentElement().normalize();
             XPathExpression xPathExpression = xpath.compile(xp);//-->getting error here
             id=xPathExpression.evaluate(xp).toString();
             id=xPathExpression.evaluate("person");
             System.out.println("id=" +id);
                  System.out.println("xp=" +xp);
                  }catch(Exception err){
                    System.out.println("Errpr= "+ err);
    can anyone please help me ?

    No, I believe that XPath indexes begin with 1, not with zero.

  • Deafaul Value using SQL query

    Hi
    I'm trying to make a default value using Computations;
    when I create computation,
    I select
    Computation item: PXX_TEST
    computation type: SQL query
    computation Point: I tried all
    Computation: select X FROM Y WHERE X= '1'
    This is the way to get Default Value ??
    I need to display the value when the page is open
    Thanks
    MM

    MM,
    You can use the default value attribute of the item to set a value if the item's source produces a null. A computation (before/after header) can work too, but it's possible that the item source and Source Used attribute (Always/Only) are interfering with your computation so you might want to try setting Source Used to 'Only...' if you have a computation setting the item.
    Scott

  • Order mismatch in selected data using Select query

    Hello Experts,
    We are upgrading from 4.6C to ECC6. I came across a select query on a custom table, which gives different order of data from 4.6C to ECC6. Data (no. of records) is same in both the servers but order is different. Table doesn't have indexes in either 4.6C or ECC6. What would be the cause for order change?
    Further, in 4,6C, ECC6 and data bases order of the data is totally different. Select query have some conditions in where clause with select options, but in both the cases (4.6C and ECC6) I am not passing any data from the selection screen so am getting entire data from the data base.
    Thanks in advance
    Phalani

    From the SAP service market place I found that
    1. Unless we use SORT or ORDER BY clause the order of the data is not in our control.
    2. In 4.6C, two same select queries never give the result in the same order, if the primary key contains character fields.
    Thanks for your help.
    Phalani

  • How to sum a column value using CAML Query?

    Hi All,
    I would like to sum the column value using CAML qeury. Actually in my list, I have two column "Projects Name" and "Number of Issues". Now need to get sum of "Number of Issues" column. How to achieve in CAML Query.
    Thanks in advance!

    Hi Sam,
    it looks like you can use your current view based agregation, otherwise it is not possible(
    http://msdn.microsoft.com/en-us/library/ms467521.aspx) and you need to work on custom bit on this requirement.
    use the below link and create a view element as described and see if that works for you
    Aggregations Element
    http://msdn.microsoft.com/en-us/library/ms468626%28v=office.12%29.aspx
    Another reference
    Query Element
    http://msdn.microsoft.com/en-us/library/ms471093.aspx
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • How to read repeated tag values using sql query

    Database version
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    Question
    How to get repeated tag values?
    <TXLife>
    <TXLifeRequest>
    <TransRefGUID>10bc80e7d60e59b0:a134d0:10d7c4674ad:-7ffd</TransRefGUID>
    <TransType tc="1203">OLI_TRANS_TRNHLD</TransType>
    <TransExeDate>2011-02-27</TransExeDate>
    <TransExeTime>15:06:35</TransExeTime>
    <InquiryLevel tc="3">OLI_INQUIRY_OBJRELOBJ</InquiryLevel>
    <InquiryView>
    <InquiryViewCode>PLANUPDATE_CHBM_1203A</InquiryViewCode>
    </InquiryView>
    <OLifE>
    <SourceInfo>
    <SourceInfoName>CHBM Admin Tool</SourceInfoName>
    </SourceInfo>
    <Activity id="Activity1" HoldingID="Holding1">
    <UserCode>User123</UserCode>
    <LastUpdate>2011-02-27</LastUpdate>
    <ActivityCode>CHBM10001</ActivityCode>
    <OLifEExtension VendorCode="0098" ExtensionCode="Activity">
    <ActivityExtension>
    <SubActivityCode>CHBM20002</SubActivityCode>
    <LastUpdateTime>15:06:35</LastUpdateTime>
    </ActivityExtension>
    </OLifEExtension>
    </Activity>
    <Holding id="Holding1">
    <HoldingTypeCode tc="6">Group Master Contract</HoldingTypeCode>
    <Purpose tc="36">Business Protection and Preservation</Purpose>
    <Policy>
    <CarrierAdminSystem>CHBM</CarrierAdminSystem>
    <PolNumber>CHB0001234</PolNumber>
    <OLifEExtension VendorCode="0098" ExtensionCode="Policy">
    <PolicyExtension>
    <BillingDetail>
    <PaymentMode tc="3">Quarterly</PaymentMode>
    <BillingOrder tc="1009800002">Employee ID</BillingOrder>
    </BillingDetail>
    <SalaryAllotment>12354333</SalaryAllotment>
    </PolicyExtension>
    </OLifEExtension>
    </Policy>
    <Attachment id="Attach1">
    <DateCreated>2011-02-27</DateCreated>
    <UserCode>System</UserCode>
    <AttachmentBasicType tc="1">Text</AttachmentBasicType>
    <Description>Event 4</Description>
    <AttachmentData>Event Log</AttachmentData>
    <AttachmentType tc="1009800001">Transaction Log</AttachmentType>
    <AttachmentLocation tc="1">Inline</AttachmentLocation>
    <OLifEExtension VendorCode="0098" ExtensionCode="Attachment">
    <AttachmentExtension>
    <Sequence>2</Sequence>
    <CreationTime>16:05:45</CreationTime>
    </AttachmentExtension>
    </OLifEExtension>
    </Attachment>
    <Attachment id="Attach2">
    <DateCreated>2011-02-27</DateCreated>
    <UserCode>System</UserCode>
    <AttachmentBasicType tc="1">Text</AttachmentBasicType>
    <Description>Event 3</Description>
    <AttachmentData>Event Log</AttachmentData>
    <AttachmentType tc="1009800001">Transaction Log</AttachmentType>
    <AttachmentLocation tc="1">Inline</AttachmentLocation>
    <OLifEExtension VendorCode="0098" ExtensionCode="Attachment">
    <AttachmentExtension>
    <Sequence>1</Sequence>
    <CreationTime>16:01:54</CreationTime>
    </AttachmentExtension>
    </OLifEExtension>
    </Attachment>
    <Attachment id="Attach3">
    <DateCreated>2011-02-27</DateCreated>
    <UserCode>P62350</UserCode>
    <AttachmentBasicType tc="1">Text</AttachmentBasicType>
    <Description>Note 2</Description>
    <AttachmentData>Enter notes on changes or edits to plan</AttachmentData>
    <AttachmentType tc="14">Note</AttachmentType>
    <AttachmentLocation tc="1">Inline</AttachmentLocation>
    <OLifEExtension VendorCode="0098" ExtensionCode="Attachment">
    <AttachmentExtension>
    <Sequence>2</Sequence>
    <CreationTime>16:02:23</CreationTime>
    </AttachmentExtension>
    </OLifEExtension>
    </Attachment>
    </Holding>
    </OLifE>
    </TXLifeRequest>
    </TXLife>
    Expected output shoulb be like this
    Description AttachmentType AttachmentData
    Event 4 Transaction Log Event Log
    Event 3 Transaction Log Event Log
    Note 2 Note Enter notes on changes or edits to plan
    Please help me any one on this
    Edited by: LRAJESH on Apr 20, 2011 8:27 AM

    SELECT
    t2. Description des,
    t2.AttachmentType attty,
    t2.DateCreated DateCreated,
    t2.UserCode UserCode,
    t1.Planid Planid,
    t2.createdtime,
    t1.Ausercode Ausercode
    FROM (
    SELECT xData doc
    FROM dual
    ) temp_table,
    XMLTable ( '/TXLife/TXLifeRequest/OLifE' passing doc
    COLUMNS
    Planid varchar2(20) path 'Holding/Policy/PolNumber',
    AttachmentType xmltype path 'Holding//Attachment' ,
    Ausercode varchar2(20) path 'Activity/UserCode'
    ) t1,
    XMLTable
    '/Attachment'
    passing t1.AttachmentType
    columns
    Description varchar2(1000) path 'Description',
    AttachmentType varchar2(1000) path 'AttachmentType/@tc',
    DateCreated varchar2(20) path 'DateCreated',
    createdtime varchar2(20) path 'OLifEExtension/AttachmentExtension/CreationTime',
    UserCode varchar2(200) path 'UserCode'
    ) t2

  • Table names to get list of characteristics used in Query

    Hello,
    I am trying to get separate list of characteristics & key figures used in query. i want that particular table which will give me the list of characteristics. & other table which will give me list of key figures used in that query. I want these characteristics & keyfigures specifically used in query.I don't want the global list dependant on infoprovider but dependant on query like (ZSJM_ZSD_C05_Q001).
    Can anybody help in getting the table names?
    Thanks in advance.

    Hi Deepak,
    You need to go to RSRREPDIR - to get the GUID of the query.
    Then you can work your way through  RS* X *REF (type in this name in SE11/SE16 and press F4 ) table to find the query elements.
    There is also a text table where you can read the component names... but dont have the system at hand, hence cant furnish you that info... I think, it may be RSZELTTXT.
    Also in my opinion the best way to get this information is from metadata repository view in admin workbench.(RSA1). Keep drilling down from the query to its characteristics.. you shall get what you need.
    Also you may use transport connection to display the elements of the query. Just go to the transport connection , in the object list, choose the required query and and transfer it to the collector area. Diplay the elements as a list... you shall then find all your query elements...
    You may not need to traverse through the tables to retrieve this information.
    Hope it helps,
    Best regards,
    Sunmit.

Maybe you are looking for