Converting OLE Object in Sql Server to Oracle

SQL Server contains datatype OLE Object. This is basically an array of binary floating point data where each value of the array is 4 byte long. How can I store these values in Oracle database.
null

You cannot specify the precision/scale or length of input paramters to a stored procedure in Oracle, or at least the pl/sql engine does not respect the sizing. Assuming that you want to do something with variable1 in the procedure, and not just return it, the Oracle equivalent would be something along the lines of:
SQL> CREATE FUNCTION f (p_param1 IN VARCHAR2,
  2                     p_param2 IN NUMBER,
  3                     p_param3 IN NUMBER) RETURN NUMBER IS
  4     l_var1 NUMBER(20) := SUBSTR(p_param1, p_param2, p_param3);
  5  BEGIN
  6     RETURN l_var1 * 10;
  7  END;
  8  /
Function created.
SQL> SELECT f('ABC10DEF', 4, 2) FROM dual;
F('ABC10DEF',4,2)
              100You may need to adjust the return type to match what you are actually returning.
You can also use this iin a direct assignment in pl/sql without doig a select, something like:
SQL> DECLARE
  2     l_num NUMBER(20);
  3  BEGIN
  4     l_num := f('ABC10DEF', 4, 2);
  5     DBMS_OUTPUT.Put_Line('The number is: '||l_num);
  6  END;
  7  /
The number is: 100John

Similar Messages

  • Convert substring function from SQL Server to Oracle

    I am converting a large application written for SQL Server to Oracle and have encountered a difference in how the substring function is called between the two database systems.
    In SQL Server:
    select substring('xyz'1,2)
    In Oracle:
    select substr('xyz',1,2)
    Is there a way to establish a user-defined operator to map the substring call to a substr call so I don't have to change the application code?
    Is the user-defined function a way to do this?
    Which is better?

    If you want to be able to use the code that has substring in it, without modifying it, and have it do the same thing as substr, then try running the script below. It will create a user-defined function named substring that will cause substring to act like substr.
    CREATE OR REPLACE FUNCTION substring
    (p_string IN VARCHAR2,
    p_start IN VARCHAR2,
    p_end IN VARCHAR2 DEFAULT NULL)
    RETURN VARCHAR2
    IS
    v_string VARCHAR2 (100);
    BEGIN
    IF p_end IS NULL
    THEN
    SELECT SUBSTR (p_string, p_start)
    INTO v_string
    FROM DUAL;
    ELSE
    SELECT SUBSTR (p_string, p_start, p_end)
    INTO v_string
    FROM DUAL;
    END IF;
    RETURN v_string;
    END substring;
    null

  • Converter program for MS SQL Server to Oracle

    My problem with converting MS SQL Server queries in a SQL Pass-thru is becoming critical at my job.
    I am hoping there is an easy converter tool that will let a user take SQL Server statements and feed them into a converter that outputs Oracle SQL.
    Does such a program conversion tool exist?
    I bet not, right?

    Your bet is right as SQL-Server's SQL implementation is not the same as Oracle's SQL implementation. There are numerous differences. Translating one to the other is not a 1:1 keyword swap.
    And when these SQL statements involve locking and concurrency, there are also significant differences in core database functionality between SQL-Server and Oracle.
    What exactly is the problem you are facing? SQL-Passthru is specifically designed as a SQL interface that does not touch and change (and muck up) a SQL being passed to a remote database - so the actual raw SQL text being send is what arrives at the server end. Allowing you to, for example, use Oracle's SQL dialect inside SQL-Server to talk to a remote Oracle database - without SQL-Server throwing errors about Oracle dialect being used. Oracle has a similar passthru option.
    Why is this not working? Or is the issue something else?

  • TRANSFER DATA FROM MS-SQL SERVER TO ORACLE

    hello everybody
    can anyone tell me how 2 transfer or convert data from ms-sql server to oracle
    is there any utility
    if yes let me know .
    thanks in advance

    There are various options depending on how much data we're talking about, where you want the program logic, whether it's a one-time migration, etc.
    Among the options
    - Use SQL Server's DTS
    - BCP the data from SQL Server into flat files and use SQL*Loader to load it
    - Create a database link using Heterogeneous Services and Generic Connectivity to extract data from SQL Server
    - Use the Oracle Migration Workbench, which is now integrated into SQL Developer
    - Use an ETL tool like Oracle Warehouse Builder
    Justin

  • CONVERT function in SQL Server to oracle

    All,
    How to convert CONVERT function in SQL Server to oracle, below mentioned format is in SQL Server:
    variable1 = convert(numeric(20), SUBSTRING( parameter1,parameter2,parameter3)
    parameter1 datatype nvarchar2(100)
    parameter2 datatype bigint
    parameter3 datatype bigint
    I did bit R&D, but was not successful..but still getting on..
    If any help that would be great...
    Regards,
    ~ORA

    You cannot specify the precision/scale or length of input paramters to a stored procedure in Oracle, or at least the pl/sql engine does not respect the sizing. Assuming that you want to do something with variable1 in the procedure, and not just return it, the Oracle equivalent would be something along the lines of:
    SQL> CREATE FUNCTION f (p_param1 IN VARCHAR2,
      2                     p_param2 IN NUMBER,
      3                     p_param3 IN NUMBER) RETURN NUMBER IS
      4     l_var1 NUMBER(20) := SUBSTR(p_param1, p_param2, p_param3);
      5  BEGIN
      6     RETURN l_var1 * 10;
      7  END;
      8  /
    Function created.
    SQL> SELECT f('ABC10DEF', 4, 2) FROM dual;
    F('ABC10DEF',4,2)
                  100You may need to adjust the return type to match what you are actually returning.
    You can also use this iin a direct assignment in pl/sql without doig a select, something like:
    SQL> DECLARE
      2     l_num NUMBER(20);
      3  BEGIN
      4     l_num := f('ABC10DEF', 4, 2);
      5     DBMS_OUTPUT.Put_Line('The number is: '||l_num);
      6  END;
      7  /
    The number is: 100John

  • Access Oracle from SQL Server using Oracle Provider for OLE DB

    Using
    - SQL Server 2000 SP4
    - Oracle 10g
    - Oracle10g Provider for OLE DB Version 10.1.0.4.0
    - Oracle 10g client
    Able to create linked server in SQL server to Oracle 10g and display list of tables in Oracle. However, when execute query, it gives
    Server: Msg 7320, Level 16, State 2, Line 1
    Could not execute query against OLE DB provider 'OraOLEDB.Oracle'.
    OLE DB error trace [OLE/DB Provider 'OraOLEDB.Oracle' ICommandText::Execute returned 0x80040155].
    Any idea what is the problem ?

    I'm having the same error message...But I'm connecting to a Oracle 8i DB......
    I think this has to do with SP4 for SQL....I will test this tonight....

  • SQL Server to Oracle Converted Model missing users

    I am doing a migration from SQL Server to Oracle with about 100 users. The captured model seems to be correct and all of the users are there. But, when creating the Oracle Converted Model, not all of the users are being converted. On the first attempt, the Converted Model had only 21 users, and on the next attempt, the Converted Model only had 16 users. Does anyone know what could be causing this?

    Oracle Database XE does not allow more than one instance per server.
    To define a primary key correct syntax is:
    Create table summary(
    Field NOT NULL PRIMARY KEY,
    Or:
    PRIMARY KEY constraint tabla_PK (field)
    To generate the value of the primary key you must create a sequence before or after creating the table:
    Create Sequence summary_seq
    Start with 1
    Increment by 1
    Nocycle;
    You can use the sequence in INSERT INTO or through a trigger:
    With Insert Into:
    Insert into Summary
    Values (summary_seq.nextval, valkor1, value2 ,...);
    With a trigger:
    Create or replace Trigger BI_summary
    Before Insert on SUMMARY
    For each row
    Begin
    Select summary_seq.nextval into campoPK
    From dual;
    End;

  • Convert BW from Sql Server to Oracle

    Does anyone know of any documents that discuss converting an existing BW implementation from Sql Server to Oracle?

    Never heard about ... we did something similar but creating a "new" BW sys by Change Requests, and the populating it with data.
    Hope it helps
    GFV

  • Convert Joins from SQL Server to Oracle

    I am converting a client application's back end from using SQL Server to Oracle. This application provides a GUI that allows people to capture one or more areas of text in a text file and create database tables from these areas. It allows them to perform joins between the tables, etc. I have to convert the area that programatically creates queries behind the scenes to do these joins. Having not done much work with Oracle joins, I'm wondering if someone could show me how I could convert the sample join provided. I can probably handle the rest from there.
    SQL Server Query:
    SELECT
    [T1].[Tk] AS [Tk],
    [T1].[Tk Title] AS [Tk Title],
    [T2].[Rate] AS [Rate],
    [T1].[TotCurHrs] AS [TotCurHrs],
    [T1].[TotCurAmt] AS [TotCurAmt],
    [T1].[TotCaseHrs] AS [TotCaseHrs],
    [T1].[TotCaseAmt] AS [TotCaseAmt],
    [T3].[SortF] AS [SortF]
    FROM
    [T1] FULL JOIN [T2] ON [T1].[Tk] = [T2].[TKName]
    INNER JOIN [T3] ON [T1].[Tk Title] = [T3].[EliteTitle]
    )

    Do as previous colleagues suggested, although you may get the problem with column names. I see at leats one of them has space in it [Tk Title]. So the question is - how you migrated table structure to Oracle? Do the column names are ABSOLUTELY the same as in MS? Then you have to replace brackets with double quotes ", because normally Oracle all identifiers tries to convert to uppercase and also space is not allowed. Only if you use quotes this is possible.
    Gints Plivna
    http://www.gplivna.eu
    Edited by: gintsp on Oct 13, 2010 4:04 PM

  • Converting SQL SERVER  to Oracle

    Hey everyone,
    I have one thesis about database. I have a plan to making a program to convert database with sql server to Oracle Database. Anyone have made some programs that similar with mine ?? Anyone can give me some informations? Can you tell me about the concept??
    Thanks everyone....

    aDiny wrote:
    can you tell me the concept and example programs that able to do this job like that?
    1. Define data in source
    2. Define destination.
    3. Read data from source (based on 1)
    4. Map date to destination (based on 1 and 2)
    5. Write data to destination (based on 2)

  • SQL Server to Oracle migration with SQL Server DTS

    I migrate database from SQL Server to Oracle with SQL Server DTS. the process is success. I can select table_name from user_tables or user_objects. I also can see the table from DBA Studio. But When I use desc to list the structure of table in SQLPLUS. it tell me object don't exist.
    What is wrong?
    Thanks

    use sp_help <tablename>

  • Migration from SQL server to Oracle

    Hi,
    Has anybody done migration from the SQL server to Oracle? If so, what manual method do you recommend? I'm a new college grad and I would like to get your expertise, if you have done this in the past.
    Thanks in advance!
    Sho

    It is some time back, so I do not remember the specifics. Oracle gives Oracle Migration Workbench for free. You can use it to convert all SQL tables and procedures etc to oracle. It is not that difficult. If there are no stored procedures etc, you can just extract the DDL and create the tables with minor changes to the script. You might need bcp-sqlloader/trasparent gateway etc copy the data.
    Giby

  • 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

  • How to extract incremental data from SQL server to oracle tables in ODI

    HI All,
    In my ODI sql server is install.My Source is in SQL server and my target is in Oracle.
    I need to create a interface mapping where i need to extract incremental data from sql server to oracle.
    There is a datetime(with Timestamp) field in sql server .I need to pull incremental data based on dateime.
    Example = tablename.DateTime > (select '1-jan-11' from dual) .....i am using this query but its not woking.the error is Invalid object name"dual".
    We are not going to use Incremental in IKM and LKM.
    Request you to please provide any suggestion ASAP.
    Thanks,
    Lony

    You can do that via Variable.
    In the interface mapping create a filter on Tablename.DateTime
    and put the condition like this
    Tablename.DateTime BETWEEN #VAR and in the variable use this query in refreshing tab with oracle schema
    SELECT max(start_time)||' AND '||max(END_TIME)+1 from audit_table where ETL_JOB_CODE = '20'In the package call the above variable in refresh mode and then interface.
    This way you will pass from the query between and condition date and pass to interface so that SQL Server fetches the data between those too range.
    Note:- You might need to tweak the date format so that SQL Server can understand.
    Hope this helps.

  • Sql server to oracle conversion

    i received the following error while converting from sql server to oracle 10g on windows and sql developer version is 1.5.1
    --oracle.dbtools.migration.workbench.core.ui.AbstractMigrationProgressRunnable.start(AbstractMigrationProgressRunnable.java:141)
    --oracle.dbtools.metadata.persistence.PersistenceException: ORA-06550: line 1, column 13: PLS-00306: wrong number or types of arguments in call to 'GATHERCONNECTIONSTATS' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
    can anyone help me

    Hi <Please supply name>,
    SQL Developer 1.5.1 is very old (> 3 years old). Lots of improvements have been made since then.
    You can download SQL Developer 3.1 (EA 1) here
    http://www.oracle.com/technetwork/developer-tools/sql-developer/sqldev-ea-download-486950.html
    Heres a video of migrating Sybase to Oracle using SQL Developer 3.1
    Sybase and SQL Server migrations are identical.
    http://www.youtube.com/watch?v=W1QaEHpNw6Y
    Hope this helps,
    Regards,
    Dermot.
    SQL Developer Team

Maybe you are looking for

  • How do I get snow leopard to install on my MBA 1.1

    I seem to have lost my retail snow leopard disc (I have the box, but no disc inside) so I've been trying all my discs from other macs bought from that era with other versions of Snow Leopard (10.6.3, 10.6.6, 10.6.4, etc.).  None of these will install

  • "No Receiver Determined" in BPM Sync RFC Call

    My scenario is xml file -> XI BPM -> RFC1 -> RFC2 (will call RFC2 if RFC1 is successful). I am still just trying to get the RFC1 call working properly.  I have been using blogs 1822, 1403 and 1926.  I have also used some related BPM threads.  It seem

  • Accessing NFS from Java

    I have requirement to create and write files on a NFS file storage. I need to do this from a Java application running on Windows 2008 Server. How do i implement this requirement?. Is there any Java Library to achieve this?. I have read documentation

  • Please explain servlet spec portion

    Hi all, In section SRV 8.3(Include method) of Servlet specification v2.3 it is said that "It can only write information to the ServletOutputStream or Writer of the response object and commit a response by writing content past the end of the response

  • Direct X

    I can't open my Elements 9 organizer because I keep getting this: Directx could not be initialized.  Please reboot your system to activate.  I have done that about 5 times.  Nothing.  I went in to make sure that Direct X was activated under the contr