Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fastest way in VFP
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00610189
Message ID:
00610409
Views:
16
This message has been marked as the solution to the initial question of the thread.
Hi Paul

>I have two remote views(the structures are the same) one using an Ingres ODBC connection and the other using an Oracle ODBC connection. What is the FASTEST way to get all of the information from one view to the other? Any suggestions to show the power of the Fox? :)

Don't use views! Use SQL Pass Through and local VFP cursors - something like this:
*** Set up the transfer
lnOraCon = SQLCONNECT( < oracle > )
lnIngCon = SQLCONNECT( < Ingres > )
lcGetSQL = "SELECT < whatever >"

*** Now run (you didn't say which way...)
lnOK = SQLEXEC( lnIngCon, lcSetSQL, "curIngData" )
IF lnOK < 1
   *** ODBC Error
   RETURN
ENDIF

SELECT curIngData
GO TOP
*** Start transaction in Oracle
*** Must set connection to Manual Transactions first
SQLSETPROP( lnOraCon, "Transactions", 2 )
SQLEXEC( lnOraCon, "BEGIN TRANSACTION" )
SCAN
  lcSetSQL = "INSERT INTO < whatever > "
  SQLEXEC( lnOraCon, lcSetSql )
ENDSCAN
SQLEXEC( lnOraCon, "COMMIT" )
For even faster, use SPT to get the data, convert it into ASCII text and use whatever Text Import engine the back end provides (Oracle's is super fast, but I don't know how Ingres fares)
----
Regards
Andy Kramek
Previous
Reply
Map
View

Click here to load this message in the networking platform