Know the field names in 1 table

Hi,
i would like to know is there any way that we can know how many column inside the table in the database n what is the column names?
for example:
table supplier
supplierId supplierName address
so there are 3 columns and the names are supplierId, supplierName, address

ResultSetMetaData lets you find out about what columns have been retrieved from a query.
DatabaseMetaData class allows you to get a lot of info about the database in general:
Schemas in a database
Database Tables in a schema
Database columns for a table
Check out the java.sql package in the API.

Similar Messages

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

  • Need a table for the texts of the field names of a table

    Hi Experts,
    I need to find out a table wchich has the following fields,
    Table name,Fieldname and fieldname Text,.
    I have tried , but not found such table.
    Thanks in advance,
    Harshit Rungta

    Hi Jay,
    Thanks for your answer ,
    But dd03l does not have field texts
    Also i have tried dd03t,
    but its not showing the expected enteries.
    I have tried searching DD* , but no luck still..
    regards,
    ]Harshit Rungta

  • What is the sql query to know the database name having known table name?

    when i am running the following query....error coming
    select * from information_schema.tables where table_name = 'articles'
    Error starting at line 1 in command:
    select * from information_schema.tables where table_name = 'articles'
    Error at Command Line:1 Column:33
    Error report:
    SQL Error: ORA-00942: table or view does not exist
    00942. 00000 - "table or view does not exist"
    *Cause:
    *Action:
    i am running the above query in SQLDeveloper tool against ORACLE database
    plz give alternate solution.

    Hi,
    select * from information_schema.tables where table_name = 'articles'You are trying query view ( information_schema.tables ) from MSSQL on ORACLE??!!
    Each RDBMS have your own data dictionary... you must check documention of ORACLE to query the properly data dictionary.
    Try it:
    select * from users_tables where table_name = 'articles'
    or
    select * from all_tables where table_name = 'articles'
    or
    select * from dba_tables where table_name = 'articles'http://docs.oracle.com/cd/E11882_01/server.112/e25494/general011.htm#ADMIN11564
    Regards,
    Levi Pereira

  • What are the field names for below mentioned

    Hello Friends
    What are the fields names for below tables
    in EKKO
    Purchase Document Date
    Net Value of the purchase document.
    In EKPO
    Item Description
    From which place We bought it. (It means in Sales Items there we can know from which plant we sold the goods, like in EKPO, there is any field like this)
    Please let we are defining the report to find out the stock availability for perticular storage location using select Options plant, company code, material no.
    How many tables involve her to build this report. and also field names, they come under which table.
    Please send me this information ASAP. PLz Plz Plz..........
    Regards
    Praveen

    You can check the fields of these tables via SE11
    Purchase Document Date  -  EKKO-BEDAT
    Item Description  -  EKPO-TXZ01
    Net price per item - EKPO-NETPR.
    Regards,
    Rich Heilman

  • 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 add get the field name for a newly added site column.

    I have the following:-
    Enterprise wiki site collection inside SharePoint server 2013.
    I added a new site column of type managed metadata.
    I opened the enterprisewiki.aspx page layout using the SP designer, to add the newly added site column to it.
    But I have noted that to add any site column I need to know the field name , for example the default wiki category column is referenced inside the page layout as follow:-
    <Taxonomy:TaxonomyFieldControl FieldName="Wiki_x0020_Page_x0020_Categories" EmptyValueDescriptionForTargetTemplate="<%$Resources:cms,enterwiki_nocategories_assigned%>" DisableInputFieldLabel="true" runat="server"/>
    <b>
    So my question is how I can know the field name for my newly added site column?
    Thanks in advance for any help.
    Regards

    Hi,
    The “FieldName” should be the internal name of the column, you will find it at the address bar at the “Site Columns”->”Edit Column” page:
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • Change All Field Names in a Table to have a Lowercase First Letter

    I have an SQL database with many tables.  All of the field names in each table start with an Uppercase letter. I would like to programmatically change all of the field names in each table to start with a lowercase letter.  Can this be done?
    E.g.:  "FieldName" to "fieldname"
    Thanks.

    O.K.  Just in case anyone else runs into this, I used Carl's answer to guide me in the right direction. This is my final code that created the commands I needed to run a batch (where TMaster is my schema name and the WHERE statement contains
    the datatypes in your tables):
    SELECT
    'EXEC SP_RENAME ''TMaster.'+TABLE_NAME+'.'+COLUMN_NAME+''',
    '''+LOWER(SUBSTRING(COLUMN_NAME,1,1))+SUBSTRING(COLUMN_NAME,2,255) 
    +''',
    ''COLUMN'''
    FROMINFORMATION_SCHEMA.COLUMNS
    WHEREDATA_TYPE='int'.

  • Displaying Field name in a table

    Hi,
    I want to display the field names in a table.
    Is it possible to achieve this through coding?
    Regards,
    Ram.

    Hi,
    Please explain the requirement clearly.
    Where you want to display the field names of the table.
    Regards,
    Umasankar

  • How To Know The Column Name Of The Internal Table

    HI ,
            i have an internal table .
    f1          f2           f 3         f4            f5  
    matnr   mbrsh    mtart     meins       minbe
    i want to know the column name which depending on the value i.e . if it is matnr then f1 , if mbrsh it is f2 ..so on
    Thanks.

    Hi ,
          thanks for your replies . i am elaborating my query .
            I have an internal table with 80 fields i.e.f1,f2,f3......f80 . In the first index i will be having the fieldnames
    i.e.matnr , mbrsh , meins , mtart ..... . From second index onwards i will be having the corresponding data  for the field name.  i need to display a particular field in a table control . Here i will be knowing the fieldname. If i can get to know the column name i.e whether f1 or f2 or ... .i Can populate the data into the table control.
    Wht i have done is taken a field symbol  and used the following code.
    read table i_upload index 1  assigning <lv_upload>.
    here i will get the initial first record i.e
    F1                                             MATNR
    F2                                             MBRSH
    F3                                             MTART
    F4                                             WERKS
    F5                                             LGORT
    F6                                             VKORG
    F7                                             VTWEG
    F8                                             MAKTX
    F9                                             MEINS
    F10                                             MATKL
    F11                                             BISMT
    F12                                             BRGEW
    F13                                             GEWEI
    F14                                             NTGEW
    F15                                             GROES
    F16                                             KLART
    F17                                             CLASS
    F18                                             SPART
    F19                                             VRKME
    F20                                             UMREN
    now i want to the field name .
    Hope it is clear this time .
    Thanks.

  • Do you know of a standard tool to compare the fields of 2 database tables?

    do you know of a standard tool to compare the fields of 2 database tables? please note i dont want to compare data just the fields.
    ~Suresh

    Hi,
    I am not aware any standard tool but you can write custom report to use FM DDIF_FIELDINFO_GET to get fields information of SAP database table.
    Call the above FM twice in order to get field names for two different database tables. Then compare the results (table parameter DFIES_TAB) to find out the differences of field names.
    Hope this will help ...
    Regards,
    Ferry Lianto

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

  • Can anyone tell me the field name, table name for the following scenario?

    Hi All,
    Can anyone tell me the field name and the respective table name for the following scenario's?
    1. A report to list all the materials to which Invoice is done and delivery is pending.
    2. A report for Order tracking.
    3. A report, which gives PO(Purchase Order),  Pricing details.
    4. A report, which calculates the MATERIAL COST. It will select all the material issued for the entered service order number from  stock.
    Thanks & Regards,
    P.Gowrishanker
    Edited by: Gowrishanker pari on Jun 1, 2008 8:58 AM

    I believe that OmniVision Technologies has the contract for the 3gs.

Maybe you are looking for

  • Getting an error at the time of running a DC

    hi, I imported a DC project which is running perfectly on another PC,and rebuild that  project and deployed when iam running that application in the portal iam getting that following error java.lang.UnsupportedClassVersionError: com/sap/campaigncreat

  • Citibank Bank Account - No Control Key Exists

    Hi, I have tried searching in the forum something related, but no success. I am setting up Bank accounts under House Banks in FBZP and for Citibank there is no Control Key information given. Here in Brazil the Bank account number does not contain the

  • How do I confirm email address?

    I just aked a question & the reply was confirm your email address. Where & how do I reconfirm my email address?

  • Has anyone used WRT54G v5 with Airport extreme?

    Like the title says, has anyone gotten the linksys wrt54g version 5 firmware 1.00.9 to work in wds with the extreme? Also, did the ethernet port on the airport extreme work to connect a computer on the internet?

  • Splitter program for processing the IDOCS with status 64.

    Hello folks, I have a requirement explained below. I am looking for a sample code which could help me to jump start with initial development. Requirement: Develop a splitter program which retrieves all the IDCOS with status 64, create and schedule ba