Sql query parsing (retrieve tables and columns used in query)

Hi,
1. Is there any view in Oracle which can tell me, which tables and columns were used in the last ran query, no matter how complex the query is.
2. Secondly I can get table names, used in stored procedures and views, using USER_DEPENDENCIES VIEW, however this System View does not return column names, used in that procedure / view, any idea please .
Thanks and Regards,
Luqman

luqman123 wrote:
Hi,
1. Is there any view in Oracle which can tell me, which tables and columns were used in the last ran query, no matter how complex the query is.I don't believe so. You can look at V$SQL and retrieve the actual SQL text from there.
2. Secondly I can get table names, used in stored procedures and views, using USER_DEPENDENCIES VIEW, however this System View does not return column names, used in that procedure / view, any idea please .Oracle added fine grained dependency tracking in 11g, but didn't expose any views to query this information. However, it has been reverse engineered a bit: About Oracle: DBA_DEPENDENCY_COLUMNS

Similar Messages

  • Retrieve tables and column names in a universe

    Hi - Is there a way to retrieve tables and columns used in a given universe? We have to do analysis and need to know the tables as well as fields used anywhere in any object defined in the universe.
    I tried Query Builder and did some selection on ci_infoobjects and ci_appobjects; they don't seem to have that kind of information.
    Please advise.
    Thanks

    Hi.
    Are you try with the option save as ... and choose to pdf inside the designer?
    In designer tools->option you can choose what you want it print/PDF.
    I hope it be helpfull for you.
    Regards.

  • Tables and Columns used in Universe (BO 6.5)

    Hi All,
    Please help me out with the below queries:
    1. Is there any automated way to find out which report is using which universe? (may be through a SQL fired in BO repository)
    (Note: As per the BO Documentation, OBJ_X_DOCUMENTS This is the only table in the document domain. It stores the binary content of all documents sent to the repository (through the user actions Publish to corporate documents, Send to users or Send to Broadcast Agent). The document contents are stored as BLOBs (Binary Large Objects) stored in slices.)
    2. I need to identify the universes which use certain tables and columns.
    I fired the following SQL in BO repository:
    SELECT
    UNV_UNIVERSE.UNI_FILENAME,
    UNV_UNIVERSE.UNI_LONGNAME,
    UNV_TABLE.TAB_NAME,
    UNV_COLUMNS.COLUMN_NAME
    FROM UNV_UNIVERSE, UNV_TABLE,UNV_COLUMNS
    WHERE
    UNV_UNIVERSE.UNIVERSE_ID = UNV_TABLE.UNIVERSE_ID
    AND UNV_TABLE.TABLE_ID = UNV_COLUMNS.TABLE_ID
    But as 'UNV_COLUMNS' table is empty, no data is returned. My question is is this table supposed to be empty in BO repository?
    Is there any other way to find out this (identify the universes which use certain tables and columns)?
    Many Thanks & Regards,
    Sandeep

    Hi,
    Please find the below list of tables created in the BO repository, which helps you to retrieve the information related to reports, universes, users e.t.c.
    OBJ_M_ACTOR
    OBJ_M_ACTORDOC
    OBJ_M_ACTORLINK
    OBJ_M_CATEG
    OBJ_M_CONNECTDATA
    OBJ_M_CONNECTION
    OBJ_M_DOCAT
    OBJ_M_DOCATVAR
    OBJ_M_DOCCATEG
    OBJ_M_DOCCST
    OBJ_M_DOCUMENTS
    OBJ_M_GENPAR
    OBJ_M_MAGICID
    OBJ_M_OBJSLICE
    OBJ_M_REPOSITORY
    OBJ_M_RESERVATION
    OBJ_M_RESLINK
    OBJ_M_TIMESTAMP
    OBJ_M_UNIVCST
    OBJ_M_UNIVDBCST
    OBJ_M_UNIVERSES
    OBJ_M_UNIVSLC
    OBJ_M_USRATTR
    OBJ_X_DOCUMENTS
    UNV_AUDIT
    UNV_CLASS
    UNV_CLASS_DATA
    UNV_COLUMNS
    UNV_COLUMN_DATA
    UNV_CONTEXT
    UNV_CONTEXT_DATA
    UNV_CTX_JOIN
    UNV_DIMENSION
    UNV_DIM_OBJ
    UNV_JOIN
    UNV_JOINCONTENT
    UNV_JOIN_DATA
    UNV_JOIN_OBJECT
    UNV_OBJCONTENT
    UNV_OBJECT
    UNV_OBJECT_DATA
    UNV_OBJECT_KEY
    UNV_OBJ_COLUMN
    UNV_OBJ_TAB
    UNV_PROPERTY
    UNV_PROP_DATA
    UNV_PROP_TAB
    UNV_RELATIONS
    UNV_TABLE
    UNV_TABLE_DATA
    UNV_TAB_OBJ
    UNV_TAB_PROP
    UNV_UNIVERSE
    UNV_UNIVERSE_DATA
    UNV_X_UNIVERSES
    Hope this tables helps you.

  • Query to Find Table and Column Name by using a value

    Dear Legends,
    I hope and surfed in our forums and google to find the Table Name and Column Name by having a value(Number/String). And my where clauses are
    where owner NOT IN ('SYS','SYSTEM') and
          data_type IN ('CHAR','VARCHAR2','NUMBER')
    May I have your help for building the query. and my query as follows
    select a.owner, c.column_name, c.data_type, c.owner, c.table_name
    from dba_objects a, all_tab_cols c
    where a.owner NOT IN ('SYS','SYSTEM') and
    where c.owner NOT IN ('SYS','SYSTEM') and
    where c.data_type IN ('CHAR','VARCHAR2')
    order by a.owner
    Thanks,
    Karthik

    You can use
    select * from user_tab_columns a, user_tables b
    where a.table_name = b.table_name
    and  a.data_type in ('NUMBER', 'VARCHAR2', 'NCHAR', 'CHAR');
    Or if you want to user DBA_* tables, you can use.
    select * from dba_tab_columns a, dba_tables b
    where a.table_name = b.table_name
    and a.owner = b.owner
    and  a.data_type in ('NUMBER', 'VARCHAR2', 'NCHAR', 'CHAR')
    and b.owner not in ('SYS', 'SYSTEM');
    And now when I look a bit more closely, you don't need DBA_TABLES there. dba_tab_columns alone is sufficient. And requirement is still not clear yet. Why you need a group by there? If I get it right, you can use this.
    select * from dba_tab_columns a
    where a.data_type in ('NUMBER', 'VARCHAR2', 'NCHAR', 'CHAR')
    and a.owner not in ('SYS', 'SYSTEM');
    Whether you use group by or not, the query will give you the same output.
    Ishan

  • Put query iresults n tables and columns

    hello , i have this query and should display
    but i need it to be in a cells like rows and columns . just
    like a ecxel spread sheet but only in html.
    here is the code.
    what do i have to add to make this happen?
    thanks in adv
    <cfquery name="GetCompanies"
    datasource="#Request.MainDSN#">
    SELECT
    CompanyID,
    CompanyName,
    Address,
    City,
    State,
    ZipCode,
    Comments
    FROM
    Company
    ORDER BY
    CompanyName ASC
    </cfquery>
    <html>
    <head>
    <title>ColdFusion MX Bible</title>
    <link rel="stylesheet" href="styles.css">
    </head>
    <body>
    <h1>Company List</h1>
    <table>
    <tr>
    <td><b>ID</b></td>
    <td><b>Name</b></td>
    <td><b>Address</b></td>
    <td><b>City</b></td>
    <td><b>State</b></td>
    <td><b>ZIP Code</b></td>
    <td> </td>
    </tr>
    <cfoutput query="GetCompanies">
    <tr>
    <td>#CompanyID#</td>
    <td>#CompanyName#</td>
    <td>#Address#</td>
    <td>#City#</td>
    <td>#State#</td>
    <td>#ZipCode#</td>
    <td>
    <a
    href="EmployeeList.cfm?CompanyID=#CompanyID#">Employees</a>
    <a href="CompanyAddForm.cfm">Add</a>
    <a
    href="CompanyEditForm.cfm?CompanyID=#CompanyID#">Edit</a>
    <a
    href="CompanyDeleteForm.cfm?CompanyID=#CompanyID#">Delete</a>
    </td>
    </tr>
    </cfoutput>
    </table>
    </body>
    </html>
    when it is displayed it is like
    Company List
    ID Name Address City State ZIP Code
    27 555k ddd ddd dd 90556 Employees Add Edit Delete
    26 555k ddd ddd dd 90556 Employees Add Edit Delete
    31 dd dd dd dd 89995 Employees Add Edit Delete
    23 ddd ddd ddd dd 90556 Employees Add Edit Delete
    22 ddd ddd ddd dd 90556 Employees Add Edit Delete
    24 ddd ddd ddd dd 90556 Employees Add Edit Delete
    21 mama 252 los angeles ca 90056 Employees Add Edit Delete
    14 Ma's Homemade Pies 5332 Courtland Court Abilene AL 29555
    Employees Add Edit Delete
    25 nknknk ddd ddd dd 90556 Employees Add Edit Delete
    15 Normwelland and Drake Clothing Co. 1240 Pierpont Point
    Boston MA 02134 Employees Add Edit Delete
    16 Pizza Palace 1548 High Point Freeway New York NY 00248
    Employees Add Edit Delete
    29 qqqq 888 laverne za 90000 Employees Add Edit Delete
    30 qqqq 888 laverne za 90000 Employees Add Edit Delete
    13 The Very Big Corporation of America 5806 Glenn Hollow Lane
    Norcross GA 30071 Employees Add Edit Delete
    without the cells/records>

    <cfquery name="GetCompanies"
    datasource="#Request.MainDSN#">
    SELECT
    CompanyID,
    CompanyName,
    Address,
    City,
    State,
    ZipCode,
    Comments
    FROM
    Company
    ORDER BY
    CompanyName ASC
    </cfquery>
    <html>
    <head>
    <title>ColdFusion MX Bible</title>
    <link rel="stylesheet" href="styles.css">
    </head>
    <body>
    <h1>Company List</h1>
    <TABLE width=100% align="left" border="4" rules="all">
    <tr>
    <td><b>ID</b></td>
    <td><b>Name</b></td>
    <td><b>Address</b></td>
    <td><b>City</b></td>
    <td><b>State</b></td>
    <td><b>ZIP Code</b></td>
    <td> </td>
    </tr>
    <cfoutput query="GetCompanies">
    <tr>
    <td>#CompanyID#</td>
    <td>#CompanyName#</td>
    <td>#Address#</td>
    <td>#City#</td>
    <td>#State#</td>
    <td>#ZipCode#</td>
    <td>
    <a
    href="EmployeeList.cfm?CompanyID=#CompanyID#">Employees</a>
    <a href="CompanyAddForm.cfm">Add</a>
    <a
    href="CompanyEditForm.cfm?CompanyID=#CompanyID#">Edit</a>
    <a
    href="CompanyDeleteForm.cfm?CompanyID=#CompanyID#">Delete</a>
    </td>
    </tr>
    </cfoutput>
    </TABLE>
    </body>
    </html>
    thanks i did but the out put is still the same
    Company List
    ID Name Address City State ZIP Code
    26 555k ddd ddd dd 90556 Employees Add Edit Delete
    27 555k ddd ddd dd 90556 Employees Add Edit Delete
    31 dd dd dd dd 89995 Employees Add Edit Delete
    22 ddd ddd ddd dd 90556 Employees Add Edit Delete
    23 ddd ddd ddd dd 90556 Employees Add Edit Delete
    24 ddd ddd ddd dd 90556 Employees Add Edit Delete
    21 mama 252 los angeles ca 90056 Employees Add Edit Delete
    14 Ma's Homemade Pies 5332 Courtland Court Abilene AL 29555
    Employees Add Edit Delete
    but still
    its not in cells

  • SQL text parsing to obtains referenced tables and columns

    I wonder if anyone has a method of scanning an SQL statement to retrieve tables and columns referenced. EG:
    select
    f.cola, f.colb, f.colc, b.cold
    from
    foo f, bar b
    where
    f.cola=b.cola and f.colb=b.colb
    order by f.colz, b.colawould provide
    Tables
    foo
    bar
    Columns
    foo.cola [SELECT] [WHERE]
    foo.colb [SELECT] [WHERE]
    foo.colc [SELECT]
    foo.colz [ORDER BY]
    bar.cola [WHERE] [ORDER BY]
    bar.colb [WHERE]
    bar.cold [SELECT]The reason is that I'd like to query through several SQL scripts and validate tables and columns in a new version of the ERP system exist

    That query with date substitution should also work. Are you seeing some errors?
    SQL> explain plan for select * from scott.emp where hiredate = to_date(':some_date', 'dd-mon-yyyy') ;
    Explained.
    SQL> @utlxpls
    PLAN_TABLE_OUTPUT
    | Id  | Operation            |  Name       | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT     |             |     1 |    40 |     2 |
    |*  1 |  TABLE ACCESS FULL   | EMP         |     1 |    40 |     2 |
    Predicate Information (identified by operation id):
       1 - filter("EMP"."HIREDATE"=TO_DATE(':some_date','dd-mon-yyyy'))
    Note: cpu costing is off
    14 rows selected.
    SQL>

  • Parse SQL query and extract source tables and columns

    Hello,
    I have a set of SQL queries and I have to extract the source tables and columns from them.
    For example:
    Let's imagine that we have two tables
    CREATE TABLE T1 (col1 number, col2 number, col3 number)
    CREATE TABLE T2 (col1 number, col2 number, col3 number)
    We have the following query:
    SELECT
    T1.col1,
    T1.col2 + T1.col3 as field2
    FROM T1 INNER JOIN T2 ON T1.col2=T2.col2
    WHERE T2.col1 = 1
    So, as a result I would like to have:
    Order Table Column
    1 T1 col1
    2 T1 col2
    2 T1 col3
    Optionally, I would like to have a list of all dependency columns (columns used in "ON", "WHERE" and "GROUP BY" clauses:
    Table Column
    T1 col2
    T2 col1
    T2 col2
    I have tried different approaches but without any success. Any help is appreciated. Thank you in advance.
    Best regards,
    Beroetz

    I have a set of SQL queries and I have to extract the source tables and columns from them. In a recent db version you can use Re: sql injection question for this.

  • How to use one query against multiple table and recieve one report?

    I have duplicate tables, (except for their names of course) with commodities prices. They have the same column headings, but the data is different of course. I have a query that gives me a certain piece of information I am looking for but now I need to run this query against every table. I will do this every day as well, to see if the buying criteria is met. There are alot of tables though (256). Is there a way to say run query in all tables and return the results in one place? Thanks for your help.

    hey
    a. the all 256 tables whuld be one big partitoned table
    b. you can use all_tables in order to write a select that will write the report for you:
    SQL> set head off
    SQL> select 'select * from (' from dual
      2  union all
      3  select 'select count(*) from ' || table_name || ' union all ' from a
      4  where table_name like 'DB%' AND ROWNUM <= 3
      5  union all
      6  select ')' from dual;
    select * from (
    select count(*) from DBMS_LOCK_ALLOCATED union all
    select count(*) from DBMS_ALERT_INFO union all
    select count(*) from DBMS_UPG_LOG$ union all
    remove the last 'union all', and tun the generated quary -
    SQL> set head on
    SQL> select * from (
      2  select count(*) from DBMS_LOCK_ALLOCATED union all
      3  select count(*) from DBMS_ALERT_INFO union all
      4  select count(*) from DBMS_UPG_LOG$
      5  );
      COUNT(*)
             0
             0
             0
    Amiel

  • List tables and column names a stored procedure is querying

    Hello,
    Is there a way to list tables and column names that a stored procedure is querying, i.e, selecting from, using T-SQL?  If yes, is there a way to also show data types for the columns that a stored procedure is querying, i.e, selecting from?
    Thank you,  
    Lenfinkel

    One way to view the dependencies of an object is to use SSMS; navigate to the object, right click and select "view dependencies".  However this does not tell you what columns are being referenced by the Stored Procedure.
    One way to view what is being referenced by a stored procedure is to run something like
    select
    text
    from syscomments
    where
    id in
    (select id
    from sysobjects
    where
    name
    =[Your Object Name]
    And xtype
    in
    ('p','P')
    Please click "Mark As Answer" if my post helped. Tony C.

  • List of SQL tables and attributes used in SSRS reports

    Hi,
    I have around 450-500 reports deployed in SSRS reporting server.
    All these reports are built on SQL from multiple databases, and these databases are having unnecessary tables and attributes.
    My requirement is to clean the unused tables and attributes from the databases. For this, I need the list of SQL tables and attributes used in these 450-500 SSRS reports.
    Is there any way to get this data?
    Regards,
    RK

    Hi RK,
    According to your description, you want to get a list of the tables and attributes used in all reports.
    In your scenario, you can query the ReportServer.dbo.Catalog table to get Report name, data source name, dataset name, and query used in the dataset with query below:
    WITH XMLNAMESPACES ( DEFAULT 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition', 'http://schemas.microsoft.com/SQLServer/reporting/reportdesigner' AS rd )
    SELECT ReportName = name
    ,DataSetName = x.value('(@Name)[1]', 'VARCHAR(250)')
    ,DataSourceName = x.value('(Query/DataSourceName)[1]','VARCHAR(250)')
    ,CommandText = x.value('(Query/CommandText)[1]','VARCHAR(250)')
    ,Fields = df.value('(@Name)[1]','VARCHAR(250)')
    ,DataField = df.value('(DataField)[1]','VARCHAR(250)')
    ,DataType = df.value('(rd:TypeName)[1]','VARCHAR(250)')
    --,ConnectionString = x.value('(ConnectionProperties/ConnectString)[1]','VARCHAR(250)')
    FROM ( SELECT C.Name,CONVERT(XML,CONVERT(VARBINARY(MAX),C.Content)) AS reportXML
    FROM ReportServer.dbo.Catalog C
    WHERE C.Content is not null
    AND C.Type = 2
    ) a
    CROSS APPLY reportXML.nodes('/Report/DataSets/DataSet') r ( x )
    CROSS APPLY x.nodes('Fields/Field') f(df)
    ORDER BY name
    For more information, please refer to this similar thread:
    Extract metadata from report server database
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Using of already existing logical tables and columns in a new subject area.

    Hi Every one,
    i am new to OBIEE technology.
    In my project i need to create a new subject area for already existing RPD.
    In that RPD there are some logical tables and column created for previous project and i need to use those in this new subject area that i am going to create.
    My question is what is the best way to use them .
    I mean just to drag and drop them into new subject area or any other way.
    please have your valuable suggestions
    thanking you

    Yes, you can basically copy paste all the tables that you need from BMM layer into your new folder in the presentation layer. Just make sure all the joins are defined well between all the tables that exists in the new folder, so you wont end up running into ODBC errors when you run analysis.
    Hope this helps.
    Thanks,
    -Amith.

  • List columns used by query

    Hi,
    Does anyone know of a way to display all the tables and columns in a database that a particular query uses? I have a long query that will be run on a different database in the future, and we want to make sure the tables and columns we need are copied there regularly. I've combed through it by hand, but would like to verify I haven't missed anything.
    I am using 10g.
    Thanks!

    example use of dbms_sql...
    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2) IS
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_rowcount  NUMBER := 0;
    BEGIN
      -- create a cursor
      c := DBMS_SQL.OPEN_CURSOR;
      -- parse the SQL statement into the cursor
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      -- execute the cursor
      d := DBMS_SQL.EXECUTE(c);
      -- Describe the columns returned by the SQL statement
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      -- Bind local return variables to the various columns based on their types
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000); -- Varchar2
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);      -- Number
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);     -- Date
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);  -- Any other type return as varchar2
        END CASE;
      END LOOP;
      -- Display what columns are being returned...
      DBMS_OUTPUT.PUT_LINE('-- Columns --');
      FOR j in 1..col_cnt
      LOOP
        DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' - '||case rec_tab(j).col_type when 1 then 'VARCHAR2'
                                                                                  when 2 then 'NUMBER'
                                                                                  when 12 then 'DATE'
                                                         else 'Other' end);
      END LOOP;
      DBMS_OUTPUT.PUT_LINE('-------------');
      -- This part outputs the DATA
      LOOP
        -- Fetch a row of data through the cursor
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        -- Exit when no more rows
        EXIT WHEN v_ret = 0;
        v_rowcount := v_rowcount + 1;
        DBMS_OUTPUT.PUT_LINE('Row: '||v_rowcount);
        DBMS_OUTPUT.PUT_LINE('--------------');
        -- Fetch the value of each column from the row
        FOR j in 1..col_cnt
        LOOP
          -- Fetch each column into the correct data type based on the description of the column
          CASE rec_tab(j).col_type
            WHEN 1  THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                         DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' : '||v_v_val);
            WHEN 2  THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                         DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' : '||v_n_val);
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                         DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' : '||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'));
          ELSE
            DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
            DBMS_OUTPUT.PUT_LINE(rec_tab(j).col_name||' : '||v_v_val);
          END CASE;
        END LOOP;
        DBMS_OUTPUT.PUT_LINE('--------------');
      END LOOP;
      -- Close the cursor now we have finished with it
      DBMS_SQL.CLOSE_CURSOR(c);
    END;
    SQL> exec run_query('select empno, ename, deptno, sal from emp where deptno = 10');
    -- Columns --
    EMPNO - NUMBER
    ENAME - VARCHAR2
    DEPTNO - NUMBER
    SAL - NUMBER
    Row: 1
    EMPNO : 7782
    ENAME : CLARK
    DEPTNO : 10
    SAL : 2450
    Row: 2
    EMPNO : 7839
    ENAME : KING
    DEPTNO : 10
    SAL : 5000
    Row: 3
    EMPNO : 7934
    ENAME : MILLER
    DEPTNO : 10
    SAL : 1300
    PL/SQL procedure successfully completed.
    SQL> exec run_query('select * from emp where deptno = 10');
    -- Columns --
    EMPNO - NUMBER
    ENAME - VARCHAR2
    JOB - VARCHAR2
    MGR - NUMBER
    HIREDATE - DATE
    SAL - NUMBER
    COMM - NUMBER
    DEPTNO - NUMBER
    Row: 1
    EMPNO : 7782
    ENAME : CLARK
    JOB : MANAGER
    MGR : 7839
    HIREDATE : 09/06/1981 00:00:00
    SAL : 2450
    COMM :
    DEPTNO : 10
    Row: 2
    EMPNO : 7839
    ENAME : KING
    JOB : PRESIDENT
    MGR :
    HIREDATE : 17/11/1981 00:00:00
    SAL : 5000
    COMM :
    DEPTNO : 10
    Row: 3
    EMPNO : 7934
    ENAME : MILLER
    JOB : CLERK
    MGR : 7782
    HIREDATE : 23/01/1982 00:00:00
    SAL : 1300
    COMM :
    DEPTNO : 10
    PL/SQL procedure successfully completed.
    SQL> exec run_query('select * from dept where deptno = 10');
    -- Columns --
    DEPTNO - NUMBER
    DNAME - VARCHAR2
    LOC - VARCHAR2
    Row: 1
    DEPTNO : 10
    DNAME : ACCOUNTING
    LOC : NEW YORK
    PL/SQL procedure successfully completed.
    SQL>

  • Get description of tables and columns

    Good afternoon.
    Is there any option in SAP B1 to get a description of table and column dynamically? That is, without the "Tools -> Queries -> Query Generator"?
    I am developing an add-on, which lists all the tables and columns of the sap, and I have to bring the descriptions automatically. If you do not have to get the SDK route descriptions, as you suggest doing this?
    Edited by: Harley Rodrigues on Feb 1, 2012 9:38 PM

    Hi Harley,
    Welcome to the Forum!
    please refer to your SDK Help. you can find it from this path C:\Program Files\SAP\SAP Business One SDK\Help
    also alternatively you can view it from your MS SQL Server Management under Databases
    regards,
    Fidel

  • Including table and column comment in the Data Modeler

    Hi all,
    I used Oracle's SQL Developer Data Modeler (Version 3.0.0.665) and created a data model for my project. I e-mailed a PDF format of the data model to our Systems Analyst. She asked if I could re-create the data model and include table and column comments. Is this a possibility and if so how is this done?
    Thank you for your input,
    Seyed

    Hi Kent,
    Using the information you provided and Oracle’s Working with SQL Developer Modeler Reporting I did the following:
    1) Created a Reporting Schema User
    1.1) Using my Oracle 10g Personal Edition, I created a new user and gave him DBA administrative privileges
    2) Exported Relational Design to Reporting Schema
    2.1) Opened the Relational Design
    2.2) Exported it to the Reporting Schema. Note, I never got a message ‘Design has been exported successfully’.
    3) Reviewed the Report Results
    I think exporting the relational design was not successful, and didn’t get any error messages. Had step 2 completed successfully, I would have reviewed the Report Results in SQL Developer. By the way, I know I have marked this topic as closed, but would like to learn your method too.
    Thank you for your help,
    Seyed

  • Toplink changes table and columns to uppercase

    I found a way to make toplink not to change table and columns to upercase with setShouldForceFieldNamesToUpperCase=false setting (which should be false be default but so some reason isn't.)
    However, when toplink is used with JSF how can setShouldForceFieldNamesToUpperCase be set to false? Is there a way to do it in persistence.xml or perhaps there is a better way altogether? (I know i can use @Table and @Column but that is a lot of redundant code if all the fields in java have exact match in DB and i am looking for a cleaner solution.)
    My setup is a follows
    toplink v2-b49
    mysql 5.0 (with 5.0.5 driver)
    servlet/jsp 2.5/2.1
    jsf 1.2
    tomcat 6.0.13
    Thanks

    Thanks Doug
    I Created that class with
         public void customize(Session session) throws Exception {
              session.getDatasourceLogin().getPlatform().setShouldForceFieldNamesToUpperCase(false);
    But that doesn't help. Then I checked if it is being set correcly and saw that it is false even before I set it, so the default works as advertised and the var is false.
    So i guess this is not the problem. Any idea what can cause it?
    here is the class
    @Entity
    @Table(schema="jpaTABLE")
    public class User {
         @Id
         private int ID;
         private String Name;
         private String Password;
         private String Status;
    public User() {}
    geters...
    setters...
    here is the code
    Query q = em.createQuery("SELECT u FROM User u WHERE u.Name = :name AND u.Password = :password");
    here is the error
    [TopLink Fine]: 2007.06.07 04:20:24.636--ServerSession(9017297)--Connection(17227669)--Thread(Thread[http-8080-1,5,main])--SELECT ID, NAME, PASSWORD, STATUS FROM jpaTABLE.USER WHERE ((NAME = ?) AND (PASSWORD = ?))
         bind => [abc, 123]
    [TopLink Warning]: 2007.06.07 04:20:24.682--UnitOfWork(14633980)--Thread(Thread[http-8080-1,5,main])--Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b49-beta3 (05/31/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'jpaTABLE.USER' doesn't exist
    Error Code: 1146
    Call: SELECT ID, NAME, PASSWORD, STATUS FROM jpaTABLE.USER WHERE ((NAME = ?) AND (PASSWORD = ?))
         bind => [abc, 123]

Maybe you are looking for