Migrating Functions that return TABLE from SQL Server to Oracle

I have some functions in SQL Server that return a TABLE datatype. When these functions are moved to Oracle 9i using Migration Workbench, they give compilation errors. In the migrated function it says that the DDL stmt is passed to the ddl file, but the table is not created. I checked the ddl stmt for temporary tables and it is wrong. Its a create table stmt with no size for varchars and we can't even edit these stmts in the workbench.
Also the migrated function has the table name for return type, which doesn't works in Oracle. Oracle needs a datatype to be returned from Oracle.
How do we return a table from a function?

Yes.
If you do not enclose the object names (table/view/index etc) in double-quotes, they are stored in uppercase format in the data dictionary.
If you enclose them in quotes, they are stored in the same case ans you entered. As such, while accessing such objects, you need to tell Oracle not to convert the names to uppercase, hence the requirement to supply the names in quotes.

Similar Messages

  • Migration of table from sql server to oracle

    Hi,
    I had to export few tables from SQL Server to Oracle. After the migration, I am checking to see all the tables in Oracle that have been migrated from Sql Server. I am executing select * from tab; and am seeing all the the tables (including those have been exported) from the output list of tables. However, when I am doing a select * from x; where x is one of the few tables that have been migrated, it says table or view does not exist. This is the problem with all other migrated tables. Any help is appreciated in advance. Thanks.
    [email protected]

    Try select * from "x"

  • Insert and update tables from SQL server to oracle database tables

    Hi,
    I am having problem while update data from sql server to oracle database tables.
    I am doing one way insert +updates that is from SQL Server tables ==> Oracle database tables
    I am using tools Sql server Integration service. I can insert data from sql server to oracle but update can't. Please help me how can I update + insert from sql server to oracle database tables easily.
    Thanks in advance.

    Hi,
    What about using Oracle SQL Developer for migration
    http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html
    HTH

  • Migration of jd edward appl from SQL Server to ORacle

    IHAC who is running JD Edwards on SQL Server (about 50GB) and want to convert to Oracle 9i/10g Release.
    Did anyone done this migration on JDEdwards application and would like to hear the complexities involved in the SQL/Stored Proc/Trigger Conversions
    --

    Hi <please provide your name>,
    You should NOT migrate a JD Edwards database with the SQL Dev Migration Workbench, as for all Oracle Apps there is a standard migration procedure. JD Edwards have one like this, but I don't know exactly how you should reach it. Maybe on JD Edwards forum.
    Good luck,
    Andrei

  • Migrating a table from SQL server 2005 to oracle 9i

    Hi
    I need to migrate a table from SQL server to oracle, both of which are on different machines, I tried using SQL server DTS export functionality selected the Oracle driver, created a DSN, but it gave error message box as shown below
    Error Source: Microsoft OLE DB Provider for ODBC Drivers
    "ORA 12560 :TNS protocol adapter error"
    Context:Error During initialization of the provider
    While i was successfully able to migrate the table from SQL SERVER to MS-ACCESS and from MS ACCESS to Oracle
    thanks
    abhishek

    Hi
    thanks warren, i just figured out that the DSN i had created while migrating data from Access to oracle was User DSN, i just created a system DSN of the similar kind and was successfully able to export the data from SQL server to oracle, the only problem being the column names in SQL server are longer than the limit of 30 characters we have in ORACLE..
    Regards
    Abhishek

  • Migrating a table with BLOB field from SQL-Server to Oracle.

    Hi All,
    I'm trying to create a Class to migrate data from SQL-Server to Oracle, this table has a BLOB field.
    The Code:
    package br.com.infox;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.Statement;
    public class Migrador {
         public static void main(String[] args){
              try {
                   // Conex�o com o SQL Server
                   Class.forName("net.sourceforge.jtds.jdbc.Driver");
                   Connection conSQL = DriverManager.getConnection ("jdbc:jtds:sqlserver://10.10.2.9/protocolo","prot","suinf2002");
                   // Conex�o com o Oracle
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   Connection conORA = DriverManager.getConnection ("jdbc:oracle:thin:@10.10.2.2:1521:des","protocolo","protocolo");
                   Statement stSQL = conSQL.createStatement();
                   String querySQL = "SELECT * FROM DOC_INCORPORADO";
                   ResultSet rsSQL = stSQL.executeQuery(querySQL);
                   String queryORA = "INSERT INTO PROT_VITALICIAMENTO (NU_PROCESSO, ANO_PROCESSO, CD_USUARIO, DT_ENVIO," +
                             "DE_COMPLEMENTO, NM_ARQUIVO, ARQUIVO, NU_SEQ, CD_TIPO_ARQUIVO, MES, ANO) VALUES (?,?,?,?,?,?,?,?,?,?,?)";
                   PreparedStatement psORA = conORA.prepareStatement(queryORA);
                   while (rsSQL.next()){
                        System.out.println("Linha: " + rsSQL.getRow());
                        psORA.setInt(1, rsSQL.getInt("nu_processo"));
                        psORA.setInt(2, rsSQL.getInt("ano_processo"));
                        psORA.setInt(3, rsSQL.getInt("cd_usuario"));
                        psORA.setDate(4, rsSQL.getDate("dt_incorporacao"));
                        psORA.setString(5, rsSQL.getString("complemento"));
                        psORA.setString(6, rsSQL.getString("nm_arquivo"));
                        psORA.setBinaryStream(7, rsSQL.getBinaryStream("arquivo"), (int)rsSQL.getBlob("arquivo").length());
                        psORA.setInt(8, rsSQL.getInt("num_seq"));
                        psORA.setInt(9, rsSQL.getInt("cd_tipo_arquivo"));
                        psORA.setInt(10, rsSQL.getInt("mes"));
                        psORA.setInt(11, rsSQL.getInt("ano"));
                        psORA.executeUpdate();
                   stSQL.close();
                   psORA.close();
                   conORA.close();
                   conSQL.close();
              } catch (Exception e){
                   e.printStackTrace();
    The ERROR:
    java.sql.SQLException: Exce��o de E/S: Connection reset
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
         at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3668)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1119)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2191)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2064)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2989)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:658)
         at br.com.infox.Migrador.main(Migrador.java:41)
    What's the problem of these Class?
    Thank's.

    Depending on the version of the database you have, you could use transportable tablespaces.
    http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96524/c04space.htm#9370

  • Migration from SQL Server to Oracle 8i

    Hi,
    what are the general issues to be considered when migrating a database from SQL server to Oracle 8i.
    Is it documented on the web/ or any publication
    Samit

    What we did was to create the schema using migration work bench and then transfer the data using data junction
    The main issues that you have to handle are
    1) Data type issue, here problem comes converting chars to varchars as chars are padded and may not work in indexes, so you have to trim the afterwards, and if you have any image type data types in Sqlserver, you can use either lobs or long raw, it again depends upon your application, if you uses lobs you may have to recode your application
    2) Sql statements, Oracle cannot understand Sqlserver sql statements, so you have to convert them all. Sqlserver allows two outerjoins to a table, Oracle does not, so you have to modify your functionality
    3) Connections to the database. if you are using ODBC then use Oracle ODBC drivers and the latest ones, otherwise you may encounter memory leaks.
    These are from the top of my head, if you have any specific problem I may be able to help.
    Good luck

  • Related to migration of db from sql server to oracle 11 g

    We're trying to migrate a Sql server managment studio database to Oracle 11g using SQL Developer 4.0. We can successfully connect to both Sql server managment studion 8.0 and Oracle 11g using the tool, as well as click through the Migration Wizard and start the migration.
    This opens the Database Migration dialog box, which indicates the capture process starts normally. we get the following error:
    ora :01440 : can not insert null into migrlog (id column) ,
    \and then after some time , i get an error that migration failed
    i am not getting the reason,I thing it may be due to reason that , I have table's column in my source db with more than 30 character.
    If i am migrating one by one table . then it is not giving any error, and identifier name is getting shrink in 30 character. but i am not getting the view , stored procedure , indexes , and others
    then what is the solution  for that, somebody pls suggest any help?????????????               

    Pl do not post duplicates - related to migration of db from sql server to oracle 11 g
    Continue the discussion in your original thread
    The error message is explicitly clear
    ora :01440 : can not insert null into migrlog (id column)
    Your process is trying to insert a NULL value into the ID column, which presumably cannot be NULL

  • Migration from SQL Server to Oracle database

    I have got 2 questions:
    1. We are planning to convert our OLTP sql server databases to oracle databases. I tried using SQL Developer to migrate a small sql server database to oracle database(size 5Gb). It was fine. when I tried to migrate another database(size 90G), it is taking too long. The problem with sql developer is I cannot choose and pick tables. out of 250 tables, I need to migrate abt 80 tables(size will be abt 50G). can anybody share their experiences, if any, in converting medium size sql server databases to oracle databases? any others options??
    2. I am planning to convert sql server ddl to oracle ddl. I am testing bcp out and use sql loader to import the data. Right now, I am manually creating oracle tables from sql server tables. I am using http://download.oracle.com/docs/cd/E11882_01/gateways.112/e12069/apa.htm#BABCIIDI to convert the code. Are there any other better ways to convert sql server DDL to Oracle DDL?
    Thanks in advance

    DDLs should be converted manually. Oracle is not SQL-Server.
    If you for example have the partitioning option, you should consider using partitioning and local indexes where possible. Not all tables need to be hash tables. Do you defer segment creation or not? What is the type of tablespace? Do you set percentages for free and used to manage when the data block is on the free list and how much is reserved in the data block for updating rows in that block?
    There are numerous considerations to make in terms of the physical database design.
    Using BCP and SQL*Loader sound good. SQL*Loader is fast and scalable - am using it to load up to 3.6 million rows every 60 seconds. Direct and parallel loads provide the best performance in this regard (assuming that the underlying table structure and usage supports this approach).

  • Migrating from SQL Server to Oracle 8i

    Hi all :),
    I am trying to migrate from SQL Server to Oracle 9i.
    I am using the Migration Workbench.
    Everything goes fine during Capturing phase, but while
    creating Oracle model the Workbench just hangs at
    "Mapping Tablespaces" for over three hours.
    (not exactly hangs in the sense that it responds to mouse
    events and I can abort the ongoing activity ...)
    What should I do ? Should I let it go on and see what
    happens.
    I follow each and every step as mentioned in the
    documentation ... but obviously I am doing something
    wrong. Any pointers ???
    However ... if I try to migrate to Personal Oracle 8 ...
    the migration goes fine from start to end ... just that
    the SQL Server triggers aren't successfully migrated.

    You may want to start by downloading the Oracle Migration Workbench. That generally does a reasonable job in moving the tables, stored procedures, etc. from SQL Server to Oracle. If your VB code is database agnostic, it should continue to work without any more intervention. Realistically, however, you'll rpobably have to at least tweak a few things that don't work the same way in the old ODBC/ OLE DB provider and the new one.
    The hard part of migrations like this is that you may need to revisit some of your architectural decisions if you want Oracle to perform well. There are plenty of things that one does in SQL Server (i.e. frequent commits) to improve performance that have the opposite affect in Oracle. Identifying and fixing these sorts of things tends to be the largest part of a migration like this. Unfortunately, I don't know of a resource that talks addresses all the possible gotchas here.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com

  • Migrating from SQL Server to ORACLE using SqlDeveloper tool - IN OUT CURSOR

    Hi All,
    I am new to Oracle. I am asked to migrate a database from SQL Server to ORACLE. I have migrated all the SP's and functions except 2. I am facing the following problem. Pls do reply me if anyone knows the solution since I am struggling for the past 2 days for these two functions
    the function is as follows in ORACLE.
    create or replace
    FUNCTION ABC
    AA IN VARCHAR2,
    BB IN DATE,
    CV_1 IN OUT SYS_REFCURSOR
    When I tried to call from some other function its showing me an error.
    I called from another function as follows:
    ABC(CC,DD,CV_2);
    Shall I know how to call the above function? I feel someone has faced the same problem before. Thanks in advance for the help.
    Thanks,
    Srinivasan.T

    Its returing a number only. I am just giving part of the function.
    create or replace
    FUNCTION ABC
    AA IN VARCHAR2,
    DD IN DATE,
    CV_1 IN OUT SYS_REFCURSOR
    RETURN NUMBER
    AS
    When I call the function which has a IN OUT SYS_REFCURSOR as a parameter I am facing this problem.
    I need to know how to call a function which has the IN OUT SYS_REFCURSOR parameter.
    Thanks,
    Srinivasan.T

  • Problem in Import of Tables from SQL Server.

    Hi Forum,
    I m new to OWB.
    I m facing a prob regarding the import of tables.
    I m importing tables from SQL server through ODBC DB Link..
    It imports the tables fine, but without key constraints..
    Can u tell me, Why? and How can I import that info as well?

    Hi David,
    The things I said are not a fix for this problem.
    If your RCU installation worked, then you do not have to worry about modifying the createfr.sql.
    Edit:
    I've just tracked the problem. It appears that when using the query builder, BI forgets to add the " sign.
    For example:
    This query will give the hyperion error.
    select     "table"."field"
    from     "database.user"."table"
    To correct it write it like this:
    select     "table"."field"
    from     "database"."user"."table"
    Edited by: EBA on Nov 14, 2011 10:21 AM

  • Create oracle table from sql server

    Dear Gurus,
    I need to create some tables from sql server 2008 to a oracle 11g database. Some tables contain vbinary datatype. Now my queries are
    1. How can I do that?
    2. If DB link is a solution then would you please provide me a step by step process to do so?
    3. Is there any issue with datatype?
    SQL Server db is on windows 2008 R2
    Oracle is in RHEL 5.5
    Will appreciate ur help.

    well suppose i generate flat files from sql server and load in oracle by sqlloader then will there be any issue with vbinary datatype? what should be the equivalent data type in oracle table?

  • Faster way to migrate data from SQL Server to Oracle 10g

    We have to migrate data from SQL Server to Oracle 10 g.
    One particular table on SQL Server has records around 1.25 millions.
    We tried moving data using DTS package, but looks it will take hours with current speed of 300 records/minute.
    This table has TEXT column, which has XML strings stored. I am not sure, if this is the reason for slow migration.
    Would you please suggest better options to migrate it faster?
    Thanks in advance !!!

    Have you tried Migration work bench?

  • How to migrate from sql server to oracle

    Hi ,
    My requirement is we are planning to migrate the sql server data to oracle.
    what is the way to do migration from sql server to oracle. Please let me know if any tools are there for migration.Previous we used sql developer( which is provided by oracle i.e. freeware )
    tool but it was created only table structures not ported any data.

    Hi,
    Oracle sql developer is a great tool for migration from sql server to oracle..
    Refer the link,
    http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html

Maybe you are looking for

  • Mail dead on upgrade to 10.5.6

    I just upgraded my G4 Powermac from 10.4.11 to 10.5.6, using the Mac pack which provides the new OS, iWork and iLife. I chose to archive and upgrade, and everything seems to be working except Mail, which doesn't open a window without my opening it fr

  • Synching Multiple iCloud Accounts

    What I am trying to accomplish is syncing iCal calendars for two indivduals, both with their own AppleID and iCloud accounts.  First, is this even possible? Husband and wife, each with their own computer and mobile device(s) would like to sync a comm

  • Login with mac gives an endless loop

    I use Adobe FormCentral with my PC:s since many year. Now I have got a Mac and when I try to login from the main page I get an endless loop in the address field. What to do then?

  • Aletar KPRO para SAP Content Server (DMS)

    Pessoal, alguem já configurou o GRC para gravar no content server da SAP ? Obrigado, Marco

  • MSG HD - FCC Rules in Favor of Verizon and AT&T

    Please see the link below. The FCC has ruled in our favor. The FCC has given Cablevison 30 days to comply. I did read somewhere, that Cablevision is thinking about yet another appeal, or perhaps just ignoring the FCC mandate. Keep your fingers crosse