Getting table name from a query

Hi, I'm trying to get the table name from my sql query
My code is as follows;
ResultSetMetaData metadata = rs.getMetaData();
for (int i = 1; i < metadata.getColumnCount(); i++)
System.out.println(metadata.getTableName(i));
I just get a blank output. Yet my sql query executes and I can pull down the records, and grab the column names from the result sets.
Any ideas on how I can get the table name for the columns. The reason being is on one of my querys I'm using join statements and i need to retrieve the table name for the column i'm displaying, as some tables have similar column names.
Thanks in advance.

Hi,
What db are you using?
I also get a blank output with ResultSetMetaData.getTableName because Oracle doesn't implement this method.
Why do you not know the table name anyway?
regards
Nick

Similar Messages

  • Reg. Getting Tables name from interbase

    Hi,
    I like to get interbase database table name using a query from JDBC program .I am connecting interbase through interclient driver.
    Regrads,
    Vikki

    Once you have a Connection to the database, use its getMetaData() method to get a DatabaseMetaData object, which can give you that information.

  • Get alias name from dynamic query

    Hi All,
    I would make a plsql function using dynamic query.
    And the function takes a whole sql query as a parameter.
    The main issue is that the function should get what alias or columns were queried.
    For example,
    FUNCTION_GET_QUERY_ALIAS('SELECT 1 AS col1, 2 AS col2 FROM DUAL')
    Inside the function, it should find the alias name COL1 and COL2.
    I'd appreciate for any help.

    I have modified print_table as function and made it to satisfy your needs.
    SQL> CREATE OR REPLACE TYPE my_column_object AS OBJECT(ruw_number integer, column_name VARCHAR2(1000), column_val VARCHAR2(1000))
      2  /
    Type created.
    SQL> CREATE OR REPLACE TYPE my_table_type AS TABLE OF my_column_object
      2  /
    Type created.
    SQL> CREATE OR REPLACE FUNCTION print_table( p_query in varchar2 ) RETURN my_table_type PIPELINED
      2  AS
      3      l_theCursor     INTEGER DEFAULT DBMS_SQL.OPEN_CURSOR;
      4      l_columnValue   VARCHAR2(4000);
      5      l_status        INTEGER;
      6      l_descTbl       DBMS_SQL.DESC_TAB;
      7      l_colCnt        NUMBER;
      8      l_rcount           INTEGER := 0;
      9  BEGIN
    10      DBMS_SQL.PARSE(  l_theCursor,  p_query, dbms_sql.native );
    11
    12      DBMS_SQL.DESCRIBE_COLUMNS( l_theCursor, l_colCnt, l_descTbl );
    13
    14      FOR i IN 1 .. l_colCnt
    15      LOOP
    16          DBMS_SQL.DEFINE_COLUMN(l_theCursor, i, l_columnValue, 4000);
    17      end loop;
    18
    19      l_status := DBMS_SQL.EXECUTE(l_theCursor);
    20
    21      WHILE ( DBMS_SQL.FETCH_ROWS(l_theCursor) > 0 )
    22      LOOP
    23             l_rcount := l_rcount + 1;
    24          FOR i IN 1 .. l_colCnt
    25          LOOP
    26              DBMS_SQL.COLUMN_VALUE( l_theCursor, i, l_columnValue );
    27
    28              PIPE ROW(my_column_object(l_rcount,l_descTbl(i).col_name,l_columnValue));
    29          END LOOP;
    30      END LOOP;
    31
    32     RETURN;
    33  end;
    34  /
    Function created.
    SQL> select * from table(print_table('select * from emp'))
      2  /
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
             1 EMPNO                7369
             1 ENAME                SMITH
             1 JOB                  CLERK
             1 MGR                  7902
             1 HIREDATE             17-DEC-80
             1 SAL                  800
             1 COMM
             1 DEPTNO               20
             1 DIV                  10
             2 EMPNO                7499
             2 ENAME                ALLEN
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
             2 JOB                  SALESMAN
             2 MGR                  7698
             2 HIREDATE             20-FEB-81
             2 SAL                  1600
             2 COMM                 300
             2 DEPTNO               30
             2 DIV                  10
             3 EMPNO                7521
             3 ENAME                WARD
             3 JOB                  SALESMAN
             3 MGR                  7698
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
             3 HIREDATE             22-FEB-81
             3 SAL                  1250
             3 COMM                 500
             3 DEPTNO               30
             3 DIV                  10
             4 EMPNO                7566
             4 ENAME                JONES
             4 JOB                  MANAGER
             4 MGR                  7839
             4 HIREDATE             02-APR-81
             4 SAL                  2975
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
             4 COMM
             4 DEPTNO               20
             4 DIV                  10
             5 EMPNO                7654
             5 ENAME                MARTIN
             5 JOB                  SALESMAN
             5 MGR                  7698
             5 HIREDATE             28-SEP-81
             5 SAL                  1250
             5 COMM                 1400
             5 DEPTNO               30
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
             5 DIV                  10
             6 EMPNO                7698
             6 ENAME                BLAKE
             6 JOB                  MANAGER
             6 MGR                  7839
             6 HIREDATE             01-MAY-81
             6 SAL                  2850
             6 COMM
             6 DEPTNO               30
             6 DIV                  10
             7 EMPNO                7782
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
             7 ENAME                CLARK
             7 JOB                  MANAGER
             7 MGR                  7839
             7 HIREDATE             09-JUN-81
             7 SAL                  2450
             7 COMM
             7 DEPTNO               10
             7 DIV                  10
             8 EMPNO                7788
             8 ENAME                SCOTT
             8 JOB                  ANALYST
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
             8 MGR                  7566
             8 HIREDATE             19-APR-87
             8 SAL                  3000
             8 COMM
             8 DEPTNO               20
             8 DIV                  10
             9 EMPNO                7839
             9 ENAME                KING
             9 JOB                  PRESIDENT
             9 MGR
             9 HIREDATE             17-NOV-81
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
             9 SAL                  5000
             9 COMM
             9 DEPTNO               10
             9 DIV                  10
            10 EMPNO                7844
            10 ENAME                TURNER
            10 JOB                  SALESMAN
            10 MGR                  7698
            10 HIREDATE             08-SEP-81
            10 SAL                  1500
            10 COMM                 0
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
            10 DEPTNO               30
            10 DIV                  10
            11 EMPNO                7876
            11 ENAME                ADAMS
            11 JOB                  CLERK
            11 MGR                  7788
            11 HIREDATE             23-MAY-87
            11 SAL                  1100
            11 COMM
            11 DEPTNO               20
            11 DIV                  10
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
            12 EMPNO                7900
            12 ENAME                JAMES
            12 JOB                  CLERK
            12 MGR                  7698
            12 HIREDATE             03-DEC-81
            12 SAL                  950
            12 COMM
            12 DEPTNO               30
            12 DIV                  10
            13 EMPNO                7902
            13 ENAME                FORD
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
            13 JOB                  ANALYST
            13 MGR                  7566
            13 HIREDATE             03-DEC-81
            13 SAL                  3000
            13 COMM
            13 DEPTNO               20
            13 DIV                  10
            14 EMPNO                7934
            14 ENAME                MILLER
            14 JOB                  CLERK
            14 MGR                  7782
    RUW_NUMBER COLUMN_NAME          COLUMN_VAL
            14 HIREDATE             23-JAN-82
            14 SAL                  1300
            14 COMM
            14 DEPTNO               10
            14 DIV                  10
    126 rows selected.
    SQL>Thanks,
    Karthick.
    Edited by: Karthick_Arp on Sep 23, 2008 12:11 AM

  • What is Best Way to Get Table Name in Oracle Applications : 12.1.1 (web)

    Hello Friends..
    I need your Help My Friends...
    we are working currently on Oracle Applications : 12.1.1
    i would like to know the best way to get Table name from Web Based Form..
    Regards
    Yas.

    Hi Yas;
    Please follow below 2 thread i belive you will find some hint in those thread
    table name for a jdeveloper page
    Re: EBS, 11.5.10, table name
    Hope it helps
    Regard
    Helios

  • How get all table name from database

    hi master
    sir
    how get all table name from database

    The big question is 'why'.
    Selecting from view 'dba_tables' will indeed give the list of all tables in the database, but that includes the dictionary tables and the internal tables, and many others that are probably not of interet to a person who needs to ask this question. Besides, the dba_tables view requires access to a DBA account.
    There are several other views: "user_tables" will list all the tables in this user's schema; and "all_tables" will list all the tables this user can access in some way.
    The above do not, of course, include any information about synonyms, sequences, views, indexes and so on.
    The correct answer and the meaningful answer may be two different things.

  • Select query to get table names

    Hi,
    Can i retrieve a table name from a select query if i know value of one of the columns in the table?
    Glen

    Can't you take a look at the source code and see what table those values are coming from? That's likely the easiest solution.
    Barring that, you could use dynamic SQL, but it's going to be awfully inefficient. Something like
    FOR x IN (SELECT * FROM user_tab_cols WHERE data_type = 'VARCHAR2')
    LOOP
      EXECUTE IMMEDIATE
        'SELECT COUNT(*) FROM ' || x.table_name ||
        ' WHERE ' || x.column_name || ' = <<literal value>>'
        INTO l_cnt;
      IF( l_cnt > 1 )
      THEN
        DBMS_OUTPUT.PUT_LINE( 'Found the value' );
      END IF;
    END LOOP;This assumes that you know at least what data type the value is stored in. It's also going to generate a tremendous number of full table scans, so it'll be slow as molasses on a system of any size.
    Justin

  • Bex Query: Too many table names in the query The maximum allowable is 256

    Hi Experts,
    I need your help, Im working on a Query using a multiprovider of 2 datastores, I need to work with cells to assign specific acconts values to specific rows and columns, so I was creating a Structure with elements from a Hierarchy, but I get this error when I'm half way of the structure:
    "Too many table names in the query. The maximum allowable is 256.Incorrect syntax near ')'.Incorrect syntax near 'O1'."
    Any idea what is happening? is ti possible to fix it? do I need to ask for a modification of my Infoproviders? Some one told me is possible to combine 2 querys, is it true?
    Thanks a lot for your time and pacience.

    Hi,
    The maximum allowable limit is 256 holds true. It is the max no. of characteristics and key figures that can be used in the column side. While creating a structure, you create key figures (restricted or calculated) and formulas etc.. The objects that you use to create these should not be more than 256.
    http://help.sap.com/saphelp_nw70/helpdata/EN/4d/e2bebb41da1d42917100471b364efa/frameset.htm
    Not sure if combination of 2 query's is possible.  You can use RRI. Or have a woorkbook with 2 queries.
    Hope it helps.

  • How to assign table name for select query in loop.

    Hi friends my requirement is count the no of records of all the database table which comes into an internal table ."Check the below coding". Iam  fetching the tables from dd03l table into an internal table .plz give me a sujjesion how to assign a table name in select query  in a loop.
      SELECT tabname FROM dd09l
                INTO TABLE i_dd09l
                WHERE protokoll = 'X'.
      IF sy-subrc = 0.
        SORT i_dd09l BY tabname.
      ENDIF.
      LOOP AT i_dd09l.
        SELECT COUNT(*) INTO val FROM i_dd09l-tabname.
        IF sy-subrc = 0.
          i_dd09l-count = val.
        ENDIF.
        MODIFY i_dd09l INDEX sy-index.
        CLEAR val.
      ENDLOOP.
    error : 'I_DD09L-TABNAME' is not defined in the abap dictionary as a table.

    data: dy_table type ref to data,
          dy_line type ref to data,
          xfc type lvc_s_fcat,
          ifc type lvc_t_fcat,
          dy_field type ref to data.
    LOOP AT i_dd09l.
    perform get_structure using i_dd09l-tabname .
    CREATE DATA dy_table TYPE TABLE OF (_dd09l-tab_name).
        UNASSIGN <dyn_table>.
        ASSIGN dy_table->* TO <dyn_table>.
    SELECT COUNT(*) INTO val FROM <dyn_table>.
    IF sy-subrc = 0.
    i_dd09l-count = val.
    ENDIF.
    MODIFY i_dd09l INDEX sy-index.
    CLEAR val.
    ENDLOOP.
    form get_structure using p_table.
      data : idetails type abap_compdescr_tab,
      xdetails type abap_compdescr.
      data : ref_table_des type ref to cl_abap_structdescr.
    Get the structure of the table.
      ref_table_des ?=
      cl_abap_typedescr=>describe_by_name( p_table ).
      idetails = ref_table_des->components.
      loop at idetails into xdetails.
        clear xfc.
        xfc-fieldname = xdetails-name .
        xfc-datatype = xdetails-type_kind.
        xfc-inttype = xdetails-type_kind.
        xfc-intlen = xdetails-length.
        xfc-decimals = xdetails-decimals.
        append xfc to ifc.
      endloop.
    endform.                    "get_structure
    Try like this hope it will work.
    Regards,
    madan.

  • Getting column names from cursor

    Hi all
    I have procedure which produces list of applied for jobs web page(using htp. package)
    I got result in cursor, but have to provide dinamic sort, based on colimn pressed
    procedure my_application_list
    (pi_resume_num     in varchar2 default null
    ,pi_sort_col     in varchar2 default null
    ,pi_page_no     in varchar2 default null
    ,pi_action     in varchar2 default null
    ,pi_msg          in varchar2 default null
    is
    CURSOR cur_job IS
         SELECT      jtl.JOB_TITLE
              ,jtl.COMPANY_NAME
              ,a.APPLY_DATE
              ,a.lang
              ,a.job_id
         FROM job_tl jtl, applied_for_job a, gateway gt
         WHERE a.job_seeker_id=app.job_Seeker
         AND a.job_id=jtl.job_id
         AND a.lang=jtl.lang
         AND a.gateway=gt.gateway
         AND jtl.lang=(SELECT substr(MIN(lt.order_list||jtl0.lang),2) lang
                   FROM      job_tl jtl0
                        ,language_tl lt
                   WHERE jtl0.job_id = a.job_id
                   AND jtl0.lang=lt.lang
                   AND lt.gui_lang=app.language)
         ORDER BY pi_sort_col
    rest of code
    The columns displayed in web page are Job_title, Company_name and Applied_date
    This page is displyed well, bu without column nmes at the top. I am trying to get column names from cursor in order to have ORDER BY <pi_sort_col>
    can someone help how i can get those column names:Job_title, Company_name and Applied_date
    User will be able to click on column and sort
    Thank in advance .I appreciate any help

    Hi Francisco
    Here is my code
    CREATE OR REPLACE PACKAGE BODY cc_web_application_list
    IS
    TYPE COL_NAME_LIST IS TABLE OF VARCHAR2(100)
         INDEX BY BINARY_INTEGER;
    TYPE COL_ORDER_LIST IS TABLE OF VARCHAR2(30)
         INDEX BY BINARY_INTEGER;
    col_name_t col_name_list;
    col_order_t col_order_list;
    procedure my_application_list
         (pi_resume_num     in varchar2 default null
         ,pi_sort_col     in varchar2 default null
         ,pi_page_no     in varchar2 default null
         ,pi_action     in varchar2 default null
         ,pi_msg          in varchar2 default null
    is
    l_my_page_no      PLS_INTEGER :=     TO_NUMBER(nvl(pi_page_no,1));
    l_js_name          gam_user.username%TYPE;
    l_js_first_name          gam_user.first_name%TYPE;
    l_cnt                PLS_INTEGER := 0;
    l_scr_lines      PLS_INTEGER := 0;
    l_curline           PLS_INTEGER;
    l_jobs_applied           PLS_INTEGER;
    l_total_rec      PLS_INTEGER;
    l_total_pages      PLS_INTEGER;
    l_pos               PLS_INTEGER;
    l_first               PLS_INTEGER :=0;
    last                PLS_INTEGER :=0;
    l_lines           PLS_INTEGER := 10;
    col_name      VARCHAR2(100) := col_name_t(3) ;
    col_order           VARCHAR2(30) := 'DESC';
    str                VARCHAR2(2000);
    TYPE display_rec IS TABLE OF VARCHAR2(500) INDEX BY BINARY_INTEGER;
    display           display_rec;
    TYPE page_table_type IS TABLE OF PLS_INTEGER INDEX BY BINARY_INTEGER;
    page_number          page_table_type;
    CURSOR cur_job IS
         SELECT      jtl.JOB_TITLE job_title
              ,jtl.COMPANY_NAME company_name
              ,a.APPLY_DATE apply_date
              ,a.lang
              ,a.job_id
         FROM job_tl jtl, applied_for_job a, gateway gt
         WHERE a.job_seeker_id=app.job_Seeker
         AND a.job_id=jtl.job_id
         AND a.lang=jtl.lang
         AND a.gateway=gt.gateway
         ORDER BY a.apply_date;
    This decode is a problem
              decode(col_order,'ASC'
                   ,decode(col_name
                   ,col_name_t(1), jtl.job_title
                   ,col_name_t(2), jtl.company_name
                   ,col_name_t(3), TO_CHAR(a.apply_date, 'YYYYMMDDhh24miss')
                   ,a.apply_date)
                   ) ASC
              ,decode(col_order,'DESC'
                   ,decode(col_name
                   ,col_name_t(1), jtl.job_title
                   ,col_name_t(2), jtl.company_name
                   ,col_name_t(3), TO_CHAR(a.apply_date, 'YYYYMMDDhh24miss')
                   ,a.apply_date)
                   ) DESC
              ,a.apply_date
    TYPE rec_one IS TABLE OF cur_job%ROWTYPE INDEX BY BINARY_INTEGER;
    r               rec_one;
    BEGIN
    BEGIN
    SELECT username,first_name
    INTO l_js_name,l_js_first_name
    FROM gam_user
    WHERE user_id = App.job_seeker;
    EXCEPTION
    WHEN OTHERS THEN NULL;
    END;
    Cc_Pkg_Elements.p_page_top_job_seeker(
    'Personal Job List'
    ,REPLACE(Txt_Proc_My_Joblist.title_job_list
         ,'##first_name##',l_js_first_name),'N' ,TRUE ,'Pxx');
    ----- get numer of records returned by query
    SELECT COUNT(1)
    INTO l_total_rec
    FROM     job_tl jtl,applied_for_job a
         ,gateway gt
    WHERE a.job_id = jtl.job_id
    AND     a.job_seeker_id     = App.job_seeker
    AND     a.gateway     = gt.gateway ;
    ------get number of pages
    l_total_pages:=CEIL (l_total_rec/l_lines);
    l_jobs_applied := 0;
    col_name := pi_sort_col;
    col_order := pi_sort_col;
    --get first positions
    l_first := (nvl(l_my_page_no,1) - 1) * l_lines + 1;
    FOR rec IN cur_job LOOP
         l_cnt := l_cnt + 1;
         EXIT WHEN l_cnt > l_first + l_lines - 1;
         IF l_cnt >= l_first THEN
              l_scr_lines := l_scr_lines + 1;      
              r(l_scr_lines) := rec;          --assign counter from loop to r index
              IF rec.apply_date IS NOT NULL THEN
              l_jobs_applied := l_jobs_applied + 1;
              END IF;
         END IF;
    END LOOP;
    htp.p('<FORM ACTION="'||App.gateway||'8.my_application_list" METHOD="post">');
    htp.p('<table align="center">');
    htp.p('<tr><td>');
    IF r.COUNT = 0 THEN
         Web_Pkg_Elements.doc_msg(Txt_Proc_My_Joblist.no_jobs);
    END IF;
    htp.p('</td></tr>');
    htp.p('</table>');
    --table_heading(col_name ,col_order );
    htp.p('<table align=center>');
    htp.p('<tr align="center"><td>');
    FOR i IN 1..l_total_pages LOOP
         page_number(i) := i;
         IF page_number(i) = l_total_pages THEN
              htp.p('');
    ||'');
              Web_Pkg_Elements.doc_val_small(page_number(i)||'</A>');          
         ELSE
         htp.p('');
    |'||'');
         Web_Pkg_Elements.doc_val_small(page_number(i)||' |'||'</A>');     
         END IF;
    END LOOP;
    htp.p('</td></tr>');
    htp.p('</table>');
    htp.p('<table align=center>');
    FOR l_curline IN 1..l_scr_lines LOOP
         display(1) := NVL(r(l_curline).job_title, '<br>');
         display(2) := NVL(r(l_curline).company_name, '<br>');
         display(3) := NVL(Cc_Pkg_Nls.date2char(r(l_curline).apply_date, App.date_format), '<br>');
         IF MOD(l_curline, 2) = 0 THEN     
              Cc_Pkg_Elements.tr_even;
         ELSE
              Cc_Pkg_Elements.tr_odd;
         END IF;
         htp.p('<td>');
         htp.p('');
         Web_Pkg_Elements.doc_val(display(1)||'');
         htp.p('</td>');
         htp.p('<td>');
         Web_Pkg_Elements.doc_val(display(2));
         htp.p('</td>');
         htp.p('     <td>');
         Web_Pkg_Elements.doc_val(display(3));
         htp.p('     </td>');
    htp.p('</tr>');
    END LOOP;
    htp.p('</TABLE>');
    htp.p('<TABLE width="88%" BORDER="0" CELLPADDING="0" CELLSPACING="0"
                   align="center">');
    htp.p('<tr valign=bottom>');
    htp.p('<TD colspan=2 align=right>');
    IF l_my_page_no > 1 THEN
         htp.p('<P>'||'<IMG SRC="'||App.image||'prev.gif" ALT="'
         ||Txt_Proc_My_Joblist.prev
         ||'"'     ||' HEIGHT=20 BORDER=0 ALIGN=bottom '
         ||'hspace=2>');
    END IF;
    IF l_my_page_no < CEIL (l_total_rec/l_lines) THEN
         htp.p(' <a href="'||
         web_pkg_elements.link$$(App.gateway||'8.my_application_list?'
         ||'pi_sort_col='||Web_Pkg_Elements.replace_in_url(pi_sort_col)
         ||'&pi_msg=&pi_page_no='||TO_CHAR(l_my_page_no + 1)
         ||">'||'<IMG SRC="'||App.image||'next.gif" ALT="'
         ||Txt_Proc_My_Joblist.NEXT
         ||'"' ||' HEIGHT=20 BORDER=0 ALIGN=bottom '
         ||'hspace=2></a>');
    END IF;
    htp.p('</TD>');
    htp.p('</TR>');
    htp.p('     </TABLE>');
    htp.formHidden('pi_sort_col', pi_sort_col);
    htp.formHidden('pi_page_no', pi_page_no);
    htp.p('</FORM>');
    END my_application_list;
    END ; --cc_pkg_application_list

  • Table name from field

    Dear Sapers,
    How to find table name from field name to write functional spec.Pl elaborate it for normal & zdevelopment.Points will be rewarded for useful answer.
    Thanks in advance.

    Hi Uday,
    Just for the sake of help this reply......
    You can find the name of tables by using F1 button keeping cursor on the respective field that you want to bring in development. From there you have to move to Technical details through technical details button.
    If that field or values are getting saved into some structure then you have to search the right database tables. According to your module many database tables are there (that you can search from sdn.sap.com directly). That totally depends on your report/development that you want to bring in......
    In any development deciding the right table for start up ( I mean to say tables that will give you input fields in your FS) is critical, latter you have to search linking tables and have to give logic about how to pass values from what to what field and what to what table..... In this case Transaction code SE11 and SE16 are useful......
    This all is slightly confusing and tedious too...... Closely work with you ABAPer to get into many things and have successful development....
    Have nice development....
    Cheers!
    Abu Arbab

  • FM for getting MONTH name from DATE.

    Hi all ,
    We have a requirement to get Month name from the DATE,e.g IF date is 01/01/2008 we need a FM which can generate month name as 'JANUARY'.
    \[removed by moderator\]
    Thanks and Regards
    Kiran
    Edited by: Jan Stallkamp on Jul 30, 2008 4:26 PM

    Hi,
    Here is the code u required...
    REPORT  ZASHU_MONTH_NAMES_GET.
    data:r_code type sy-subrc.
    data:mnames type standard table of T247 with header line.
    CALL FUNCTION 'MONTH_NAMES_GET'
    EXPORTING
       LANGUAGE                    = SY-LANGU
    IMPORTING
         RETURN_CODE                 = r_code
    TABLES
        month_names                 = mnames.
    EXCEPTIONS
      MONTH_NAMES_NOT_FOUND       = 1
      OTHERS                      = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write:/ mnames.
    Thanks & Regards
    Ashu Singh

  • How to compare 2 different database to get table name which are not present in second database

    How to compare 2 different database to get table name which are not present in second database

    Sorry cannot test it right now
    use db1
    go
    select * from sys.tables t where not exists
    (select * from db2.sys.tables s where t.object_id=s.object_id)
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Problem while displaying all the table names from a MS Access Data Source.

    I started preparing a small Database application. I want to display all the Table Names which are in the 'MS Access' Data Source.
    I started to executing by "Select * from Tab" as if in SQL.
    But i got an error saying that "Not able to resolve Symbol 'Tab' in the query".
    Please let me know how can i display all the table Names in the MS Access Dats Source.

    Here i am developing the application in Swing using JDBC for accessing the database.
    I want to display all the Table names from the data source in a ListBox for easy selection of tables to view their details.

  • Table name from structure name

    Hi experts
    can anyone tell me how to find the table name if structure name is known.
    when i press F1 in table field ,it give me struct name and field name.
    how can i find table name from this struct.
    Thanks in advance

    Hi ,
    You can Check the where used list from your structure,
    or
    From SE84 transaction in abap dictionary ,give your
    structure name and execute it will show where it has
    been used.
    Hope it helps
    Regards
    Mansi

  • SRM 7.0 find transparent table name from Web dynpro Component

    Hi ,
    I am trying to find the transparent table name from Web dynpro component dictionary structure. I am working in SRM 7.0. Please let me know how to find the transpartent table for a field.
    Thanks,
    Monica

    hi,
    your question is very unclear and does not relate to performance.
    SRM uses webdynpro ABAP so the recommendation will not help.
    Do you need a technical UI element?
    Or the application table where the business data of an UI is stored???
    If it is the later, then you can use the SQL trace, change to element you are interested in, and trace it. The table should appear in the trace in connection which an UPDATE command. Still a bit cimbersome.
    Siegfried

Maybe you are looking for