How to dynamically list field names

Hello,
I have a DB Link to a SQL 2000 Server and can connect and retrieve using Heterogenous Servives.
Let say I issued a Select (eg., Select * from tab@remote1), how do I dynamically list each field name from the result?
Thank you.

The best way to deal with dynamic column names from a SQL result is to use a cursor describe interface.
A SQL SELECT may not select all the columns from a table. It may join tables. It may add derived and calculated columns to the result.
None of these will be seen when using the data dictionary. Also, using a remote heterogeneous data dictionary? That does not sound like a sensible approach to me.
In PL/SQL, one can create DBMS_SQL cursors. These cursors can be "described" - i.e. the describe interface for a cursor tells you what the contents are, the column names, the data types, the precision, etc.
Using DBMS_SQL allows you to describe any result set from any SELECT statememt. A far superior and accurate method than to go data dictionary hunting to determine just which column could be in a result set.

Similar Messages

  • How to dynamically add field name in where clause of select query in web dynpro?

    Hello,
    Can any body tell me how i can use select query with dynamic wheere condition.
    i have a requirement like there are multiple input fields  and i want to select data from two database
    and condition may vary .

    Hi
    In the where clause you need to write like
    WHERE NAME LIKE 'DE%'
    Regards
    Sudheer

  • HR - dynamic selections field name and field value in the program

    HI all,
       I am using dynamic selections for a HR report.
    I have created a view with 20 fields and added it to HR report category ___00003(All fields suppressed).
    I need to check these fields in the program. But i am not able to get the field name and value in the program for dynamic selections fields.
    Please let me know how to get the field names and values in the program for dynamic selections .
    Thanks,
    Kranthi.

    You have to read the itab <i>pnpdynse</i> in your Program to obtain the Dynamic Selection values. This itab has a deep structure.. you can set a break point in one of the events before <b>get pernr</b> & in the debug mode, you will able to display the itab <i>pnpdynse</i>.. you can then identify how to get the values into your code..
    ~Suresh

  • How to get the field name of an internal table during runtime?

    How to get the field name of an internal table during runtime?

    Hi  Sudhir,
    Declare and Use Get Cursor Field in Your Prm to get the field Name of the Intenal Table
    Example Code:
        <b>  DATA: v_field(60).                        " Insert this code.
         GET CURSOR FIELD v_field.        " Insert this code.</b>
         <b>CHECK v_field = 'ITAB-KUNNR'.    " Insert this code. (or)
    Write: v_field.</b>
    Regards,
    Ramganesan K.

  • How to dynamically set column name in Answers

    Hi.
    How to dynamically set column name in Answers, for example I want to put presentation variable in column header. Is this possible?
    Regards,
    Goran Ocko
    http://108obiee.blogspot.com/

    May be a rude way .. but it works.
    Add narrative view and use Java script to change the column headings based on the variables.
    <script language="javascript" type="text/javascript">
    var a = document.getElementById('idResultsTableParent');
    var rows= a.getElementsByTagName('tr');
    rows[1].cells[1].innerText ="@{Presentation Variable}";
    </script>
    Editing the same post to remove irrelevant information.
    - Girish

  • How to give own field  name in alvgrid

    how to give own field name in alvgrid
    CLEAR LS_FIELDCAT.
      LS_FIELDCAT-TABNAME       = G_TABNAME.
      LS_FIELDCAT-FIELDNAME     = 'KBETR'.
      LS_FIELDCAT-REF_FIELDNAME = 'KBETR'.
      LS_FIELDCAT-REF_TABNAME   = 'KONV'.
      APPEND LS_FIELDCAT TO  RT_FIELDCAT.
    here i want to give field name in output like this
    Non-Deductible Tax.
    thanks in advanced.

    Hi Laxman,
    Getting your required description is very simple.
    Just fill these 3 parameters in your field catalog.
    CLEAR LS_FIELDCAT.
    LS_FIELDCAT-TABNAME = G_TABNAME.
    LS_FIELDCAT-FIELDNAME = 'KBETR'.
    LS_FIELDCAT-REF_FIELDNAME = 'KBETR'.
    LS_FIELDCAT-REF_TABNAME = 'KONV'.
    LS_FIELDCAT-SELTEXT_L = 'NON-DEDUCTIBLE TAX''. "LONG
    LS_FIELDCAT-SELTEXT_M = 'NON-DEDUCTIBLE TAX''. "MEDIUM
    LS_FIELDCAT-SELTEXT_S = 'NON-DEDUCTIBLE TAX''. "Short
    APPEND LS_FIELDCAT TO RT_FIELDCAT.
    The Comments besides the desctription tells what kind of format for display is ..
    Regards,
    Raghav

  • Evaluating dynamically generatedform  field names

    On form submission I need to find out if check boxes exist
    and have values. The field names are generated dynamically &
    there could be many. Here's the code I've been messing with. I am
    able to find out it the field has a value if it exists, but I can't
    figure out how to combine this with isDefined("") to test for the
    field's existence and avoid the "field i not defined in form"
    errors.
    <cfloop index="a" from="1" to="#form.numRows#">
    <cfset thisname = "form." & #a# & "_Clear">
    <!--- how do I use isDefined("") at this point to avoid
    an error on the next line when the field does not exist? --->
    <cfset thisVal= Evaluate("form.#thisname#")>
    <cfoutput> #thisname# #thisVal# </cfoutput>
    </cfloop>
    Thanks in advance for any help!

    run a loop over your field names like: <cfloop index="x"
    list="#form.fieldnames#"> then you have all of your form field
    names that are defined.

  • How to find the field name of variable system information on SAP B1

    Hi All,
    I recently wanted to create a simple SQL query to list all ITEM MASTER DATE where the weight is blank.  This is so i can get a list of all items with the weight information missing from the system to investigate. 
    It turns out the weight field within the SALES DATA tab is a system variable.  When i pull the OITM table up within the query generator i can not identify where this variable name come up without guessing which can give me the wrong information.
    Can someone point me into the direction on how to assisocate variable to a field name within SAP B1. This is also another problem if i wanted to display variable within Crystal report layout.
    Regards

    Hi Nick Dang,
    Try This
    SELECT T0.[ItemCode], T0.[ItemName], T0.[SalUnitMsr], T0.[SHeight1],  T0.[SWidth1], T0.[SLength1], T0.[SVolume], T0.[SWeight1] FROM OITM T0 WHERE T0.[ItemCode] =[%0]
    Thanks,
    Srujal Patel

  • How to change the field name in SUS

    HI,
    In the section view all PO's, I want to change the field name  <b>document number</b> to <b>invoice number</b>.Please do let me know how to go about it.
    Thanks in advance ,
    Manu

    Hi,
    The text ID should be first identified in the BSP (BBP_SUS_UI/DOC_NUMBER?)
    Next execute SOTR_EDIT and use the FInd button. Enter the package of the BSP object (BBP_SUS_U?) and select the language as English. Execute the program and you will a complete list of text used in SUS screen. Locate the text ID as above and double click to change based on what you need.
    Regards.

  • Changing ALV list field name

    Hi
    In webdynpro application the  ALV list display the field name which is in table description i want to put my preferable field name. Do u all  have any idea how is it possible

    Hello,
    U could bult the fildcatalog like this:
    * Sales Order Number
      CLEAR L_FIELDCAT.
      L_FIELDCAT-TABNAME   = 'G_T_OUTTAB'.
      L_FIELDCAT-FIELDNAME = 'VBELN'.
      L_FIELDCAT-SELTEXT_M = TEXT-002.  " Ur own text
      L_FIELDCAT-COL_POS   = 1.
      L_FIELDCAT-KEY = 'X'.
      APPEND L_FIELDCAT TO IT_FIELDCAT.
      CLEAR  L_FIELDCAT.
    If useful reward.
    Vasanth

  • How to return all field names in a table

    How do you write a report to return all field names in a table? I prefer the field names in a column.
    Thanks
    Wayne

    Hi,
    In Oracle it is,
    Select column_name from user_tab_cols where table_name  = 'Table_Name';
    Note: Table_Name should be in capital letters
    In MS SQL Server it is,
    SELECT Column_Name + ', '
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME = 'Table_Name'
    Hope this helps!
    Thanks
    -Azhar

  • How to capture the field name on a form when it's double-clicked?

    Hello,
    I plan to create a two field Help table that uses the thirty or so unique field names on the user form in field one. The second field is a Memo type field that contains the Help information for each field.
    Once I know the field name clicked, I will probably use a query to retrieve the help information. I'm planning to use the Double-Click event so the users can double-click any field on the form to be presented the specific field related information
    from the Help table.
    How can I capture the name of the field that was double-clicked, so I can proceed with this project? Thank you.
    Cordially,
    John
    Thank you, John Portland, Maine

    Thank you, Hans,
    How about this code:
    Dim varClickedFieldName as String
    varClickedFieldName = ScreenActiveControl.ControlSource
    Or would you recommend other code?
    Cordially,
    John
    Thank you, John Portland, Maine

  • How to get the field names of a table

    hi all,
    i need to get all field names of a table. here i dont need any data. i need only field names.
    initially i used this query, select * from tname;
    the problem is if table have 1000 records, all records will be in memory.
    how to get this one.
    regards
    pavan.

    hi all,
    thanks a lot. the query is working.
    initially i given this query
    select column_name from user_tab_columns where table_name='mytable';
    but no rows selected.
    and i tried with this,
    select column_name from user_tab_columns where table_name='MYTABLE';
    this is working fine.
    thanks
    pavan.

  • How to retrieve the Field Name of a Table

    Hi guys,
    I'm trying to retrieve the field name of a table in java, but i don't know how to do it. Could somebody help me?Let say i have a table name Itemmaster, then
    i want to retrieve its field and display to dos prompt.
    Example :
    Item No.
    Description
    Quantity
    It is possible to retrieve the fields?
    What could be the possible command in java using packages Java.sql.*?
    Thanks in advanced...
    Best regards,
    Dharry

    The ResultSet class, which is how query results are returned in JDBC, has methods to get at the metadata for the table queried, including column names:
    ResultSet resultSet=statement.executeQuery("select * from table");
    resultSetMetadata=resultSet.getMetaData();
    resultSetMetadata.getColumnLabel(column+1);

  • How to display header fields names in the next page in report6i

    how to display repeat header field names into the next page in report6i urgent plz......
    When i am runing report in 1st page only the header information is displaying in 2 page the header info is not displaying only records are displaying.So i want to display the header info in 2nd page also.
    Plz help out.

    Hello,
    Go to the report layout model and select those items/objects which are not getting display on next page and open the property pallet by pressing F4 key and set the property Print Object On to All Pages then it will display on all pages.
    -Ammad

Maybe you are looking for

  • Older Apple HD Cinema Display is detected but no picture

    Forgive me, as I know this is an often-asked question but I have searched and can't find a response that fixes the issue. Yet. So I have a Mac Pro (circa 2008) that works fine. The Apple Cinema Display is even older from about 2004 (I think). Everyth

  • OID 10.1.4.2.0 for Linux Preview Install

    I am trying to install the preview. I am using example provided in OID-LinuxWorld-Demo-OAS_viewlet_swf.html. Any insight on why this fails? see below... [oracle@akaoradev-vm1 ~]$ su - root Password: [root@akaoradev-vm1 ~]# up2date oracle-oid Fetching

  • Aplle Motion 5...many bug or not bug?...read

    Hello everyone ... I would like some explanations on Apple Motion 5 updated to version 5.0.7, I wanted to understand if personalmenterilevo of BUG depend on my Mac: iMac Intel Core 15quad + sk ATI RADEON 1gb + 12 gb RAM or is it a problem extended to

  • Contribute 3.11 closes abruptly when opening a site

    About 5 users have access to a Contribute website and 4 of them have no problem accessing the site from Contribute. One of the users can't access the site at all. The user can successfully create a connection to the website, but when Contribute trys

  • Dispatcher chain is empty

    Does anyone have any idea of why I would be getting a "Dispatcher chain is empty" error? I have a session scoped page which posts back on itself and when i try to use the sendRedirect method for a button click to redirect to another page I get that e