Subject | Re: [firebird-support] Moving unicode data from SQL Server to Firebird? |
---|---|
Author | Indysoft Bt. |
Post date | 2009-04-23T07:33:09Z |
Check IBExpert's IBEScript. It can connect to any datasource and you can
write a custom import utility for all kind of databases, using mixed
database connection layers (native, odbc) together. It is the best
command line utility I've ever seen. But you can run these scripts from
inside IBExpert. In the past I didn't know this extension, but nowadays
I cannot live without its power. Here is a simple example of importing
from MSAccess, but it is very easy to rewrite this code for MSSQL.
EXECUTE IBEBLOCK
AS
BEGIN
FBX = IBEC_CREATECONNECTION(__CTFIREBIRD,
'DBNAME="LOCALHOST/3021:C:\DB1.FDB; CLIENTLIB=GDS32.DLL;USER=SYSDBA;
PASSWORD=MASTERKE; NAMES=NONE; SQLDIALECT=3;')
OBX = IBEC_CREATECONNECTION(__CTODBC,'DBQ=C:\DEMO.MDB;DRIVER=MICROSOFT
ACCESS DRIVER (*.MDB)');
USE OBX;
FOR
SELECT CUSTNO, COMPANY, ADDR1 FROM CUSTOMER ORDER BY COMPANY
INTO :CUSTNO, :COMPANY, :ADDR1 DO
BEGIN
USE FBX;
INSERT INTO "CUSTOMERX"
("CUSTNO", "COMPANY", "ADDR")
VALUES
(:CUSTNO, :COMPANY, :ADDR1);
END
USE FBX;
COMMIT;
IBEC_CLOSECONNECTION(OBX);
IBEC_CLOSECONNECTION(FBX);
END
Regards:Alex :-)
write a custom import utility for all kind of databases, using mixed
database connection layers (native, odbc) together. It is the best
command line utility I've ever seen. But you can run these scripts from
inside IBExpert. In the past I didn't know this extension, but nowadays
I cannot live without its power. Here is a simple example of importing
from MSAccess, but it is very easy to rewrite this code for MSSQL.
EXECUTE IBEBLOCK
AS
BEGIN
FBX = IBEC_CREATECONNECTION(__CTFIREBIRD,
'DBNAME="LOCALHOST/3021:C:\DB1.FDB; CLIENTLIB=GDS32.DLL;USER=SYSDBA;
PASSWORD=MASTERKE; NAMES=NONE; SQLDIALECT=3;')
OBX = IBEC_CREATECONNECTION(__CTODBC,'DBQ=C:\DEMO.MDB;DRIVER=MICROSOFT
ACCESS DRIVER (*.MDB)');
USE OBX;
FOR
SELECT CUSTNO, COMPANY, ADDR1 FROM CUSTOMER ORDER BY COMPANY
INTO :CUSTNO, :COMPANY, :ADDR1 DO
BEGIN
USE FBX;
INSERT INTO "CUSTOMERX"
("CUSTNO", "COMPANY", "ADDR")
VALUES
(:CUSTNO, :COMPANY, :ADDR1);
END
USE FBX;
COMMIT;
IBEC_CLOSECONNECTION(OBX);
IBEC_CLOSECONNECTION(FBX);
END
Regards:Alex :-)