New To Oracle.. Needs Help:: Conversion from SQL Server to Oracle 11g

I am new to Oracle 11g and badly need the conversion of SQL Server Functions to Oracle.. Sample Pasted Code not working .. end with error.. pls help
Create Table TempT (ID1 Varchar (10),
ID2 Varchar (10)
CREATE OR REPLACE PACKAGE GLOBALPKG
AS
TYPE RCT1 IS REF CURSOR;
TRANCOUNT INTEGER := 0;
IDENTITY INTEGER;
END;
CREATE OR REPLACE FUNCTION fTempT
i IN VARCHAR2 DEFAULT NULL
RETURN GLOBALPKG.RCT1
IS
REFCURSOR GLOBALPKG.RCT1;
BEGIN
OPEN REFCURSOR FOR
SELECT TT.*
FROM TempT TT
WHERE (fTempT.i = ''
OR TT.ID1 = fTempT.i)
RETURN REFCURSOR;
END;
CREATE OR REPLACE FUNCTION fTempTF
i IN VARCHAR2 DEFAULT NULL
RETURN GLOBALPKG.RCT1
IS
REFCURSOR GLOBALPKG.RCT1;
BEGIN
OPEN REFCURSOR FOR
SELECT *
FROM TABLE(fTempT(i))
RETURN REFCURSOR;
END;
LAST FUNCTION ENDs WITH ERROR
Error(13,7): PL/SQL: ORA-22905: cannot access rows from a non-nested table item

2. The major purpose is to get a simplest way to create a parameterized function who can return a table like output. 2nd function has no use instead i was testing the result of First Function like thisIf you just want to select from a select, you should use a view not a function.
1. which program is more help ful for writing and executing queries bcoz after using Query Analyzer of Microsoft It seems difficult to work on SQL Developer.
sqlplus? If you are having difficulty learning new tools because of an old one you used, probably best to forget the old one and concentrate on learning the new one because it will be different. This goes for the database itself also.
2. Can DMLs be used within a Function.Yes, you just can't execute the function in another SQL statement if it modifies data and this is a good thing.
3. Can temporary tables be used within a function.Unfortunately yes, but they shouldn't be unless you are in a slowest application competition.
5. Each Function which is a Table Function must be accompanied with Type Definitions?? its a bit longer way of doing the things than SQL ServerThat is why it is better to use views instead, is there any reason you want a select that you can select from inside a function?
SQL Server for last 9 years thats why i refer this toolThat is not in itself a problem, if you try and do what you did in SQLServer in Oracle, that will be a problem though.

Similar Messages

  • Conversion From SQL Server to Oracle.. Just New pls someone help

    I am new to Oracle 11g and badly need the conversion of SQL Server Functions to Oracle.. Sample Pasted Code not working .. end with error.. pls help
    Create Table TempT (ID1 Varchar (10),
         ID2 Varchar (10)
    CREATE OR REPLACE PACKAGE GLOBALPKG
    AS
         TYPE RCT1 IS REF CURSOR;
         TRANCOUNT INTEGER := 0;
         IDENTITY INTEGER;
    END;
    CREATE OR REPLACE FUNCTION fTempT
         i IN      VARCHAR2 DEFAULT NULL
    RETURN GLOBALPKG.RCT1
    IS
    REFCURSOR      GLOBALPKG.RCT1;
    BEGIN
    OPEN REFCURSOR FOR
         SELECT TT.*
    FROM TempT TT
    WHERE     (fTempT.i = ''
    OR     TT.ID1 = fTempT.i)
    RETURN REFCURSOR;
    END;
    CREATE OR REPLACE FUNCTION fTempTF
         i IN      VARCHAR2 DEFAULT NULL
    RETURN GLOBALPKG.RCT1
    IS
    REFCURSOR      GLOBALPKG.RCT1;
    BEGIN
    OPEN REFCURSOR FOR
         SELECT *
    FROM TABLE(fTempT(i))
    RETURN REFCURSOR;
    END;
    LAST FUNCTION ENDs WITH ERROR
    Error(13,7): PL/SQL: ORA-22905: cannot access rows from a non-nested table item

    I assume this is a simplified version of a more complex problem, since your second function would not return anything more than the first. If you want to use TABLE on a ref cursor, then you need to do some sort of intermediary transformation, such as using a pipelined function, as in the example in the link below. Also, this does not appear to have anything to do with objects, so should be posted in the SQL and PL/SQL forum instead.
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/tuning.htm#BABHAABE

  • Conversion from SQL Server 7.0 to Oracle 8 -- Urgent!!

    Hi!
    I've an urgent task of migrating data from SQL Server 7.0 to
    Oracle 8 for Oracle Financials Application. When is the
    Migration Workbench for SQL Server 7.0 is going to be released,
    please let me know?
    And the other question is -- Is there a possiblity that only few
    tables from the legacy system can be migrated into Oracle 8? and
    if yes, how -- details please?
    Thanks,
    Neeta.
    null

    Neeta Singh (guest) wrote:
    : Hi!
    : I've an urgent task of migrating data from SQL Server 7.0 to
    : Oracle 8 for Oracle Financials Application. When is the
    : Migration Workbench for SQL Server 7.0 is going to be released,
    : please let me know?
    : And the other question is -- Is there a possiblity that only
    few
    : tables from the legacy system can be migrated into Oracle 8?
    and
    : if yes, how -- details please?
    : Thanks,
    : Neeta.
    We plan on having a beta version of this capability in early
    August. Contact [email protected] if you want to register as
    a Beta tester.
    Yes, you can update the Oracle model in OMW to remove those
    tables you are not interested in, you can also select to just
    migrate tables & data and nothing else.
    Donal
    null

  • Conversion from SQL Server Stored Procedures to Oracle Procedures

    We are having an ERP Package which runs on SQL Server 7.0. For the Reports and Transaction windows, we are using the stored procedures extensively.Now , we want to convert it to Oracle Procedures.Where can i find the resource for this subject.
    Please mail me to [email protected]
    Regards,
    Buhari

    Oracle provides a tool, called the Migration Workbench, that can do an automated conversion. In the newest release of SQL Developer, Oracle's PL/SQL development GUI, the Migration Workbench is built in.
    Be aware, though, that there are limits to what an automated tool is capable of doing. In all probability, you'll want to manually adjust at least a handful of the procedures after any automated tool converts them in order to make things more efficient or to adjust logic that may depend on database-specific behavior. If you have code, for example, that assumes that writers block readers, that code will no longer block in Oracle, which might require re-assessing your algorithm. In addition, there are numerous approaches to developing procedures that are very common in SQL Server (the use of temp tables, for example), that while possible in Oracle generally aren't the most efficient approach.
    Justin

  • Need help changing from SQL dbo to mdf file

    My project was started using dbo is there a way to change this to an mdf without changing out the database.

    I think you answered my question the datasets in my project are connected to sqlexpress instance, Iwant to remove this connection and add a connection to an MDF file in my project. Maybe this will help explain my question better. 
    You cannot directly add connection to mdf file.But you can achieve this by first attching this MDF file to SQL express( this has some limitations like max of  4 Gfile can be attached to Sql server 2008 and 10 G for 2012).Is this you want to achieve ?
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Need help:Urgent:MS SQL Server and J2EE Server

    Hello,
    i am developing simple bean managed persistence bean. i want to know how could i use microsoft SQL Server as my database with ejb's in J2EE. i don't want to use cloudscape rather i want to connect through jdbc bridge with sql server. can any body help me out ?
    i have developed DSN for my database with the name of DsnProduct and user name for DB is guest and password is guest123.
    so do i have to change configuration is my J2EE server . or put some additional code. so far i have added the following line in my implementation class
    private String dbName= "java:comp/env/jdbc/ProductDB";
    DataSource ds = (DataSource) ic.lookup(dbName);
    con = ds.getConnection("guest","guest123");
    moreover in server configuration i have added driver
    sun.jdbc.odbc.JdbcOdbcDriver
    and also provide the following JNDI Name
    jdbc/ProductDB
    and
    it's url is
    jdbc:odbc:DsnProduct
    i am thankfull for your support.
    [email protected]

    hi llturro,
    Thanks for answering my question. I have tried out what you suggested, but I still can't fix my problem. The following are the messages that display when I try to run my servlet. It seems that the DataSource, Connection and Statement are ok, however when it comes to the ResultSet the error message appear. What's wrong with my ResultSet coding ?
    ResultSet rs = stat.executeQuery("SELECT ISBN FROM BOOKSINFO WHERE ISBN='"+primarykey+"'");
    setEntityContext Method
    Find by primary key
    DataSource OK
    Connection OK
    Primary Key = 013-00-675721-9
    Statement OK
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.RemoteException: Unknown Exception/Error thrown by EJB method.; nested exception is:
    java.lang.NullPointerException
    java.rmi.RemoteException: Unknown Exception/Error thrown by EJB method.; nested exception is:
    java.lang.NullPointerException
    java.lang.NullPointerException
    <<no stack trace available>>

  • Need help with MS SQL server JDBC driver

    Anyone has experience getting ACS working with SQL2005? We keep getting ‘com.adobe.adept.persist.DatabaseException: java.sql.SQLException: No suitable driver’
    We’re using sqljdbc.jar and sqljdbc4.jar that downloaded from Microsoft website. We added this to every library folder under tomcat, JRE and SDK but it did not help. Any suggestion will be helpful.
    Thanks-

    Hi,
    We have ACS with SQL Server 2005 Std correctly working.
    We have this settings:
    ############ SQL Server Connection ############
    com.adobe.adept.persist.sql.driverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
    com.adobe.adept.persist.sql.connection=jdbc:sqlserver://ip-addressSQL:PortSQL;databaseName =Adept
    com.adobe.adept.persist.sql.dialect=microsoft
    com.adobe.adept.persist.sql.user=userSQL
    com.adobe.adept.persist.sql.password=passSQL
    Wi use Microsoft SQL Server JDBC Driver 3.0 downloaded from Microsoft website (http://www.microsoft.com/download/en/details.aspx?id=21599)
    Good luck,

  • Need help understanding MS SQL Server 2008R2 and Report Builder 3.0 and user access / priviledges.

    Having Problems with connections and access.  I have spent the last 2 days reading various threads regarding SQL Reporting Services pertaining to access and connections.
    First, let me explain what I have done to date.
    1)  I am using Windows 7 - Home Premium.
    2)  I downloaded and installed MS SQL Server 2008 R2 Express.  This was successful.
    3)  I downloaded Report Server 3.0 - This was successful.
    4)  In IE, I tried logging onto http://servername/reports, but this failed.  After logging into IE
    via ' Run Administrator', I was able to access URL.  
           Next, I updated the security / trust sites as explained in the
    threads
    Next, I went to Folder Setting and added my user name and granted all roles (Browser,
    Content Manager, My
    Reports, Publisher and Report Builder).
    5)  Now, I can log into Http://servername/reports using my normal windows 7 user account.
    6)  Next, I opened Report Builder 3.0.  However, I am having trouble connecting to report  
    server.  I tried connecting with
    http://servername/reports, but this failed. 
           However, If I change URL to http://servername/reportserver, it works.  BUT NOW, I have
    another problem.  When I
    execute the RUN button to create report, I get a  permission
    error.  "PERMISSION GRANTED TO USER ARE
    INSUFFICIENT FOR  PERFORMING THIS OPERATION".
    7)  Finally, I can not save reports to http://servername/reportserver when I select "Recent
    Site and Servers".  ERROR
    MESSAGE:  UNABLE TO OPEN OR SAVE REPORT
    8)  In my Reporting Services Configuration Manager:
    Web URL = http://servername:80/ReportServer
    Report Manager URL = http://servername:80/reports.
                What is strange, the Report Manager URL works for IE URL and WEB URL works for
    Report Builder connect (Even though it really does not work). 
    THREE QUESTIONS:
    1)  What URL should I use to connect in Report Builder.  
    2)  How do I update my normal Windows 7 user so I can run reports when I connect to report
    builder.        
    3)  How can I save my reports so they are displayed in IE Reporting services.  Note:  I was
    able to save report to
    documents folder and import into IE Reporting Services.
    4)  And finally, is it possible to add report builder 3.0 as a tab in my IE Reporting Services.  I
    save seen samples of Reporting Services screens where the instructor has Report Builder
    tab.
    Thanks
    Dan

    To answer question 1... it should connect through /ReportServer
    http://bretstateham.com/reporting-services-architecture-diagram%E2%80%A6/
    Report Builder 3.0 is not a web application, it is a client side application can be used using the click-once or downloaded from Microsoft's website.  If you are having issues, you might download and install it and try running it as an administrator.

  • Migration from SQL Server 2008 to Oracle 11g

    Hi there,
    I have a quick question, Anyone who have experienced to migration procedures,function from SQL Server 2008 to 11g R2. Is it possible? I migrated tables and views through Oracle heterogenious servinces but I am not sure about the fucntions and procedures.
    Any help would be appreciated.
    Warm regards,

    Automated conversions are possible. After these conversions the system will pretty much run. However, and it can be a pretty big HOWEVER, performance could well take a hit - which the uninitiated or SQL Server acolytes will seek to blame on Oracle not being very good. This is not actually the case.
    You could be in for a major review and rewrite. Besides the syntax differences in the procedural languages, there is a huge - like really huge - difference in transaction control, isolation, and read consistency. Basically, keep in mind that Oracle reads do not block writes, writes do not block reads, and there are no dirty reads. Writes only block other writes. Thus, no coding 'tricks' are needed to get around these blockers. Oracle has global temporary tables that are generally used to help out those converting from SQL Server. In actuality, then are mostly not needed as you can almost always do your work in one SQL statement.
    Read the concepts guide from cover to cover, then do it again, then start looking at what you need to do to convert your procedural code.

  • Migrating from SQL Server to ORACLE - Pls help

    Hi All,
    I am a .Net developer. I am asked to migrate a project from SQL Server to ORACLE. Can anyone help me how to move forward.
    I used SQLDEVELPOR tool and migrated all the tables. But the Stored Procedures haven't got migrated properly. I need to migrate all the SP's from the scratch.
    Please help me.
    Thanks in advance,
    Srinivasan.T

    You might consider post your question in Migration Bench forum.
    Database and Application Migrations

  • Help with translating SQL query from SQL Server syntax to Oracle syntax

    Hi,
    is it someone that can help me translate following SQL query from SQL Server syntax to Oracle syntax.
    SELECT ID,
    [LMT(MTR)] = MAX(case when TYPE = 'LMT' then VALUE end),
    [AAD(KGM)] = MAX(case when TYPE = 'AAD' then VALUE end),
    [VOL(MTQ)] = MAX(case when TYPE = 'VOL' then VALUE end)
    FROM yourtable
    GROUP BY ID
    Your help is highly appreciated, thanks in advance.

    Like this,
    SELECT ID,
    MAX(case when TYPE = 'LMT' then VALUE end) LMT_MTR,
    MAX(case when TYPE = 'AAD' then VALUE end) AAD_KGM ,
    MAX(case when TYPE = 'VOL' then VALUE end) VOL_MTQ
    FROM yourtable
    GROUP BY ID-Arun

  • Migration from of database and app from SQL server 2005 to Oracle 10g

    Hello Every body,
    Lately, I have been requested to migrate one inhouse developed hub application from SQL server 2005 to Oracle 10g. The objective is to move application and also the database to Oracel 10g.
    Here is the current platform:
    OS Win 2008 64 bit
    JDK 1.4.2
    JBoss 3.2.5
    EJB 2.1
    My question is what kind of issues you guys see in above upgrade. As far I know, Schema and Database migration can be done by Oracle workbench. Oracle 10g supports JDK 1.4. Oracle 10g also supports EJB 2.1.
    Anything, I need to take into consideration or any risks or problems. I would like to list down all the risks, and accordingly, I am thinking of start the upgrade.
    Thanks in advance.
    Regards,
    Zeeshan Qureshi

    In general the Java/J2EE application needs work in the following categories:
    1. Connection Settings: Use Oracle JDBC drivers, create new data sources, connection pools and what not. Disable AUTOCOMMIT for Oracle JDBC Connections.
    2. For EJBs, you should regenerate the entity beans because some object names/column names might have changed in oracle.
    3. Any custom SQL that is in use in the EJBs will have to be ported to Oracle just as you would do in stored procedures and other applications.
    4. For Java front-ends, if you are using callouts to stored procedures and expecting result sets then they will require some changes. You need to modify the stored procedure call signature to include the REF CURSOR variables and process them.
    5. Changes to any SQL Server specific database functions manipulating character/date data will be required.
    6. CLOB/BLOB/XML apis are different across databases so if you are using those then focus on them as well.
    7. Retreiving Auto/generated keys from database also may need changes from what I have seen.
    Hope this helps..
    Regards
    Prakash
    NOTE: Not sure why but my posts from yesterday are not visible today. Even worse is that I can see them in one browser (FireFox) but not in Internet explorer. Crazy browser day I am having.

  • 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

  • Exporting data from SQL Server database to Oracle database

    Hello All,
    We need to replicate a table's data of SQL Server database to Oracle database.
    Can this task be accomplished using Import/Export wizard or Linked servers?
    Can help me regarding which Oracle data access components should i download to do this?
    I am using SQL Server 2012.
    And i have Oracle 11g release 2 client installed in my system.
    Thanks in Advance.
    Thanks and Regards, Readers please vote for my posts if the questions i asked are helpful.

    Yes you can definitely transfer data from SQL server to Oracle Have a look at below links
    Export SQL server data to Oracle Using SSIS
    Use OLEDB data provider to transfer data from SQL server to Oracle
    Using Import Export Wizard
    Similar thread
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • Migration from SQL Server 7 to oracle 8.1.7 on windows 2000 professional

    Hello All,
    I am currently working on Database migration from sql server 7 to oracle 8.1.7.
    My setup is as follows:
    1. Both the databases (sql server and oracle are on the same machine )
    2. My sql server database contains 200 tables and 190 stored procedures, which need to be migrated to oracle.
    When i am trying to capture the Source database details, its capturing evry thing but when its mapping at the end ...it says "MAPPING ROLE PUBLIC" and its not proceeding furthur..What do u want me to do ? i waited for approx 1 hr , still its not proceeding....How to resolve this bug ?
    Also please suggest me the best methodology for Migrating the stored procedures. allmost all my stored procedures have TEMP Tables implemented in it. Please help me in this...
    Also please let me know the Timeframe estimate for this total thing to be done..
    Waiting for your reply,
    Thanks and Regards
    SAI SREENIVAS JEEDIGUNTA

    You can user Oracle Migration Workbench to migrate from SQL Server to Oracle.
    Here is the link which gives info on software usage and download :
    http://otn.oracle.com/tech/migration/workbench/content.html
    Chandar

Maybe you are looking for

  • How to update multiple records in Oracle ?

    Hi Guys, <b>I have to update multiple records from a file into Oracle Table...</b> I can successfully insert the multiple records into the table but can't update the multiple records into the table. when i am using UPDATE_INSERT only my first record

  • Back button- code

    hi all , i created a custom page. on click of an url on seeded page i traverse the page to my custom page. Now i need to place a button/link such that i must go to previous page. How to do this using javascript in OAF. can any one send me the code fo

  • Delvery split  - message 'VL462'

    While doing Vl10c , the Outbound delivety is splitting . Tried with Vl02n , for merging the items from another Sales Order Error displayed   Transactions do not match according condition 051  - MESSAGE No. VL462 Checked for all the following possibil

  • Can not Get Raw to install

    I have a new Mac, and am installing PS CS5 and bridge. It is not reading old camera raw files and will not install the plug in A screen comes up and says ask for help.. SO I am asking for help Any takers? THanks

  • Wireless network unstable/broken N500

    My WiFi is really messed up, It works for about 20 minutes after a fresh reboot but then it goes down and is seen as inaktive and it can´t be aktivated by either the fysical button or any windows/lenovo function in the OS. I've installed the latested