Link to home
Start Free TrialLog in
Avatar of formi
formiFlag for Switzerland

asked on

Insert record with varbinary from MS SQL Server table to MySql Table

Hi

I have a SQL Server table with a varbinary-field in it. I want to insert that record in a MySQL-Database. How can I access this field-data?
myTable is local on a SQL Server
mySqlTable1 is on a MySQL Server in the web

Query1.SQL.Text := 'SELECT myString1, myVarBinary1 FROM myTable';
Query1.Execute;
mySqlQuery1.SQL.Text := 'INSERT INTO mySqlTable1 (str1, blob1) VALUES('+QuotedStr(Query1.FieldByName('myString1').AsString)+','+??myVarBinary1??)'

Open in new window

How can I access the varbinary-field? Something like Query1.FieldByName('myVarBinary1').As???
Thanks for any help
Peter
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of formi

ASKER

Many thanks, that works. Only one question concerning this tag: I can use the
SELECT * FROM OpenQuery(MYSQLLINKEDSERVER, 'SELECT * FROM mySQLtable')

Open in new window

but I get the error "Invalid object name" using
SELECT * FROM MYSQLLINKEDSERVER.mySQLtable'

Open in new window

Why isn't this possible?