Please Help!!!!! Problem Migrating from sql 2000 stored procedure to PL/SQL

I have used a tool to convert my sql 2000 stored procedure to Oracle 10g PL/SQL, here is an example
SQL 2000 Stored Procedure
CREATE PROCEDURE [GetEmployees]
AS
Select * from EMPMST ORDER BY emp_name
GO
After Transformation i got 2 files, one was a procedure and other a package
CREATE OR REPLACE PACKAGE GLOBALPKG
AS
     TYPE RCT1 IS REF CURSOR;
     TRANCOUNT INTEGER := 0;
     IDENTITY INTEGER;
END;
CREATE OR REPLACE PROCEDURE GetEmployees
     RCT1 IN OUT      GLOBALPKG.RCT1
AS
BEGIN
     OPEN RCT1 FOR
     SELECT *
     FROM EMPMST
     ORDER BY emp_name;
END;
When i execute the procedure GetEmployees i got this error :
SQL> execute GetEmployees;
BEGIN GetEmployees; END;
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'GETEMPLOYEES'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Please Help me in debugging this error. Thanks in advance.

As the poster above mentioned you cannot call "GetEmployees" without a parameter.
Note that the procedure declaration has the following line
RCT1 IN OUT GLOBALPKG.RCT1
This means that whenever you want to call the procedure you must pass it a variable of type GLOBALPKG.RCT1
However unless this is merely a homework or learning exercise (i.e. you are not porting the code of a production application) i would strongly recommend that you do not attempt to simply convert the code to PL/SQL.
The reasoning behind this is that Oracle's architecture will be completely different to the source of the original code and if you attempt to simply port the code (especially using an automatic tool) you will almost certainly hit problems.
For example the SQL Server's 2000 code may (should be) be written based on SQL Server's locking strategy. Oracle's locking strategy is completly different if you try to use the same techniques as you do in SQL Server the performance will suffer.
Porting a code or a database schema from one platform to another involves a lot of analysis in order to take advantage of the features of the destination platform.
As I said this may not be important to you depending on why you are attempting a port.
Good Luck.

Similar Messages

  • RFC call from MSSQL 2000 stored procedure

    Hi. I need call SAP RFC transaction from stored procedure of MS SQL Server 2000.
    When i'm execute example from T-SQL Help it's work perfect
    Examples
    A. Use Prog ID
    This example creates a SQL-DMO SQLServer object by using its ProgID.
    DECLARE @object int
    DECLARE @hr int
    DECLARE @src varchar(255), @desc varchar(255)
    EXEC @hr = sp_OACreate 'SQLDMO.SQLServer', @object OUT
    IF @hr <> 0
    BEGIN
       EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
       SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
        RETURN
    END
    When i'm execute:
    DECLARE @object int
    DECLARE @hr int
    DECLARE @src varchar(255), @desc varchar(255)
    EXEC @hr = sp_OACreate 'SAP.Functions',
        @object OUT
    IF @hr <> 0
    BEGIN
       EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
       SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
        RETURN
    END
    i'm recieve error:
    0x800401F3
    ODSOLE Extended Procedure
    Wrong string with class name
    BUT! This example work perfect via another way: in VBS script, in VBA macros, in Visual FoxPro program.
    What wrong in MS SQL ???

    Hi Vitaly Ashmarin.
    Pls, Did you solve this issue?
    Ty

  • PLEASE HELP! OLE DB COMMAND - capturing Stored Procedure output run from an OLE DB Command

    I've searched through the related posts but cannot find exactly what I'm looking for.
    I have an OLE DB Source that produces multiple rows (around 200) through a stored procedure. I need to take 3 values in each row and pass them to an OLE DB Command that runs another stored procedure for each row.
    What I need is to get the output of the second stored procedure. I've read posts regarding using lookup, merge join, derived column but I still don't understand exactly how to put it all together. My destination is an excel file. Once I've obtained this output,
    I believe I can figure out how to merge the OLE DB Source results and the OLE DB Command results into one table.  The output columns of the second SP are not available to be mapped to my destination file.
    I've also explored running an Execute SQL task and passing the rowset to a variable but don't know how to pass that variable into the next stored procedure and then capture the second stored procedure results.
    OLE DB Source contains Stored Procedure X:
    DECLARE @return_value int
    declare @newdate smalldatetime
    set @newdate = convert(smalldatetime,convert(varchar(10),getdate(),101))
    EXEC @return_value = [dbo].[getnumbers]
    @dtAfterDate = @newdate,
    @dtBeforeDate = '2099-12-31 5:00:00',
    @Status = 'Any'
    NEXT IN THE PIPELINE
    OLE DB Command contains Stored Procedure Y:
    EXEC [dbo].[getaddress] ?,?,?
    One more thing, CREATING A TEMP TABLE ISN'T AN OPTION!
    Thanks!

    Thanks again for your help David!  Let me rephrase.  I'm working a server that doesn't need to be altered in anyway by me.  I just need to pull the data to my server so I can use it as needed.  I can't build any links either.  The
    only other option I'd have would be coding SQL code with some sort of cursor similar to.
    EXEC
    @return_value = [dbo].[getnumbers]
    @dtAfterDate = @newdate,
    @dtBeforeDate = '2099-12-31 5:00:00',
    @Status = 'Any'
    For every number in the resulting table:
    EXEC
    [dbo].[getaddress] something1, something2, something 3

  • HELP!!! Problem of Calling external Web Service from a Java Stored Procedur

    1.I read the topic on http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/wsclient/Readme.html about Calling external Web Service from a Java Stored Procedur.
    2.After I import .jar to Oracle what is required by the topic,som error occued.
    Like: ORA-29521: javax/activation/ActivationDataFlavor class not found,
    ORA-29545: badly formed class.
    3.These is not enough .jar required on the topic? What can I do for ORA-29545: badly formed class?
    Thany you!

    Try this
    Re: HELP! Loading Java Classes into Oracle ERROR

  • How to call a sql server stored procedure from oracle

    Hi all,
    Please anybody tell me how to call a sql server stored procedure from oracle.
    I've made an hsodbc connection and i can do insert, update, fetch data in sql server from oracle. But calling SP gives error. when I tried an SP at oracle that has line like
    "dbo"."CreateReceipt"@hsa
    where CreateReceipt is the SP of sql server and hsa is the DSN, it gives the error that "dbo"."CreateReceipt" should be declared.
    my database version is 10g
    Please help me how can i call it... I need to pass some parameters too to the SP
    thanking you

    hi,
    thank you for the response.
    when i call the sp using DBMS_HS_PASSTHROUGH, without parameters it works successfully, but with parameters it gives the following error
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver]Invalid parameter number[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index (SQL State: S1093; SQL Code: 0)
    my code is,
    declare
    c INTEGER;
    nr INTEGER;
    begin
    c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@hsa;
    DBMS_HS_PASSTHROUGH.PARSE@hsa(c, 'Create_Receipt(?,?)');
    DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,1,'abc');
    DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,2,'xyz');
    nr:=DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY@hsa(c);
    DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@hsa(c);
    end;
    Create_Receipt is the sp which requires two parameters.
    please give me a solution
    thanking you
    sreejith

  • T-sql 2008 r2 place results from calling a stored procedure with parameters into a temp table

    I would like to know if the following sql can be used to obtain specific columns from calling a stored procedure with parameters:
    /* Create TempTable */
    CREATE TABLE #tempTable
    (MyDate SMALLDATETIME,
    IntValue INT)
    GO
    /* Run SP and Insert Value in TempTable */
    INSERT INTO #tempTable
    (MyDate,
    IntValue)
    EXEC TestSP @parm1, @parm2
    If the above does not work or there is a better way to accomplish this goal, please let me know how to change the sql?

    declare @result varchar(100), @dSQL nvarchar(MAX)
    set @dSQL = 'exec @res = TestSP '''+@parm1+''','' '''+@parm2+' '' '
    print @dSQL
      EXECUTE sp_executesql @dSQL, N'@res varchar(100) OUTPUT', @res = @result OUTPUT
    select @result
    A complicated way of saying
    EXEC @ret = TestSP @parm1, @parm2
    SELECT @ret
    And not only compliacated, it introduces a window for SQL injection.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Problem while calling webservice from a plsql stored procedure

    Hi everybody,
    I need to call a webservice from a plsql stored procedure.
    I was following documentation published in the otn at the following link.
    "http://www.oracle.com/technology/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html"
    I am encountering the following error on my sql prompt-
    SQL> exec dbms_output.put_line(time_service.get_local_time('94065'));
    BEGIN dbms_output.put_line(time_service.get_local_time('94065')); END;
    ERROR at line 1:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1022
    ORA-12545: Connect failed because target host or object does not exist
    ORA-06512: at "APPS.DEMO_SOAP", line 65
    ORA-06512: at "APPS.TIME_SERVICE", line 13
    ORA-06512: at line 1
    Has anybody worked on the same example. Please direct me.
    Thanks & Regards
    Kiran Kumar

    Kiran, were you able to solve this?
    I am facing the same error.
    Oracle Server is Unix and webservice is .NET.
    I am able to connect to Java web service.

  • Problem migrating from JSF Mojarra 1.2 to 2.0

    As my subject suggests, I am having a problem migrating from JSF 1.2 to JSF 2.0.
    As a first step, all that I had done was to replace both 'jsf-api.jar' and 'jsf-impl.jar' with the newer version 2.0 and restart my server.
    As expected, server failed to publish with the following error message on the console. Any hint on solving this issue is highly appreciated.
    The error message goes as below:
    <Jun 30, 2009 10:31:54 AM PDT> <Error> <HTTP> <BEA-101371> <There was a failure when processing annotations for application D:\MalcolmX\web. Please make sure that the annotations are valid. The error is com.sun.faces.taglib.jsf_core.BeanValidatorTag>
    <Jun 30, 2009 10:31:54 AM PDT> <Error> <Deployer> <BEA-149205> <Failed to initialize the application '_auto_generated_ear_' due to error weblogic.application.ModuleException: Failed to load webapp: '/'.
    weblogic.application.ModuleException: Failed to load webapp: '/'
         at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:387)
         at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: com.sun.faces.taglib.jsf_core.BeanValidatorTag
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         Truncated. see log file for complete stacktrace
    Thanks.

    SirG wrote:
    As expected, server failedWow :P
    The error message goes as below:
    java.lang.ClassNotFoundException: com.sun.faces.taglib.jsf_core.BeanValidatorTagIs it in classpath? Exception says it is not.
    Don't you have some JSF 1.2 libraries around somewhere else in classpath? Appserver/lib? JDK/lib? Etc. You might have a mix of JSF 1.2 and JSF 2.0 in the classpath and the exception is just been caused by this collision.

  • Connecting to SQL Server and MYSQL from a Java stored procedure

    hope someone can help with this. i'm trying to connect to different databases (My SQL, SQL Server) from a java stored procedure. when invoking from within an oracle 9i database, i get the java exception error -
    "Cannot connect to MySQL server on 135.177.196.75:3306. Is there a MySQL server running on the machine/port you are trying to connect to?java.security.AccessControlException)".
    this store procedure works fine when invoked from outside of oracle. any replies would be greatly appreciated. thanks!

    the correct drivers have been loaded. it works when called from outside of oracle. only when invoking from within oracle do we get the error message "Cannot connect to MySQL server on 135.177.196.75:3306. Is there a MySQL server running on the machine/port you are trying to connect to?(java.security.AccessControlException)". it sounds like a permissions/security/configuration issue - oracle is not allowing access to the machine/port for the MySQL or SQL Server database. appreciate the responses so far.

  • Need help in migration from Layer2 to layer3

    HI Guys
    Need u r help in migration from layer2 switched network to layer3.
    here is the setup there are 9 sites connected with a 10gig backbone in a ring.each site has a 6513 but at the data centre site we having two 6513.we are having a combination of voice and data vlans.at present all the sites are connected with layer2 trunks.all the trunks are teminated at the core ie datacentre site.so how should i procedd and what are the advantages of it ie migration.
    Thanks
    Mahmood

    For this migration you first need to assign IP addresses to your connections between switches. This could be /30 (or /31, if supported) subnets. You should also consider running some dynamic routing protocol such as OSPF between switches.
    Hope this helps.

  • Premiere Pro CS5: please help problem with importing a file error output "there was an error decompressing audio or video"

    please help problem with importing a file error output "there was an error decompressing audio or video"

    this is related to what adobe program/version?

  • Problems migrating from edir 8.7.3 to 8.8

    Hi,
    I need to do a hardware replace for a Netware 6.5 sp 8 server. This
    server has edir 8.7.3.10. I loaded a new Proliant server with NW6.5 sp
    8 to migrate to. The new server has edir 8.8 on it. The Migration
    Wizzard guide says there can be problems migrating from NW6.5 from an
    edir 8.7 to 8.8.
    I tried to install the new server using the [INST: spedir] option
    specifie in this article
    (http://www.novell.com/communities/no...edirectory-873)
    but the server keeps crashing.
    Can I mirgate my old server edir 8.7.3 to the new one 8.8 using the
    Migration Wizzard? If not is there any other way to force an install
    of edir 8.7.3?
    thanks

    You could upgrade your eDir on the "original" server to 8.8
    I've done that before without any problems.
    (obviously this doesn't guarantee it will go right/well). Always have a complete backup of the .dib set (I use the dsrepair -rc on NetWare) as well as a "snapshot" of teh NetWare server if possible (ours is on the SAN, so I can clone the system disk before I do anything to it).

  • BO v5.1 - creating a report from an oracle stored procedure

    Post Author: newrochelle
    CA Forum: Publishing
    hi to all,
    im using BO 5.1 and i need to create a document from an oracle stored procedure that have only one IN parameter and ten OUT parameters.
    Creating the new report I selected the database connection then I choose the stored procedure name from the list, I inserted the value for the IN parameter and finally I click on Run button.
    I got the following error message:
    ORA-06550: line 1, column 38: :PLS-00103: Encountered the symbol
    "," when expecting one of the following: : : ( - + case mod
    new not null others <an identifier> : <a double-quoted
    delimited-identifier> <a bind variable> avg : count current
    exists max min prior sql stddev sum variance : execute forall
    merge time timestamp interval date : <a string literal with
    character set specification> : <a number> <a single-quoted SQL
    string> pipe : <an alternatively-quoted string literal with
    character set specification> : <an alternatively-q :-6550
    it seems to be caused by the OUT parameters!
    i leaved them without any value.
    it's the first time that I used a stored procedure to create a BO report, but I think the OUT parameters are needed to do that, otherwise what data will be presented in the report???
    can you help me?
    please answear me ASAP.
    Thank's in advance
    Regards
    Andrea

    Post Author: synapsevampire
    CA Forum: Publishing
    Try posting in a BO forum, this is Crystal Reports.
    -k

  • Creating a table/view or temporary table from within a stored procedure

    Hi Gurus,
    Can someone tell me if it is possible to create a table (or view) from within a stored procedure.
    PROBLEM:
    In fact I need to create a report at back end (without using oracle developer forms or reports). This report requires creating several tables to hold temporary report data. If I create a sql*plus script for this, i works fine, because it can run DDL and other sql or pl/sql statements sequencialy. But this sql*plus script cannot be called from application. So, application needs an stored procedure to do this task and then application call that procedure. But within stored procedure, i am unable to create table (or run any ddl statement). Can somebody help me in this?
    Thanks in Advance.

    Denis,
    The problem with Nicholas' suggestion isrelated to the fact that now you have two components
    (a table and a stored procedure)
    I don't see any problem to have "two
    components" here. After all, what about all others
    tabes ? This is only one more, but I don't understand
    why want manage less objects, that implies more code,
    more maintenance, and more difficulties to debug.
    Needless to say about performance...
    Nicolas.The same reasons apply if you were forced to declare all PL/SQL variables publicly (outside the stored proc.) rather than privately (from inside the stored proc). Naming conflicts for one. If the name that you want to use for the GTT already exists, you need to find a new name. With the SQL Server type local/private declarations, you wouldn't have that problem.
    I can see how performance would be the same or better using GTTs. If the number of records involved is low, this is likely negligable.

  • Creation of DB Adaptert for calling stored procedure in MS SQL server

    Hi,
    I need to create a DB adapter to call a stored procedure in MS SQL Server.
    I have gone thru the thread MS SQL Server database connection
    It mentions that we need to use a command line utility for generating the wsdl and xsd for calling stored procedures in MS SQL server. Please provide information where to find this utility and how to use it.
    Any links to tutorials are welcome.
    Thanks !!.
    Silas.

    Command line is required for stored procedures, if you are using the basic options you don't need to worry.
    (1) Download MS SQL Server 2005 JDBC Driver from Microsoft Site. http://msdn.microsoft.com/en-us/data/aa937724.aspx
    (2) The download is self extracting exe file. Extract this into Program Files on your machine. It should create folder as "Microsoft SQL Server 2005 JDBC Driver"
    (3) In above mentioned folder search for sqljdbc.jar copy this file into JDeveloper\JDBC\lib folder.
    (4) Open JDeveloper/jdev/bin/jdev.conf file add following entry.
    AddJavaLibPath C:/Program files/Microsoft SQL Server 2000 Driver for JDBC/lib
    While executing this step make sure that your JDeveloper is closed.
    (5) On command prompt go to J Developer folder and execute following command
    jdev -verbose
    This will open JDeveloper.
    (6) Now go to JDeveloper > Connections > Database Connections > New Database Connection
    (7) Select Third Party JDBC
    (8) Specify MS Sql Server User Name, password and Role.
    (9) In connection page specify following
    - Driver Class: com.microsoft.sqlserver.jdbc.SQLServerDriver
    - For class path browse to C:/Program files/Microsoft SQL Server 2000 Driver for JDBC/lib folder, select sqljdbc.jar add it as library.
    - Specify URL as following.
    jdbc:sqlserver://SERVERNAME:1433;databaseName=MSSQLDBNAME;
    (10) Go to Test page and test it.
    cheers
    James

Maybe you are looking for

  • PO is deleted after GR and Invoice done, but not reverting GR IR values

    Hi, Whenever PO line item is deleted with deletion indicator value L, I can see 2 extra entries for Process key 001, with negative Qty and amount values. But for process key 002 (GR) and 003 (IR) values are not getting reverted. So in BW I am getting

  • Office 2010 - "Word cannot print, there is no printer installed"

    Hi All, Been having a problem recently on many PC's at a site where they run Windows 7 x64 with Office 2010 x86. Printing usually happens with no issue, however sometimes when they click the print icon, (in the 'file-->print' section) it will display

  • Accessing a variable in mxml file from an action script file

    Hi,     I think this is a very very dumb question but i am nto being able to gigure this out i am a total newbie to flex.      i have a mxml file e.g. aaa.mxml which has the following declaration      ........ //some lines of code      <mx:XMLListCol

  • ADF Faces OutputText text-align

    I´m working in an ADF Faces Application, a column in a table is showed using an outputText but the customer wants its value is showed right align. I've tried the propertie inlineStyle="text-align:right;" in the outputText but it's not working correct

  • SAP Archiving - Migrating from one archive backend to another.

    Hi, We use SARA for archiving and the archiving system is IBM Provided Filenet Database with ACSAP middle-ware. From 1999 till 2009 we have archived terabytes of data into Filenet Database. We plan to discontinue Filenet as our choice of archiving ba