Converting Table Names to Uppercase

I am converting SQL Server 7 or 8i. My SQL Server database has tables that are mixed case. Is there any way in the Migration Workbench to force the tables to be upper case?

Hi,
By default all Oracle Object names are upper case unless that are enclosed by double quotes.
John

Similar Messages

  • Jdbc bug in executeUpdate(sql, int[]) when table name is case-sensitive;

    I have found a bug in oracle's jdbc (ojdbc6.jar), can someone tell me how to submit it so that it can be fixed?
    The BUG: using executeUpdate(insert_sql_stmt, int[]) to retrieve the generatedKey generated by before-insert trigger using a sequence results in error when the tablename is case-sensitive (but OK if table name in uppercase).
    Steps to reproduce:
    1a. create table "mixCase" (f1 integer, f2 varchar2(20));
    1b. create table upperCase (f1 integer, f2 varchar2(20));
    2a. create sequence mixCase_seq start with 1;
    2b. create sequence upperCase seq start with 1;
    3a. create or replace trigger mixCase_trigger before insert on "mixCase"
    bq. for each row \\ begin \\ select mixCase_seq.nextval into :new.f1 from dual; \\ end;
    3b. create or replace trigger upperCase_trigger before insert on upperCase
    bq. for each row \\ begin \\ select upperCase_seq.nextval into :new.f1 from dual; \\ end;
    4a. String url = "jdbc:oracle:thin:@//localhost:1521/orcl";
    bq. conn=DriverManager.getConnection(url,user,password); \\ Statement stmt = conn.createStatement (); \\ int rc=stmt.executeUpdate("insert into \"mixCase\"(f2) values('aa')",new int[]{1});
    4b. String url = "jdbc:oracle:thin:@//localhost:1521/orcl";
    bq. conn=DriverManager.getConnection(url,user,password); \\ Statement stmt = conn.createStatement (); \\ int rc=stmt.executeUpdate("insert into upperCase(f2) values('aa')",new int[]{1});
    When you run 4a or 4b in a java jdbc program:
    4b runs OK and rset=stmt.getGeneratedKeys() returns the correct f1 value of 1.
    4a results in error:
    bq. h6. java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist \\ + at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)+ \\ + at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)+ \\ + at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)+ \\ + at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)+ \\ + at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:406)+ \\ + ...+
    +Notes:</</em>
    # If Statement.RETURN_GENERATEDKEYS is used instead of "new int[]{1}" in 4b, there is no error but the rset=stmt.getGeneratedKeys() returned in a ROWID such as 'AAARUyAAEAAAAGQAAL', not what is expected. Other database's jdbc return the correct generated integer value.
    # Same 4b error if new String[]{"f1"} is used as 2nd argument for executeUpdate.
    # The only difference in 4a and 4b is that 4a has case-sensitive table name. All sequence names, trigger names, column names are implicitly deemed to be uppercase by oracle in both cases.
    bq.
    Edited by: user10343198 on Oct 2, 2008 5:50 PM
    Edited by: user10343198 on Oct 2, 2008 6:34 PM

    Please patch one fo your machines to 10.2.0.3 and then try and duplicate. You do not have to go through the complete registration of the XSD process thoguh you can check and see if the c based parser will validate on the command line using the
    schema executible under your oracle_home bin directory.
    schema 1.xml 1.xsd
    for example
    if it dupes in 10.2.0.3 open a TAR with support so that we may bug it.
    regards
    Coby

  • Toplink JPA forces database table and column names to UPPERCASE! Why?

    I have recently experienced using Toplink JPA while using glassfish ... migrating an existing application to EJB 3.0 persistence. Toplink JPA, as implemented in glassfish, forces tablenames and column names from my code to be uppercase in select statements, etc. as then submitted to the database. Why? I cannot find anything in the EJB 3.0 specs on persistence that even suggests this.
    This created a serious problem for me, in my application. For my code to work I had to change the names of the database tables to all uppercase, even though that meant other of my applications, already written using the original mixed case names of the databases, will no longer work unless I revise the code in those applications! (I am using mySQL as my database.)
    In both Unix/Linux and Java, which are both case sensitive, If I wanted names of files or other items to be uppercase, I would have written them that way. I do not expect some middleware piece of software to muck around with the case of text I have put into my code.
    I am hopeful this 'feature' of the reference implementation of the EJB Persistence API will be corrected in a subsequent version. [Maybe you can tell I am not happy!]
    Thanks for listening to my rant.

    Robert,
    I found that the name I specify in all of my @Table, @Column, ... annotations is used with the case as it is provided.
    If TopLink determines the schema information through defaults then the names it comes up with are definitely upper cased by default.
    Are you specifying the schema information that you want in annotations or XML?
    Doug

  • How to get the table name in the trigger definition without hard coding.

    CREATE  TRIGGER db.mytablename
    AFTER UPDATE,INSERT
    AS
        INSERT INTO table1(col1)
        SELECT InsRec.col1   
        FROM
        INSERTED Ins
       --Below i am calling one sp for which i have to pass the table name
       EXEC myspname 'tablename'
      In the above trigger,presently i am hard coding the tablename
      but is it possible to get the table name dynamically on which the trigger is defined in order to avoid hard coding the table name

    I really liked your audit table concept.  You inspired me to modify it so that, the entire recordset gets captured and added a couple of other fields.  Wanted to share my end result.
    USE [YourDB]
    GO
    /****** Object: Trigger [dbo].[iudt_AutoAuditChanges] Script Date: 10/18/2013 12:49:55 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER TRIGGER [dbo].[iudt_AutoAuditChanges]
    ON [dbo].[YourTable]
    AFTER INSERT,DELETE,UPDATE
    AS
    BEGIN
    SET NOCOUNT ON;
    Declare @v_AuditID bigint
    IF OBJECT_ID('dbo.AutoAudit','U') IS NULL BEGIN
    CREATE TABLE [dbo].[AutoAudit]
    ( [AuditID] bigint identity,
    [AuditDate] DateTime,
    [AuditUserName] varchar(128),
    [TableName] varchar(128) NULL,
    [OldContent] XML NULL,
    [NewContent] XML NULL
    ALTER TABLE dbo.AutoAudit ADD CONSTRAINT
    PK_AutoAudit PRIMARY KEY CLUSTERED
    [AuditID]
    ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    CREATE NONCLUSTERED INDEX [idx_AutoAudit_TableName_AuditDate] ON [dbo].[AutoAudit]
    ( [TableName] ASC,
    [AuditDate] ASC
    )WITH (STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    END
    Select * Into #AuditDeleted from deleted
    Select * Into #AuditInserted from inserted
    While (Select COUNT(*) from #AuditDeleted) > 0 OR (Select COUNT(*) from #AuditInserted) > 0
    Begin
    INSERT INTO [dbo].[AutoAudit]
    ( [AuditDate], [AuditUserName], [TableName], [OldContent], [NewContent])
    SELECT
    GETDATE(),
    SUSER_NAME(),
    [TableName]=object_name([parent_obj]),
    [OldContent]=CAST((SELECT TOP 1 * FROM #AuditDeleted D FOR XML RAW) AS XML),
    [NewContent]=CAST((SELECT TOP 1 * FROM #AuditInserted I FOR XML RAW) AS XML)
    FROM sysobjects
    WHERE
    [xtype] = 'tr'
    and [name] = OBJECT_NAME(@@PROCID)
    Set @v_AuditID = SCOPE_IDENTITY()
    Delete from AutoAudit
    Where AuditID = @v_AuditID
    AND Convert(varchar(max),oldContent) = Convert(varchar(max),NewContent)
    Delete top(1) from #AuditDeleted
    Delete top(1) from #AuditInserted
    End
    END

  • Table Names for the Contract Budget(PO value) and Invoiced Budget

    Hello Team,
    Can you please share your ides on the below two queries
    1. How can we Identify the Contract Budget from the P.O Number
    2. How can we know how much of it has been Invoiced
    Please provide the Table Names also if you know, where these values can be stored.
    These are required to create a BW report.
    Regards,
    gsnreddy.

    Hi Aleksey Tkachenko
    Thanks for the reply
    let me clear this a little bit about my query
    what i want is the total PO value
    i.e. for how much amount the PO was created and how much of that amount is converted in to invoice
    Where can i get this data?
    Is this data was saved in any of the SAP table?
    Regards,

  • Table Name on JDBC

    Hi Experts,
    If I am working on a outbound interface using JDBC (SAP to ODS) on direct insert and update, how can we check the target table name of ODS? I believe it's in somewhere of my Message Type or Message Interface? Or is it at the Communication Channel? I have no idea how can I look for it after several try and error.
    Example, the table SAP_INVOICE in ODS is ready for SAP to pump in data, where can I get the SAP_INVOICE value in my XI?
    Thanks.
    Cheers,
    Isaac.

    Refer this link : [JDBC Message Format|http://help.sap.com/saphelp_nw04/Helpdata/EN/2e/96fd3f2d14e869e10000000a155106/content.htm]
    Check the JDBC receiver Message Type.
    Or check converted XML in Communication Channel Monitoring (for JDBC).
    Thanks
    farooq

  • Create table with dynamic table name.

    I'm trying to create a table
    like
    select x.*,  convert(nvarchar(20), getdate(), 101) AS LoadDate
    into table1_20140512
    from (
           select c1,c2,c3 from table2_20140512
           WHERE(LoadDate = (select MAX(LoadDate) FROM table2_20140512   )
           union all
        select c1,c2,c3 from table3_20140512
          WHERE(LoadDate = (select MAX(LoadDate) FROM table3_20140512  )
    ) X
    I want to make table name dynamic, like 'table1'+toady's date
    I declared three variables, but they didn't work as I expected  
    These are my variables
    DECLARE @table1 nvarchar(500)
    DECLARE @table2 nvarchar(500)
    DECLARE @table3 nvarchar(500)
    SET @table1='H1_' +(CONVERT(VARCHAR(8),GETDATE(),112))
    SET @table2='H2_' +(CONVERT(VARCHAR(8),GETDATE(),112))
    SET @table2='H3_' +(CONVERT(VARCHAR(8),GETDATE(),112))

    Try the following:
    DECLARE @SQL nvarchar(2000);
    DECLARE @table1 nvarchar(500) ='H1_' +(CONVERT(VARCHAR(8),GETDATE(),112));
    DECLARE @table2 nvarchar(500) ='H2_' +(CONVERT(VARCHAR(8),GETDATE(),112));
    DECLARE @table3 nvarchar(500) ='H3_' +(CONVERT(VARCHAR(8),GETDATE(),112));
    PRINT @table1+' '+@table2+' '+@table3;
    --H1_20140512 H2_20140512 H3_20140512
    SET @SQL = 'select x.*, convert(nvarchar(20), getdate(), 101) AS LoadDate
    into '+QUOTENAME(@table1)+'
    from (
    select c1,c2,c3 from table2_20140512
    WHERE(LoadDate = (select MAX(LoadDate) FROM '+QUOTENAME(@table2)+' ))
    union all
    select c1,c2,c3 from table3_20140512
    WHERE(LoadDate = (select MAX(LoadDate) FROM '+QUOTENAME(@table3)+' ))
    ) X '
    PRINT @SQL; -- debugging
    /* select x.*, convert(nvarchar(20), getdate(), 101) AS LoadDate
    into [H1_20140512]
    from (
    select c1,c2,c3 from table2_20140512
    WHERE(LoadDate = (select MAX(LoadDate) FROM [H2_20140512] ))
    union all
    select c1,c2,c3 from table3_20140512
    WHERE(LoadDate = (select MAX(LoadDate) FROM [H3_20140512] ))
    ) X
    EXEC sp_executeSQL @SQL;
    Dynamic SQL examples:
    http://www.sqlusa.com/bestpractices/dynamicsql/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Bug With Quoted Table Names?

    I think I've encountered a bug in Oracle 9.2.0.1.0. If I create table with its name in quotes, I can't access it again unless I also use the name in quotes. But, in DBA_OBJECTS the table's name shows up without quotes.
    For example:
    CREATE TABLE "avalys" (test number);
    SELECT * FROM "avalys"; --Works
    SELECT * FROM avalys; --Doesn't
    Any idea what the problem could be? Am I just not supposed to quote table names (I need to, because one of our tables is a reserved word, and unfortunately we can't change the name of the table).

    When you put quotes around a table name, you're telling Oracle to store the table name in a case-sensitive fashion, rather than the default case-insensitive fashion. When you use a non-quoted identifier, Oracle automatically upcases the whole thing and tries to resolve the name. Thus, you can do the following (not the uppercase table name in quotes)
    SQL> create table "FOO" (n1 number);
    Table created.
    SQL> select * from foo;
    no rows selected
    because "select * from foo" implicitly upcases foo. If you declare a table with some lowercase letters, i.e.
    SQL> create table "FOo" (n1 number);
    Table created.
    you'll only be able to access it with the same partially lowercase string, i.e.
    SQL> select * from "FOo"
    no rows selected
    Justin

  • Table names migration

    Hello,
    The table names in access we use have spaces between them... Example "Table name". Will migration workbench accept such names and convert them into oracle? I've never used such names in oracle. Normally underscores are used. What happens to the code behind forms and reports if at all the MWB changes the table names to something else?

    The tables will be replaced with linked tables and queries created using tha names of your existing tables. This means that the existing forms and reports do not need to change as they will access the queries rather than the tables.
    Hope this helps.
    Kevin

  • Getting information about table names & other meta data

    Hi,
    I want to know about DatabaseMetaData & how to acess all table names & other metadata using JDBC-ODBC as well as direct drivers
    can i get code for converting one type of database file to other.
    Idesperately need this code.
    please............

    While most RDBMS implementations are stored as flat files, you cannot normally directly 'convert one type of database file to other'. DatabaseMetaData will give you a list of tables, views, schema, columns, etc. You can then create your own dynamic SQL statement, SELECT the data from the legacy RDBMS and INSERT into the new RDBMS. Otherwise, I'm not sure how you would accomplish a conversion without knowing the internals of the database or special software.
    - Saish

  • Access Tables in an Informix Database that have their table names in lower

    Any help greatly appreciated!
    Thanks

    dear Frank,
    check if helps oss note 520496 mentioned in doc
    'Transferring Data with DB Connect'
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/2f0fea94-0501-0010-829c-d6b5c2ae5e40
    we are using db connect but never with informix.
    hope this helps.
    520496-BW 3.0 external DB Connect after INFORMIX
    Symptom
    You want to connect an external Informix database to a BW Release greater than 3.0A in the form of a source system via an external Database Connect. This note describes the following:
    prerequisites to be met
    problems that can occur
    which of these problems can be solved.
    Other terms
    Rsdbc, DATES, TIMES, DBCON, DBCONNECT, source system, database, InfoSource, DataSource
    Reason and Prerequisites
    1. General
    2. Supported BW / Basis versions
    3. Possible main problem areas
    a) Conventions and notation
    b) Use of data types
    c) Code page and sort sequence of the source system
    1. General
                   Implementing the above function enables you to load data into a BW system from any Informix database. Unlike an Informix database delivered by SAP AG, you can configure this database as you like. This can cause constellations where an external DB access cannot be used directly. For most of these scenarios, a satisfactory customer-specific solution can be developed. However, the consulting expenses associated with this solution are not part of the normal support and are settled separately. A certain level of expertise and experience in using the source database (Informix in this case) is required to set up this connection, especially in the areas
    DB-specific tools
    DB-specific SQLSyntax
    DB-specific function
                   Knowledge of the source application is also required for transferring semantically-relevant data to the BW system.
    Solution
    1. Supported BW/Basis versions
                  BW 3.0B   Basis 6. 20 Support Package 21
    1. Possible main problem areas
    a) Conventions and notation
                The DB connect interface in BW always expects capitalized table and field names. Since table and column names are usually written in lower case in Informix, access to an external table must be enabled via a view on the (external) Informix database. Field and table names must be entered in upper case in the view (enclose in quotation marks; environment variable DELIMIDENT must be set).
               Another advantage of the view is that access rights to the external table can be adjusted accordingly for the new requests. The view should be created as follows:
    create view "<VIEWNAME>" ("<FIELD1>", "<FIELD2>"..)
    as select
      <field1>, <field2>....
    from <tabname>;
    a) Use of data types
                In the case of SAP installations, the DB data type DATE and DATETIME are not used. Date and time are stored by the DDIC as character-like data types on the database. These date types therefore cannot be copied to the BW consistently without additional activities.
               Solution:
                You must create a view in the source system view which transforms the date types. DATE must be converted to an CHAR8 field (date) and DATETIME to an CHAR8 field (date) and a CHAR10 field (time):
    create view "<VIEWNAME>" ("<FIELD1>")
    as select
      substring ( to_char(<date_field>,'%Y%m%d) from 1 for 8 )
    from <tabname>;
    create view "<VIEWNAME>" ("<FIELD1>", "<FIELD2>")
    as select
      substring ( to_char(<datetime_field>,'%r) from 1 for 2 ) ||
      substring ( to_char(<datetime_field>,'%r) from 4 for 2 ) ||
      substring ( to_char(<datetime_field>,'%r) from 7 for 2 ) ||
      '0000'
    from <tabname>;  #
                Informix and ABAP support a value range of 1x10E-307 to 1x10E+308 for the 'float' data type. Limits may apply in the case of other databases. Before transferring 'float' data types to BW, you should therefore check the permissible value range on the target database.
    a) Code page and sort sequence of the source system
                   R/3 kernel based systems like BW are configured so that the database used is created with code page cp850 and the sort sequence 'bin'. The configuration of the source system may deviate from this.
                   If the sort sequence is different, operations for pattern search ( like ) and area search ( between, >, < ) for character-like fields may return different results. No solution is currently available for this problem.
                   The use of multibyte code pages in the source system for storing character sets with more than 256 characters ( Kanji, Hiragana, Korean, Chinese etc.) can cause inaccuracies in the data. No solution is currently available for this problem.

  • Convert table MARA -- Help Me Please!!

    Hi all,
    I was to experiment if bapi extension works for currency field or not. As such added two fields ( one CURR other CUKY) in a Z-STRUCTURE already appended in MARA table.
    After experimenting, I deleted these fields from the Z-Structure and tried activating the Z-structure. It ended up in partial activation of the Z-Structure and an Error message saying
    Structure change at field level (convert table MARA)
    Now though the fields have been deleted from the structure ZST_MMNEW, The MARA table still has these fields.
    What should I do to remove these field from MARA? These fields are blank for all the records in MARA.
    Have I done something wrong with the Standard SAP table? Can this be corrected?
    Please help
    Thanks in advance,
    KG

    Ravi and Thomas,
    Please tell me whether these steps will correct the problem
    1. go to se14
    2. Enter object name as MARA and Click EDIT.
    3. Click "Activate and Adjust database" with the Save  Data radio button checked.
    Is it all? The current records in the table won't be deleted, right?
    At present the mara table has 65K records. Will it take more than half hour to run this process?
    Kindly confirm,
    Thanks in advance,
    KG

  • Standards for creating fields & table names

    Hi All,
    I need to know if there are any SAP standards or standards from clients to be followed in creating new fields, tables & description.
    If there are any such data, please share with me.
    Urgent.
    Regards,
    Pramod

    Hi Pramod,
    mostly we're using a common Term for the field name. The field code is the field name in uppercase using MDM_ as prefix. As you have to replace blanks (a field code does not allow blanks) we use an _ instead. Note: if you want to distinguish between SAP created and custom fields, we recommend using a different prefix! Maybe you can start your Custom field codes with ZMDM or a prefix describing your customer? Currently we cannot enforce this in MDM as the MDM_ prefix is not yet protected. But if you follow our recommendation, it'll ease up your life and of course ours, too, as we can differentiate between SAP and customer fields in OSS messages.
    Edit: regarding descriptions
    If your field is somehow linked with a ERP field, you could reuse the description of ERP for example!
    Cheers
    Michael
    Edited by: Michael Theis on Jul 25, 2008 10:57 AM

  • EHP4 install has error at PARCONV_UPG converting table

    Hello,
    We have started the Downtime step of the EHP4 installation in our DEV
    system and the PARCONV_UPG phase stops when trying to convert a table.
    The table is a customer table which has two fields that used to have a CHAR datatype and now have a INT1 data type.  The
    table is partially active.  The table does not exist at the database level.  These two fields have two records which contain character data instead of numeric data.
    Has anyone hit the issue before?
    Kind regards,
    Matt

    This problem is resolved.  The problem occurred because the field types had changed and the table was only partially active.  It still contained character data in the field at the database level. The original table did not exist at the database level becuase it aleady been renamed to a temporary QCM table for conversion.  The solution was as follow:
    1 - Backup the table data from QCM/<tablename>  (this table name can be found in SE14 --> Analyze)
    2 - Clean the "bad" entries from this table (using sqlplus for oracle) and continue with adjustments in SE14
    3 - Repeat the phase PARCONV_UPG

  • Dynamic SQL : passing table name as parameter

    Hi
    I have a SQL query (a store procedure )  that i want to convert to PLSQL
    This is a part of my SQL query that i am trying to to find a solution for it, because i cant convert it to oracle :
    DECLARE lookupTableRow CURSOR FOR
      SELECT TableName FROM SYS_LookUpTable
      OPEN lookupTableRow
      FETCH NEXT FROM lookupTableRow INTO @tableName
      WHILE @@FETCH_STATUS=0
      BEGIN
      SET @sql='SELECT * FROM '+@tableName
    EXECUTE sp_executesql @sql
      IF @counter=0
      BEGIN
      INSERT INTO T_TABLE_MAPPING VALUES('P_MAIN_METADATA', 'Table', @tableName)
      END
      ELSE
      BEGIN
      INSERT INTO T_TABLE_MAPPING VALUES('P_MAIN_METADATA', 'Table'+CONVERT(NVARCHAR(10),@counter), @tableName)
      END
      SET @counter=@counter+1
      FETCH NEXT FROM lookupTableRow INTO @tableName
      END
      CLOSE lookupTableRow
      DEALLOCATE lookupTableRow
    As i understand i can't use ORACLE dynamic sql (execute immediate) when the table name is a parameter
    Furthermore when i execute this dynamic query in my SQL store procedure each SELECT statement return me as a result the relevant table rows , those result are different in each loop .
    So i cant do this too with ORACLE dynamic sql .
    Please advice for any solution
    * how can i use dynamic sql with table name as parameter ?
    * how can i use a "dynamic" cursor, in order to be able to display the dynamic results ?
    Thanks for the advice

    Hi,
    b003cf5e-e55d-4ff1-bdd2-f088a662d9f7 wrote:
    Hi
    I have a SQL query (a store procedure )  that i want to convert to PLSQL
    This is a part of my SQL query that i am trying to to find a solution for it, because i cant convert it to oracle :
    DECLARE lookupTableRow CURSOR FOR
      SELECT TableName FROM SYS_LookUpTable
      OPEN lookupTableRow
      FETCH NEXT FROM lookupTableRow INTO @tableName
      WHILE @@FETCH_STATUS=0
      BEGIN
      SET @sql='SELECT * FROM '+@tableName
    EXECUTE sp_executesql @sql
      IF @counter=0
      BEGIN
      INSERT INTO T_TABLE_MAPPING VALUES('P_MAIN_METADATA', 'Table', @tableName)
      END
      ELSE
      BEGIN
      INSERT INTO T_TABLE_MAPPING VALUES('P_MAIN_METADATA', 'Table'+CONVERT(NVARCHAR(10),@counter), @tableName)
      END
      SET @counter=@counter+1
      FETCH NEXT FROM lookupTableRow INTO @tableName
      END
      CLOSE lookupTableRow
      DEALLOCATE lookupTableRow
    As i understand i can't use ORACLE dynamic sql (execute immediate) when the table name is a parameter
    Furthermore when i execute this dynamic query in my SQL store procedure each SELECT statement return me as a result the relevant table rows , those result are different in each loop .
    So i cant do this too with ORACLE dynamic sql .
    Please advice for any solution
    * how can i use dynamic sql with table name as parameter ?
    * how can i use a "dynamic" cursor, in order to be able to display the dynamic results ?
    Thanks for the advice
    I have a SQL query (a store procedure )  that i want to convert to PLSQL
    I doesn't help when you use one term to mean another thing.
    SQL is a language used in both Oracle and other products, such as Microsoft's SQL Server. I don't know much about SQL Server, but Oracle (at least) doesn't support stored procedures in SQL itself; they have to be coded in some other language, such as PL/SQL.  
    As i understand i can't use ORACLE dynamic sql (execute immediate) when the table name is a parameter
    If the table name is a parameter (or only known at run-time for any reason), that's exactly the kind of situation where you MUST use dynamic SQL.
    The number of columns that a query produces (and their datatypes) is fixed when you compile a query, whether that query is dynamic or not.  If you have multiple queries, that produce result sets with different numbers of columns, then you can't combine them into a single query.  The best you can do with one query is to add NULL columns to some of the queries so they all produce the same number of columns.
    If you're just displaying the results, there might not be any reason to combine separate result sets.  Just display one result set after another.
    Whenever you have a question, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

Maybe you are looking for