To Read Sql Server Data In Oracle
Jun 22, 2007
I have an ORACLE server say "A". I have a SQL Server named "B". In SQL Server I have a table named "test" who contains only one field named "aa" which is "BIT" type field. I want to query this table of "B" from "A" interface through Oracle's DB Link and ODBC dsn for Sql Server. But it gives error. If I changed the data type of field "aa" to "int", then it reads easily. Please suggest.
View 7 Replies
ADVERTISEMENT
May 8, 2015
we recently got a scenario that we need to get the data from oracle tables which is installed on third party servers. we have sqlserver installed on ourservers. so they have created a DBLINK in oracle server to our sqlserver and published the DBLINK name.
what are the next steps that i need to follow on my sqlserver in order to access the oracle tables ?
View 2 Replies
View Related
Jul 20, 2005
Hi,I'm doing an Orcle to SQL port.Simply all I want to do is run a script / DTS package that reads Oraclesequences value and writes the current value of it in to a MSSQL table - ofSequenceName, ValueCan this be done ? If so how ? (Please provide example)Steve
View 2 Replies
View Related
Apr 16, 2008
Hi all,
I have a column in SQL server which is of type ntext. Selecting the specific column to view it in report builder, an error message appears with the following description:
- Cannot run this report. The grouping expression 'nameofcolumn' returns the datatype binary. The Grouping Expression cannot return binary data.
Report Builder recognises this as if it was an image...
Thanks in advance!
View 2 Replies
View Related
Sep 19, 2007
Here is my task I am storing pdf's in sql server. I would like to retrieve the binary data from sql server and write the pdf content into an existing aspx page to the appropriate pageview section. What is the best way to handle this. The code works below but it loads a new browser with the content. I need it to appear in it's tabbed section in the original aspx file. Any assistance you can give me would be greatly appreciated.
Thanks Jerry
oSQLConn.Open()Dim myreader As SqlDataReader
myreader = myCommand.ExecuteReader
Response.Expires = 0
Response.Buffer = True
Response.Clear()
Do While (myreader.Read())
Response.ContentType = ("application/pdf")Response.BinaryWrite(myreader.Item("img_content"))
Loop
View 5 Replies
View Related
Oct 19, 2007
hello.
i have a _CommandPtr that has the type CommandTypeEnum::adCmdTex, and the CommandText a query("Select * from Table_1") and this select returns one row that has a binary data in it.
Code Block
_CommandPtr pCommand;
//Create the C++ ADO Command Object
pCommand.CreateInstance(__uuidof(Command));
pCommand->ActiveConnection = this->pConnection;
//Make the ADO C++ command object to accept stored procedure
pCommand->CommandType = CommandTypeEnum::adCmdText;
//Tell the name of the Stored Procedure to the command object
pCommand->CommandText = _bstr_t("select * from Table_1");
//get recordset
pRecordset = pCommand->Execute(NULL,NULL,CommandTypeEnum::adCmdText);
BYTE* buffer = NULL;
if(pRecordset != NULL)
{
while (!pRecordset->GetEndOfFile())
{
VARIANT var = pRecordset->Fields->GetItem("test")->Value;
void * pData = NULL;
SafeArrayAccessData(var.parray, &pData);
long size = GetArraySize(var, NULL);
buffer = new BYTE[size];
memcpy(buffer, pData, size);
SafeArrayUnaccessData(var.parray);
pRecordset->MoveNext();
}
pRecordset->Close();
}
where:
Code Block
long GetArraySize(const VARIANT& var, long * nElems)
{
if ( !(var.vt & VT_ARRAY) ) return -1;
long size = 0;
long dims = SafeArrayGetDim(var.parray);
long elemSize = SafeArrayGetElemsize(var.parray);
long elems = 1;
for ( long i=1; i <= dims; i++ )
{
long lbound, ubound;
SafeArrayGetLBound(var.parray, i, &lbound);
SafeArrayGetUBound(var.parray, i, &ubound);
elems *= (ubound - lbound + 1);
}
if ( nElems ) *nElems = elems;
size = elems*elemSize;
return size;
}
I enter in VARIANT var = pRecordset..... and if gives me a value... but when I put it in Memory explorer in VS, i only see this data " fe ee fe ee fe ee fe ee fe ee fe ee fe ee ...fe ee" and of course it brakes at
SafeArrayGetLBound(var.parray, i, &lbound);
Can someone tell me where I am doing a very bad thing?
P.S. I was able to read the binary data from the server using C#.NET 2.0.
View 1 Replies
View Related
Mar 4, 2004
Hi Guys,
I've been strugling with this problem all morning today.
Basically I store images in SQL Server 2000 database and then whould like to show them with
<img src="viewImage.aspx?image_id=10" border=1>
My table structure is setup this way
TABLE [userImages] (
[imageFilename] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[imageContentType] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[imageFileSize] [bigint] NULL ,
[imageFileImage] [image] NULL )
and in viewImage.aspx I have:
if (dr.Read())
{
Response.ContentType = dr.GetString(dr.GetOrdinal("imageContentType"));
Response.BinaryWrite( (byte[]) dr["imageFileImage"] );
}
I have no prolems retrieving the data from DB. But the image does not display(in IE it shows a broken link image)
What's even more puzzling is I CAN display the same image from HDD like so:
FileStream fs = File.OpenRead("D:\my_image.png");
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
fs.Close();
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(buffer);
Am I missing something very obvious. I tried playing around with different ContentType's same result.
In my case I am forced to store images in the DB.
I've seen other examples on the net and theirs work. Please help.
Sincerely,
Vlad Orlovsky
View 1 Replies
View Related
Mar 21, 2008
Hi, I was wondering which is the best way to read data from a txt file and insert each row into sql.
OLE DB Command could be? It will be necesary to work with variables?
My txt file will have a defined width (if it is necessary to know). I will have many rows with many columns. I have to map eah column from the txt file to it's corresponding column in sql server and insert data into it for each row.
Thanks for your help!
View 7 Replies
View Related
Nov 27, 2006
This just happened today and I dont know why. I have a database on a SQL server 2005 database, that has a table called photos. It contains image data, but not the column says <Unable to read data>. But before that I get an error when I try to execute the table to retreive the data. The error is below. SQL Execution Error:Executed SQL statement: SELECT ID, AlbumID, Caption, BytesOriginal, BytesFull, BytesThumb FROM PhotosError Source: System.DataError Message: Invalid attempt to Read when reader is closed. This happens with SQL Server Management Studio, and Visual Studio 2005 when I try to access it. I tried two computers so its not that. Any help or insight would be appreciated.
View 2 Replies
View Related
Jul 14, 2007
Hi I've followed a tutorial on how to write and read varbinary(max) data to and from a database. But when i try to read the data i get the error that the data would be truncated, but only when the varbinary(max) is greater then 8kB. I've used a system stored procedure (sp_tableoption) to set the table that holds the data to store data outside rows. To select the data i'm using a stored procedure: SELECT imageData , MIMEType FROM Pictures WHERE (imageTitle = @imageTitle) And then using an .aspx page to Response.Write the data:Using conn As New sql.SqlConnection conn.ConnectionString = ConfigurationManager.ConnectionStrings("myConnectionString").ToString Dim getLogoCommand As New sql.SqlCommand getLogoCommand.CommandType = Data.CommandType.StoredProcedure getLogoCommand.CommandText = "GetPicture" getLogoCommand.Connection = conn Dim imageTitleParameter As New sql.SqlParameter("@imageTitle", Data.SqlDbType.NVarChar, 200) imageTitleParameter.Value = Request("imageTitle") imageTitleParameter.Direction = Data.ParameterDirection.Input getLogoCommand.Parameters.Add(imageTitleParameter) conn.Open() Using logoReader As sql.SqlDataReader = getLogoCommand.ExecuteReader logoReader.Read() If logoReader.HasRows = True Then Response.Clear() Response.ContentType = logoReader("MIMEtype").ToString() Response.BinaryWrite(logoReader("imageData")) End If End Using conn.Close() End Using Can anyone please help me with this?!
View 2 Replies
View Related
Nov 18, 2005
i have data on a spreadsheet and i need to read it to a table in SQL server ? how can i do that ? some one refere to me a method for that but i need to see what other think is the best option and the most effecienet way let us say!!
View 4 Replies
View Related
Nov 23, 2005
Hello, everyone:
I have a local transaction,
BEGIN TRAN
INSERT Z_Test SELECT STATE_CODE FROM View_STATE_CODE
COMMIT
View_STATE_CODE points to remote SQL server named PROD. There is error when I run this query:
Server: Msg 8501, Level 16, State 1, Line 12
MSDTC on server 'PROD' is unavailable.
Server: Msg 7391, Level 16, State 1, Line 12
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d01c].
It looks like remote server is not available inside the local transaction. How to handle that?
Thanks
ZYT
View 5 Replies
View Related
Oct 18, 2015
way to read data from database already stored as question marks .that because by mistake i insert the data "arabic" from the VS as sqltext but the field in the database is nvarchar now i want to get the data back.
View 4 Replies
View Related
Jan 12, 2012
i attached adventure works in sql server 2008 and it showing as read only ,make it read write or remove read only tag from database.
View 11 Replies
View Related
May 25, 2007
Hai Everbody,
for me in my project i want to read data from a csv file and insert it in a sql server databse table.The csv file may contain n number of columns,but i want only certain columns from that, and insert it in the database table.How to achieve this. Plz help me it is urgent. Thanks in advance.
Thanks and regards
Biju.S.G
View 1 Replies
View Related
Dec 4, 2013
I have a table with one of the column of xml type. the column contains xml like given below. I want to read this xml from the table and show as below with T-sql query
"EmployeeID" "IndustryDome" "description "
Where Description value comes from the value of AllDome/ITEM/Dome /Description whose Dome equals to IndustryDome value
EX:
1166586 3951LX01 Description10
<GetEmployeeDetails xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<return xmlns="http://applications.apch1.com/webservice/schema/">
<EmployeeID>1166586</EmployeeID>
<BankAccounts>
[Code] ....
View 2 Replies
View Related
Nov 26, 2007
OBJECTIVE: I would like to read a text file from SQL Server 2000, read the text file content, and load its conntents in a RichTextBoxTHINGS I'VE DONE AND HAVE WORKING:1) I've successfully load a text file (ex: textFile.txt) in sql server database table column (with datatype Image) 2) I've also able to load the file using a Handler as below: using System;using System.Web;using System.Data.SqlClient;public class HandlerImage : IHttpHandler {string connectionString;public void ProcessRequest (HttpContext context) {connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["NWS_ScheduleSQL2000"].ConnectionString;int ImageID = Convert.ToInt32(context.Request.QueryString["id"]);SqlConnection myConnection = new SqlConnection(connectionString);string Command = "SELECT [Image], Image_Type FROM Images WHERE Image_Id=@Image_Id";SqlCommand cmd = new SqlCommand(Command, myConnection);cmd.Parameters.Add("@Image_Id", System.Data.SqlDbType.Int).Value = ImageID;SqlDataReader dr;myConnection.Open(); cmd.Prepare(); dr = cmd.ExecuteReader();if (dr.Read()){ //WRITE IMAGE TO THE BROWSERcontext.Response.ContentType = dr["Image_Type"].ToString();context.Response.BinaryWrite((byte[])dr["Image"]);}myConnection.Close();}public bool IsReusable {get {return false;}}}'>'>
<a href='<%# "HandlerDocument.ashx?id=" + Eval("Doc_ID") %>'>File
</a>- Click on this link, I'll be able to download or view the file WHAT I WANT TO DO, BUT HAVE PROBLEM:- I would like to be able to read CONTENT of this file and load it in a string as belowStreamReader SR = new StreamReader()SR = File.Open("File.txt");String contentText = SR.Readline();txtBox.text = contentText;BUT THIS ONLY WORK FOR files in the server.I would like to be able to read FILE CONTENTS from SQL Server.PLEASE HELP. I really appreciate it.
View 1 Replies
View Related
Mar 3, 2000
Does anyone know how to import data from an Oracle view (on Unix machine) to the tables in NT/SQL server 7.0? At least point me to the right docoment resource, if available. Thanks a lot.
wendy
View 2 Replies
View Related
Dec 19, 2002
Hi,
Which is the best way to transfer data from SQL server into Oracle?.
Thanks in Advance,
Ravi
View 7 Replies
View Related
Aug 19, 2007
Hi,
I created SQL Server package and schedule the job. SQL Server allows us to connected different database for e.g. for oracle using "Oracle Provide for OLD DB" to retrieve our database. A link is create between this database which move the data to SQL Server. I'm sure there is no issues in the link, as I'm using it to retrieve several oracle database which contains both Arabic and English data.
But after Importation it is showing Junk values. Please advise me what step I should take next.
Regards
Azeem
View 5 Replies
View Related
Feb 11, 2007
Hello friends,
I am working for a project. At my college I used to work with oracle. Now as requirement changes I have to change my database to SQL Server.
Is there any simple way one can suggest me?
View 2 Replies
View Related
Feb 13, 2006
Hi there,
I have successfully installed SQL Server Express.
I have copied NorthWind to SQL Server.
I have created an ODBC to the SQL NorthWind.
But my problem is, I open the data but I cannot edit or insert records
to the Customer table.
I have gone into SQL Management Studio and modified Permissions
on NorthWind and the Customer table with Alter, Insert, Update.
But no luck.
Has anyone experienced this?
Email me at justintoronto@hotmail.com if you have a solution.
I will try to check back here also.
Thanks,
Justin
View 1 Replies
View Related
Sep 11, 2015
We have oracle linked server created on one of the sql server 2008 standard , we are fetching data from oracle and updating some records in sql server . Previously its working fine but we are suddenly facing below issue.
Below error occurred during process .
OLE DB provider "OraOLEDB.Oracle" for linked server "<linkedservername>" returned message "".
Msg 7346, Level 16, State 2, Line 1
Cannot get the data of the row from the OLE DB provider "OraOLEDB.Oracle" for linked server "<linked server name>".
View 7 Replies
View Related
Jul 30, 2007
Hi,
I am using Windows 2003 server and Sqlserver 2005 by the use of Linked server , I made a connection to Oracle 10g after that I am importing records from Oracle to sqlserver 2005. When I made tnsnames.ora in sql machine , it worked fine but when i am using tnsnames file from oracle server then i fiired importing procedure it returns below maintain error :
OLE DB provider "MSDAORA" for linked server "BI_ORACLE_LS" returned message "Unspecified error".
OLE DB provider "MSDAORA" for linked server "BI_ORACLE_LS" returned message "Oracle error occurred, but error message could not be retrieved from Oracle.".
Msg 7311, Level 16, State 2, Line 1
Cannot obtain the schema rowset "DBSCHEMA_TABLES" for OLE DB provider "MSDAORA" for linked server "BI_ORACLE_LS". The provider supports the interface, but returns a failure code when it is used.
Please let me know.
Thanks
View 15 Replies
View Related
Jun 9, 2006
I need to link some data from SQL Server 2005 with Oracle 10 data.One way is to link Oracle server to SQL Server and use ROWSOURCE forretrieving data.What other ways for joing data from both databases exist ?Can I do it from SQLCRL VB - Stored Procedure ? If yes, what objectsshall I use for opening database and running an sql ?
When I tried to import system.data.oracleclient, it was not available. Do I need to install anything for being able to use it ?
Thanks a lot.
View 4 Replies
View Related
Feb 7, 2001
I have a coworker who needs to extract data from Oracle into SQL Server 6.5 and Sybase as part of an interface that runs daily. How is the best way to do this?
Tony
View 1 Replies
View Related
Apr 28, 2008
Hi All,
We are extracting the data from ORACLE databse into SQL Server 2005 database. Both are hosted on different servers.
For this we have created linked server on SQL Server and we using the OPENQUERY to extract the data. Its taking too much time to extract the data.
Is there any other alternate thing for OPENQUERY clause.
Please help me on this.
Thanks in advance.
Thanks,
Ramesh.
View 3 Replies
View Related
May 17, 2007
Hi to every one,
i have the export data from oracle to sql server.
how can i do it.
i tried through the wizard i am able to improt from oracle to sql server. but constratins are defined in oracle table are not comming in slq server.
i want to transfer data from oracle to sql(like tables,other database objects from oracle to sql).
how can i do it. is there any procedure .
could any one send the process.
regards,
kumar
pavan
Associate Oracle DBA
View 1 Replies
View Related
Aug 1, 2005
I am doing a test on migrating an Oracle 8i database toSQL 2000. I've never done this before and I would liketo find out if there are any complications or side effectsif I try doing the transfer of data using DTS?If not DTS then what would you suggest I transfer datawith?Thank you
View 4 Replies
View Related
Jun 8, 2006
I need to link some data from SQL Server 2005 with Oracle 10 data.One way is to link Oracle server to SQL Server and use ROWSOURCE forretrieving data.What other ways for joing data from both databases exist ?Can I do it from SQLCRL VB - Stored Procedure ? If yes, what objectsshall I use for opening database and running an sql ?Thanks a lot.
View 3 Replies
View Related
Feb 20, 2008
HI,
I need some help regarding the data access.
I needs to access some data from tables which are in oracle and load it into sql server tables.
Please let me know the process for this.
Thanks in advance.
View 2 Replies
View Related
Mar 7, 2007
Ok, we have built a data mart using SSIS etc...for transformations and loading.
Our biggest single problem we have currently is loading data from an Oracle server to our SQL server. Some tables from oracle run fine when retrieving the data but there is one particular table that just doesn't load fast enough (9 million records take over 12 hours). It seems that we are idling alot and its not always running.
Can anyone help with this problem?
View 8 Replies
View Related
Apr 19, 2007
I am getting this error when connecting to Oracle db. I tried using Microsoft OLEDB provider for Oracle it give me error and tells me the error could not be retrieved from Oracle. When I try the Native OLDDB provider for Oracle I get
Warning at {0F67F2FA-E3F8-4F44-93EC-47D513A34FD4} [Orcale Database WPHP2 [1]]: Cannot retrieve the column code page info from the OLE DB provider. If the component supports the "DefaultCodePage" property, the code page from that property will be used. Change the value of the property if the current string code page values are incorrect. If the component does not support the property, the code page from the component's locale ID will be used.
Error at Copy DSS_SJV_Volume_History [DTS.Pipeline]: The "output column "COMP_UNIQUE_ID" (2007)" has a precision that is not valid. The precision must be between 1 and 38.
What do I do !!!!!!!!!!
Thanks
Shabnam
View 1 Replies
View Related