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
Similar Messages
-
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 youhi,
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 -
How to migrate MS SQL Server OLAP data to Oracle 10g OLAP
Hi,
Anyone has any idea on whether migration workbench can migrate my MS SQL Server OLAP data to Oracle 10g (with OLAP option) ?
Best Regards,
Ian HoIan,
What exactly do you mean by SQL*Server OLAP ? Is it just a 'normal' SQL*Server database which is used for an OLAP application ?
The migration workbench migrates schema objects, triggers, and stored procedures and is not concerned with the application that uses those objects.
And the same with the Oracle OLAP database. Once the data etc has been moved into the database you can then use it for whichever application you want.
If you have concerns apart from moving the actual data then please give us more details.
Regards,
Mike -
Extract the data from SQL Server and Import into Oracle
Hi,
I would like to run a daily job that will export the table data from SQL server table (it will be only one or two table) and Import back into Oracle table (it might one or two table tables).
Could you please guide me that how can i do this using either sql server or oracle?
We have oracle 9.2 and sql server 2005.
Normally i do from flat file which is generated by source destination nand i dump into oracle using sql*loader but this time I have to directly extract/export the data from MS Sql server and load into Oracle table, mostly it will reload so i might doing any massaging data during the load.
If you show me the detail approach, it will be really appreciated.
I have access to Sql server but i don't how to use sql server to do this or using oracle as a daily job even becuase have to schedule the job for this as it will be a daily job.
Thanks,
poratipsUnless you can find an open source ODBC driver for SQL Server that runs on Solaris (and I wouldn't be overly hopeful there) Heterogeneous Services would require that you license something-- a third party ODBC driver, a new Oracle instance, or an Oracle Transparent Gateway.
As I stated below, you could certainly use SQL Server's ETL tool, DTS. Oracle's ETL tools would require additional licensing since you're just on 9.2. You could also write a small application (Java or otherwise) that connected to both databases and transferred the data. If you're particularly enterprising, you could load the SQL Server Type 4 JDBC driver into Oracle's JVM and write a Java stored procedure that connected to the SQL Server database via JDBC, but that's a pretty convoluted approach.
Justin -
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 LHi 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,
-JohnI 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 -
How to Deploy SSRS Reports(Sql Server 2008 R2) into Oracle Weblogic Application Server
Hi Friends
One of my project requirement is Developing reports by using SSRS and deploying the reports into Oracle Wblogic Server
Could you please give me a Steps where we need to configure.
Regards
Hasthi.Hi Hasthi,
As per my understanding, I think we couldn’t directly deploy the SSRS report to Oracle Weblogic Application Server. We can deploy report to report server and SharePoint library. And we can display report to some applications, for example, windows application
and web application. Sorry for that I am not familiar with Oracle. So if your Oracle Weblogic Application Server support those Visual Studio application, then we can use report viewer control to display report in application. For more detail information about
report viewer control, please refer to the following document:
http://msdn.microsoft.com/en-us/library/ms251671.aspx
Hope this helps.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
SQL Server Date Conversion to Oracle Date
I am new to ODI and am trying to figured out how to move a SQL Server date datatype value to an Oracle date.
Thanks in advance.SQLServer datetime datatype is moved to an Oracle TIMESTAMP datatype via the technology's data type mapping. That particular LKM 'SQL to SQL' is written in java so reads from SQLServer into java datatypes then writes back out to Oracle.
Cheers
David -
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.
HelenHi you might want to post your question in General Forum.
General Database Discussions
There's very few users visit this forum. -
Problems displaying images stored in SQL Server as Datatype "image"
I am trying to display an Image stored in SQL Server as
datatype
'image' and it only shows a portion of the image.
It seems to be tied to the size (kb) of the image since the
larger the
image the less of it is shown before it cuts off(sometimes it
cuts off
mid line so it's about the file size and not fitting the
image on the
screen).
Here is the code I am using that deals with the image.
[Bindable]
public var theImage:ByteArray = new ByteArray;
private function getScans_result(event:ResultEvent):void{
var imageByteArray:ByteArray = event.result[0].Image;
theImage = imageByteArray
<mx:Image id="theIMG" width="160" height="220"
source="{theImage}"/>
Any Thoughts??I do that sort of thing using PHP and mySQL the binary part
of the image is stored in a BLOB field (Binary Large OBject) along
the rest of the information necessary for the http headers (e.g.
mime type, file name, file size) being staored in their own fields.
That info is then used to build the file using PHP. The PHP
file contains a mySQL query whos result is echoed with the
appropriate headers. The URL points at the PHP file rather than at
any saved image.
Here's the php:
<?
# display_imagebank_file.php
# Note: the ID is passed through the url e.g.
# this_files_name.php?id=1
# connect to mysql database
mysql_connect('HOST', 'USERNAME', 'PASSWORD');
mysql_select_db('DATABASE');
# run a query to get the file information
$query = mysql_query("SELECT FileName, MimeType, FileSize,
FileContents FROM blobTable WHERE ID='$id'");
# perform an error check
if(mysql_num_rows($query)==1){
$fileName = mysql_result($query,0,0);
$fileType = mysql_result($query,0,1);
$fileSize = mysql_result($query,0,2);
$fileContents = mysql_result($query,0,3);
header("Content-type: $fileType");
header("Content-length: $fileSize");
header("Content-Disposition: inline; filename=$fileName");
header("Content-Description: from imagebank");
header("Connection: close");
echo $fileContents;
}else{
$numRows = mysql_num_rows($query);
echo "File not found <br>";
echo $numRows;
echo " is the number of rows returned for id = ";
echo $ID;
?>
Hope that helps
Phil -
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 -
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 find out sql server administrator account in sql server 2008 R2
how to find out sql server administrator account in sql server 2008 R2
adilthere is any way to find out actual administrator
because i forget that user i used to logon to server and installed sqlserver
adil
Hi adilahmed,
According to your description, you forgot the account which was used to install SQL Server. SQL Server service account information is stored in Windows Registry database. You can get this information from Services Console or SQL Server Configuration.
For example, to get account information from Services Console.
1. Go to Start > Run > Services.msc
2. Right Click on SQL Server Service, i.e. “SQL Server (InstanceName)” and go to properties
3. The account information is available under Log On tab.
Or you can get the information by using DMV and so on.
SELECT servicename, service_account FROM sys.dm_server_servicesGO
If you now log in SQL Server by using sysadmin account, you can check all login names in security and find the original account to login.
Thanks,
Sofiya Li
Sofiya Li
TechNet Community Support -
How to connect the SQL Server?
1.How can I communicate between SQL Server and Discorverer41 via Oracle Gateway?
2.Does the Discoverer41 connect SQL Server without Oracle Gateway?
Thanks for help!
K.Lunga) You can connect via ODBC-Database Link.
b) You can create an EUL direct on SQL Server.
regards Holger Reinbold -
How to connect MS-sql server with SAP BW
hi all,
i want the connection procedure to how to connect MS-sql server with SAP BW.so that i can extract the data from ms sql server and can create cubes using that data.please help me in this issue.Hi Vamshi,
Go through this DOC it explains u how to connect to other data bases like SQL...
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/58f4db47-0501-0010-a2bf-ff01b150fdff]
this is a thread related to connect the SQL server..
[DB Connect MS SQL Server;
Regards,
NR
Assign points if helpful...
Maybe you are looking for
-
Hi, I have HTML-element in XML doc, but i do not know how to get it out as HTML-element in PHP or in HTML. I have this kind of XML tag <logo><![CDATA[><a href="http://www.someadress.com"><img src="images/logos/companylogo.jpg" alt="Some Company"/></a
-
Multiple records in Header Iface with same orig_sys_document_ref
Hi, I am creating an Internal Requisitions for multiple Destinations (Ship To Orgs). Requisition is getting approved and after running Create Internal Order program, orders are populating in OE_HEADERS_IFACE_ALL and OE_LINES_IFACE_ALL. But the proble
-
Oracle Management Server Service not created
Hello, I created a Management Server Repository using OEMCA and an existing SID. According to the details displayed at the end of the wizard I assume that the process was finished successfully: (NT-Service OracleOraHome81 ManagementServer is started.
-
My java process crashed with this error
has anyone experience your java process crashed with a core dump ? I am running Solaris 8 and J2SDK _1_4_2 TIA Unexpected Signal : 10 occurred at PC=0xFE3756C4 Function=[Unknown. Nearest: JNI_CreateJavaVM+0x8E608] Library=/usr/j2se/jre/lib/sparc/serv
-
Hi everyone new poster. I use wifi or wifi -with- fon quite a bit on my ipad because I only have 10gb usage allowance . I am thinking about buying a Apple TV and streaming my ipad with air play to my tv. does anyone know if this is possible usin