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);

Similar Messages

  • 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.

  • Retrieve the fields name of a table

    HI,
    I need to write a loop to get the name of each fields in a table. I nedd something like
    for each field.fieldname do something
    thanks,
    Mandana

    select * from yourtable where 1 = 2
    The resulting columnlist will give you all the field names.

  • How to retrieve the parameter names from a JSP page ? Urgent Please

    Hello,
    Can anybody tell me how to retrieve the parameter names from the JSP
    page. (without using getParameterNames() method.)
    The problem with the getParameterNames() method is I get the Jumbled output.
    I need it very badly
    With regards
    Ananth R
    email:[email protected]
    [email protected]

    Dear duffymo,
    My primary intention is to convert the JSP form information into a XML file.
    If I do not get the Parameter names in the correct order how can I maintain
    tag order in XML file.
    For ex: (JSP PAGE VIEW)
    Name--
    FirstName
    MiddleName
    LastName
    Address--
    Street1
    Street2
    City
    Country
    &so on
    (XML File to be generated)
    <Name>
    <FirstName>Value</FirstName>
    </Name>
    <Address>
    <street1>value</street1>
    </Address>
    & so on
    If I use getParameterNames() to get all the parameter names(Which form the tag names in the XML file ) the Enumeration object it returns will not be in the same order as the text fields in JSP.From this I can not construct a meaningful XML file.
    order means: Order of entry on the page, from top to bottom
    That's it
    Waiting for your responses

  • 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 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 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.

  • How to change the field name

    I want to change the field name in Oracle schema
    Can I do ir?
    If yes, please tell me how to type the SQL
    Thanks

    Use ALTTAB command of my freeware SQLPlusPlus to ALTER a table anyway you like including inserting columns within the middle of the table.
    regards,
    M. Armaghan Saqib
    SQL PlusPlus - Add power to command line of SQL Plus
    SQL Link for XL - Integrate Oracle with XL
    Download free: http://www.geocities.com/armaghan/
    null

  • Script : how to change the Field name in standard program(ZM_MEDRUCK)

    Hi Experts,
    I am working with SAP SCRIPT. i need to change the Field Name that is PO NO to Document No & PO DATE to Document Date.
    These are assigned in data declaration as gv_name and gv_date.
    Can anyone help me to change this Fields.
    Regards,
    Vijayan.R

    Hi,
    You can archive this by making change in SAP script only. You don't need to touch the standard prgm.
    Debug the script and find it out which fields (In script editor) are printing these text on layout... then just replace them by creating your own text...
    You can create a text in TTDTG table,, like ZZPO_NAME = ( Document Name),, and use this filed in the script editor.
    &ZZPO_NAME&

  • 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 retrieve the values from PL/SQL table types.

    Hi Every one,
    I have the following procedure:
    DECLARE
    TYPE t1 IS TABLE OF emp%ROWTYPE
    INDEX BY BINARY_INTEGER;
    t t1;
    BEGIN
    SELECT *
    BULK COLLECT INTO t
    FROM emp;
    END;
    This procedure works perfectly fine to store the rows of employee in a table type. I am not able to retrieve the values from Pl/SQL table and display it using dbms_output.put_line command.
    Can anybody help me please!!!!!
    Thanks
    Ahmed.

    You mean, you can't add this
    for i in t.first..t.last loop
    dbms_output.put_line(t(i).empno||' '||t(i).ename||' '||t(i).job);
    end loop;or you can't add this
    set serveroutput onor maybe, you are working in third party application where dbms_output is not applicable at all?
    You see, not able like very similar it is not working - both are too vague...
    Best regards
    Maxim

  • How to read the column name of a table from sap system using C#?

    Hi!!
    I am using SAP .NET connector and creating a windows application.
    Now I wanna read the column name when a table name is given....
    Connection is done, but I don't know the code to read the column names alone...
    Can anyone help me with the code??

    fine!!
    So if i give the table name, which the RFC_READ_TABLE function module have, will it run properly? or i wanna change all the codes in order to support RFC_READ_TABLE function module?
    Because from the beginning I was using BAPI_CUSTOMER_GETLIST function, but my client requirement is to use ERP function module RFC_READ_TABLE, he didn't give any table name also..
    This is my code: What I have to change in this???
    ECCDestinationConfig ECCDestination = new ECCDestinationConfig();
                RfcDestinationManager.RegisterDestinationConfiguration(ECCDestination);
                RfcDestination rfcDest = null;
                rfcDest = RfcDestinationManager.GetDestination(a);
                    RfcRepository repo = rfcDest.Repository;
                    IRfcFunction customerList = repo.CreateFunction("BAPI_CUSTOMER_GETLIST");
                    IRfcTable addressData = customerList.GetTable("AddressTable"));
                    int j = addressData.Metadata.LineType.FieldCount;
                    for (int i = 0; i < j; i++)
                        RfcElementMetadata metadata = addressData.GetElementMetadata(i);
                        listallcolumn.Items.Add(metadata.Name);
    Message was edited by: Jeswin Rebil

  • 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 display the field name in the tabulated view for a content query web part

    I have added a content query web part changed the web part file to include custom columns imported and reffered itemstyle.xsl
    to include the tabulated view for the content query.
    However the way it is displayed is such that only the content is displayed.
    As i am using a tabular view wto display the data, i want to display their field names as well.

    Hi  ,
    According to your description, my understanding is that you need to display the field in the tabulated view for a content query web part.
    For your issue, please refer to the code as below:
    <xsl:template name="VendorCustomStyle" match="Row[@Style='VendorCustomStyle']" mode="itemstyle">
    <html>
    <table width="100%">
    <xsl:if test="count(preceding-sibling::*)=0">
    <tr>
    <td width="8%" valign="top"><div class="item"><b>Vendor ID</b></div></td>
    <td width="12%" valign="top"><div class="item"><b>Vendor Name</b></div></td>
    <td width="50%" valign="top"><div class="item"><b>Vendor Description</b></div></td>
    <td width="10%" valign="top"><div class="item"><b>Vendor Country</b></div></td>
    <td width="10%" valign="top"><div class="item"><b>Vendor Date</b></div></td>
    <td width="10%" valign="top"><div class="item"><b>Created By</b></div></td>
    </tr>
    </xsl:if>
    <tr>
    <td width="8%" valign="top"><div class="item"><xsl:value-of select="@VendorID" /></div></td>
    <td width="12%" valign="top"><div class="item"><xsl:value-of select="@Title" /></div></td>
    <td width="50%" valign="top"><div class="item"><xsl:value-of select="@Vendor_x005F_x0020_Description" disable-output-escaping="yes" /></div></td>
    <td width="10%" valign="top"><div class="item"><xsl:value-of select="@Vendor_x005F_x0020_Country" /></div></td>
    <td width="10%" valign="top"><div class="item"><xsl:value-of select="@Vendor_x005F_x0020_Date" /></div></td>
    <td width="10%" valign="top"><div class="item"><xsl:value-of select="@Author" /></div></td>
    </tr>
    </table>
    </html>
    </xsl:template>
    For more information, please have a look at the blog:
    http://www.codeproject.com/Articles/756834/Customizing-the-Content-Query-Web-Part-and-Item-St
    http://msdn.microsoft.com/en-us/library/ms497457.aspx
    http://clarksteveb.hubpages.com/hub/Customized-Content-Query-Web-Part-CQWP-in-SharePoint-2007-with-results-Tabbed-Grouped-and-in-an-HTML-Table
    http://blog.sharepointexperience.com/customitemstyle/
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to get the field name in the PAI

    Hello All.
    I have to run a FM on one of two fields in the screen.
    I don't want to write two different moudles to these fields like this:
      FIELD scr100-lenum1   MODULE check_lenum1   ON REQUEST.
      FIELD scr100-lenum2   MODULE check_lenum2   ON REQUEST.
    I want write one moudle that i could ask there - > from which field did i came, like this:
      FIELD scr100-lenum1   MODULE check_lenum   ON REQUEST.
      FIELD scr100-lenum2   MODULE check_lenum   ON REQUEST.
    please advice..
    thanks, Barak.

    Use get cursor statement.
    Ex:
    GET CURSOR FIELD wa_field1.
    u will get the filed name in wa_field1.
    Reward points if helpfull.
    Regards,
    Gopi

Maybe you are looking for

  • Exception while invoking webservice

    I have created a client jar containing stub and port classe, deployment descritor and deployed webservices. Webservices are working fine but while invoking webservice with client code i am getting Exception, can somebody please help me to resolve it

  • How can I sync my address book from my imac to my ipad 3?

    I have just bought an iPad 3 and want to copy my mail address book with email addresses intact from my iMac which has Snow Leopard, which I am happy with and do not want to change to Lion.   There must be an easy way, but I haven't found it

  • Error Occured While Creating Grant From SOA Integration Repository

    Hi All, I have created the Custom SOA Object using the Iparser. Now i am trying to provide the grant through the SOA repository. When I click create,the its failing I am getting the following error when I click a CREATE GRANT button for a web service

  • ULTRA 5 OPENBOOT serial console disabling - for the use of USB key/mouse

    I ve got an ULTRA 5, I installed a NEC USB PCI card in it, in works no problemo, I can use USB keyboard and mouse under X-WINDOWS (openbsd unix). But this works ONLY if I have classical SUN TYPE 5c keyboard attached. Then the system boots, starts X a

  • Passing arrays with Test Stand to DIO 96

    Does anyone know the easiest way of sending data arrays from Test Stand to a DIO 96 using a LabView dll? I have a Test Stand sequence where I will need to set bits and read bits from a DIO 96 and am going to make a LabView dll. I guess I will need to