SQL Server image to BLOB

How can a SQL Server image column (exported by bcp in -c mode as a hexadecimal string) be loaded into a BLOB column with SQL*Loader?
SQL*Loader gives an error for the HEXTORAW call in the control file generated by OMW (SQL*Loader-309: No SQL string allowed as part of MYDATA field specification):
load data
infile 'MYTAB.dat' "str '<er>'"
into table MYTAB
fields terminated by '<ec>'
(MYID ,
MYDATA CHAR(2000000) "HEXTORAW (:MYDATA)")

Hello,
Have you resovled this problem?. How?.
Thanks,
Tom

Similar Messages

  • Problem: loading SQL Server 'image' data

    Source database: SQL Server 2000
    OS: Windows 2003 (SP1)
    Oracle: 10g (R2)
    Datatype Mapping: SQL Server ‘image’ to oracle ‘BLOB’
    With the help of OMWB, I created the oracle database schema for a SQL Server DB (offline capture). I have problems when I tried to populate the (destination) database with two tables with ‘image’ datatype:
    Frame.img (as on http://www.sdss.org.uk/mybestdr5/en/help/browser/description.asp?n=Frame&t=U)
    And SpecObjAll.img (as on http://www.sdss.org.uk/mybestdr5/en/help/browser/description.asp?n=SpecObjAll&t=U)
    The part of .ctl files (generated by OMWB) for the two ‘img’ columns is like this:
    IMG CHAR(2000000) "HEXTORAW (:IMG)")
    I failed to load the data with the sql_load_script.sh script, and the log file is like this:
    IMG NEXT ***** CHARACTER
    Maximum field length is 2000000
    Terminator string : '<ec>'
    SQL string for column : "HEXTORAW (:IMG)"
    SQL*Loader-309: No SQL string allowed as part of IMG field specification
    I tried to removed ‘CHAR(2000000)’ in the .ctl files:
    IMG "HEXTORAW (:IMG)")
    But this doesn’t work and the log file is like this:
    IMG NEXT * CHARACTER
    Terminator string : '<ec>'
    SQL string for column : "HEXTORAW (:IMG)"
    SQL*Loader-309: No SQL string allowed as part of IMG field specification
    Any help would be extremely appreciated.
    Helen

    Hi you might want to post your question in General Forum.
    General Database Discussions
    There's very few users visit this forum.

  • How to migrate SQL Server image data type to Oracle 8 BLOB data type?

    Hi,
    I have to migrate data from sql server to Oracle 10 g.
    I am unable to migrate image data type from sql server to blob data type in oracle.
    Iam using Oracle Heterogenous Services to migrate the data,Using Merge statement and database link.
    I am getting the following error-
    ERROR at line 7:
    ORA-00932: inconsistent datatypes: expected BLOB got LONG BINARY
    Can any one suggest me how to migrate Image datatype to BLOB???

    Hi you might want to post your question in General Forum.
    General Database Discussions
    There's very few users visit this forum.

  • SQL Server image column to Oracle BLOB

    Has anyone ever successful moved SQL Server (2000) image data to an Oracle BLOB.
    My first attempts are given me
    java.lang.NumberFormatException: For input string: "4294967295"
    errors when selecting from the source. Using "LKM SQL to Oracle" module. Is there something else I should be using?
    Thanks,
    -John

    I did, and also Bug 6870772... which suggests it's a bug not fixed in 10.1.3.5.
    Still curious if ANYONE in forum-land is doing this successfully, with built-in KMs.
    Am I out of luck?
    -John

  • Sending image from MS SQL SERVER to Oracle BLOB

    Hey all, we're trying update Oracle via a SQL Server linked server and we're having an issue with a blob column. The update from SQL is:
    UPDATE Banner..GENERAL.PS_EBI_IF_TBL
    set photo = a.blob_file, photo_change_date=a.blob_date
    from PWNT.dbo.BLOBS a, PWNT.dbo.BADGE_V b
    where a.ID = b.ID
    and base_name = b.BADGE_BASE_NAME
    and b.BADGE_blob_date > getdate()-.021
    GO
    The error we get is:
    OLE DB provider "OraOLEDB.Oracle" for linked server "Banner" returned message "ORA-01747: invalid user.table.column, table.column, or column specification".
    The syntax is correct, we can run it if the column being updated (photo) is not a blob, so we believe there is something else we have to do because of the blob. Has anybody done anything like this and know how it works? Thanks!
    Tom

    Given that there are no version numbers is your post I can imagine many possibilities for misconfiguration. Especially as an Oracle BLOB bears no direct size relationship to anything MS SQL could possibly support.

  • How to migrate sql server image type to oracle BLOB

    In SQL Server table I have Image data type field. How to migrate image type field to oracle BOLB type field. I am using SQL server DTS to transfer the data.
    If we map, will it care ?
    Thanks,
    Venkataraman L

    Hi you might want to post your question in General Forum.
    General Database Discussions
    There's very few users visit this forum.

  • SQL Server Image to Oracle

    I'm converting SQL Server Tables to Oracle using MWB 9.2. The tables contain images (data type "image"). I get the following error from the MWB generated scripts:
    SQL*Loader-309: No SQL string allowed as part of DISPLAY_IMAGE field specification
    The column definition in the .ctl file is:
    DISPLAY_IMAGE NEXT ***** CHARACTER
    Maximum field length is 2000000
    Terminator string : '<ec>'
    SQL string for column : "HEXTORAW (:DISPLAY_IMAGE)"

    Kelly,
    The OMWB only supports inline data transfer of image types to LONG RAW via SQL*Loader.
    You should be ablr to use TO_LOB() to convert the LONG to LOB.
    The error you have is what you get when you try yo migrate to BLOB. TO use SQL*Loader
    with BLOB you would need to have unload each image into a seperate file and the OMWB
    doen't help you do this. bcp dumps the image data in hex (hence the HEXTORAW sql function),
    I don't know how bcp would dump this as binary.
    Jim.

  • Sql server bulk insert blob filename parameter

    My problem SQL script:
    declare @filepath varchar(100)
    set @filepath = 'E:\foto\1.jpg'
    INSERT INTO [dbo].[MsQuestions] ([TestCategoryID], [LevelID], [TestTypeID], [QuestionText], [QuestionImg])
    select  1 , 1, 8, 'data gambar',BulkColumn FROM OPENROWSET(BULK   @filepath , SINGLE_BLOB)
    thanks.
    <%@ Page Language="C#" %>
    <%@ Import Namespace="System.Data" %>
    <%@ Import Namespace="System.Data.SqlClient" %>
    <%
    string sConn = @"server=.; database=OnlineTesting; Integrated Security=True";
    SqlConnection objConn = new SqlConnection(sConn);
    objConn.Open();
    string sTSQL = "exec sp_filenamea";
    SqlCommand objCmd = new SqlCommand(sTSQL, objConn);
    objCmd.CommandType = CommandType.Text;
    SqlDataReader dr = objCmd.ExecuteReader();
    dr.Read();
    Response.BinaryWrite((byte[])dr["QuestionImg"]);
    objConn.Close();
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
    <title>Exec SP</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    </div>
    </form>
    </body>
    </html>

    Perhaps this 
    http://dimantdatabasesolutions.blogspot.co.il/2009/05/how-to-uploadmodify-more-than-one-blob.html
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Migration Workbench is messing up data in converted from SQL Server image fields.

    I am working on porting a SQL Server 7 database to Oracle 8i (8.1.6 release 2). In the SQL Server database I have several tables that contain image fields that hold binary data (like Word documents, and other files). When I port the database to Oracle, the data in these fields gets garbled (the resultant records contain the correct amount of data (bytes), yet the data is different). Data in image fields that contain text oriented data ports correctly (i.e. if you just saved a long string in the field). Has anyone else posted a similar problem? Is there a workaround here to get the data stored in these image fields to port correctly?

    The thing is DDL of SQL Server and Oracle are quite different, without the help of MW from SQL Developer. You can't convert SQL server version of DDL to Oracle version. Of course you can accomplish the same thing using other tools like ERwin and Visio. Since SQL Developer is free why bother?

  • How to load a SQL Server Image datatype into Oracle

    I am trying to use the follwing procedure to transfer image datatypes from SQL Server into Oracle:
    DECLARE
       v_update_string   VARCHAR2 (200)
          := 'select face from multiMax.dbo.CardHolderFaceTable where cardid = 246979';
       v_result          VARCHAR2 (32767)          := NULL;
       CURSOR sql_server_conn
       IS
          SELECT connection_name, user_name,
                 securedata_pkg.decrypt_char (PASSWORD) PASSWORD
            FROM xxper.xxper_sql_server;
       s_rec             sql_server_conn%ROWTYPE;
    BEGIN
       OPEN sql_server_conn;
       FETCH sql_server_conn
        INTO s_rec;
       CLOSE sql_server_conn;
       v_result :=
          xxper_sql_server_utils.runsqlserverquery (s_rec.connection_name,
                                                    s_rec.user_name,
                                                    s_rec.PASSWORD,
                                                    v_update_string
       DBMS_OUTPUT.put_line (v_result);
       INSERT INTO scott_blob
            VALUES (v_result);
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.put_line (SQLERRM);
    END;This gives me 'ORA-06502: PL/SQL: numeric or value error: host bind array too small'
    I can change to another column on the SQL Server side and transfer fine, just not with Image datatypes.
    Not sure why this is happening, does anyone have any advice? Sorry, can't seem to post with my formatting intact.
    Edited by: user7726970 on Jun 8, 2009 4:53 PM
    Update, removing the 'DBMS_OUTPUT.put_line (v_result);' takes care of that error but no data is transferred. Confused.
    Edited by: user7726970 on Jun 8, 2009 5:14 PM

    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

  • Convert MS SQL server image data type into oracle clob

    Hi all! I'm tryng to access to Microsoft SQL server with Oracle via ODBC. Oracle is not able to use the image data type of Microsoft SQL server. Do you know a way to convert this data type in an oracle format? The explicit casting converts image to long raw, but after the conversion Oracle is not able to manage these data type. Thank you very much!
    Stefano.

    Hi you might want to post your question in General Forum.
    General Database Discussions
    There's very few users visit this forum.

  • Hex string upload as blob data to sql server

    It need to open a file and read the content and upload to sql server(2005) as blob data.
    But it seems give error as the attached screen.
    So I tried to convert the file content string to hex string, but it take quite long time.
    Is there any way to shorten the time or any other ways.
    Any suggestion, thanks.
    Attachments:
    ss.png ‏73 KB

    Try this.

  • Insert into blob(image) sql server 2000

    hello
    i want enter one image for example fish.jpg into blob into
    sql server 2000 plz help me...

    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/LOBSample.zip
    this contains samples for using blob with oracle. use the idea for your code.

  • Import IMAGE type from SQL Server to BLOB in Oracle

    Hello,
    Is there a way to import a IMAGE type from SQL Server to BLOB type in Oracle from one table to another through a database link?
    I'm waiting for an answer as soon as possible.
    Best regards,
    Florin
    Edited by: Florin Manole on Sep 10, 2008 11:53 AM

    Have you already configured a Heterogeneous Services and Generic Connectivity to create a database link from Oracle to SQL Server? I haven't tried copying IMAGE data from SQL Server via Heterogeous Services myself, but from the [data type map|http://download.oracle.com/docs/cd/B19306_01/server.102/b14232/apb.htm#sthref509] in the documentation, I would expect that it would work so long as the SQL Server ODBC driver maps the IMAGE data type to SQL_LONGVARBINARY
    Justin

  • Load BLOB column in Oracle to Image column in MS SQL Server

    Hi there,
    I have an Oracle table as the source and a MS SQL Server table as the target. A blob(4000) column in source is mapped with a Image(2147483647) column in target.
    The execution will give me error message "*java.lang.NumberFormatException: For input string: "4294967295"* " when it comes to step "load data into staging table"
    The LKM that I am using is LKM SQL to MSSQL.
    I also tried LKM SQL to MSSQL(BULK), LKM SQL to SQL(jython), LKM SQL to SQL. None of them is helpful.
    Coudl anyone tell me how to solve this 4294967295 problem? Thanks a lot

    Hi Yang,
    Oracle recommends the setting of the 'get_lob_precision' flag to FALSE to avoid this error.
    To do that,
    1. Take a backup of your ODIPARAM.BAT file.
    2. Open ODIPARAM.BAT file and add the following line,
    set ODI_ADDITIONAL_JAVA_OPTIONS=%ODI_ADDITIONAL_JAVA_OPTIONS% " -Doracledatabasemetadata.get_lob_precision=false"
    next to,
    set ODI_ADDITIONAL_JAVA_OPTIONS="-Djava.security.policy=server.policy"
    PS:If the parameter is set, the resulting "ODI_ADDITIONAL_JAVA_OPTIONS" ("SNP_ADDITIONAL_JAVA_OPTIONS" or "SNP_JAVA_OPTIONS") should be similar to the above.
    Restart ODI and try.
    Thanks,
    G

Maybe you are looking for

  • Working with .phtml files in dreamweaver... a how to

    hope this helps those diving into magento, zend, and other goodies, but want the comfort of dreamweaver.  would be nice if it came this way, but it's an easy add for dreamweaver. By default, Dreamweaver cannot read PHTML files. You can add the file t

  • Is there a way to see all your new mail from multiple accounts on one page?

    I'm currently receiving emails from four different accounts on my iPhone. I love getting all my emails like this, but it would be even nicer if I didn't have to navigate between all the different accounts.

  • Create a folder with other user id

    Hi Experts, I dont have permissons to create unix directory. Can any one tell me how to write a prog to create a folder on UNIX directory WITH ANOTHER USERS ID each & everytime my prog executes as i dont have sufficient aunthrization. Thanks Dan

  • Reputation Sync

    Hello Forum users, We have been working on a project to sync Forum reputation with Community reputation. I will break down what this project entails. Single Sign On What is changing? When this goes live, you will be able to log into the Forums, navig

  • Share audio with screenshare AND keep the micropho...

    Hello, I need to use Skype for the following: I teach music production courses over Skype and I need to be able to share sound between our programs via screenshare. Yet I also need my microphone to work for communication.  I have found audio sharing