Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
From Foxpro to Oracle
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01330237
Message ID:
01330692
Views:
26
Looks good I'll test it soon.

By the way, can you use a VFP cursor result to upload data or it will only work with tables?

I remember the VFP to Oracle wizard (VFP5) used to transfer memo field to Long. How do you handle a table that has more than 1 memo column?

Thanks Will

>>In one system, we export VFP data to a text or excel file then we import into Oracle.
>>
>>I tried to use Web Services to get to data directly from VFP but did not work as we wanted. Specifically, we tried Oracle APEX.
>>
>>Do you know of a better transparent way to export data from VFP to Oracle?
>>
>>Thanks
>
>Mo,
>
>I've worked with Oracle over 10 years and write as much PL/SQL as I do VFP. It depends on how much data you are moving. If it's not huge amounts you can do it all right from within VFP? Here's some code that shows you how to do that.
>
>
>*** one approach for exporting VFP data to Oracle.
>lcmessage = "Update Failed - Can not connection to Oracle database server."
>lnhandle  = SQLSTRINGCONNECT("DRIVER={Oracle ODBC Driver};UID=username;pwd=password;dbq=oracleservice")
>
>IF lnhandle>0
>  lcsql = "SELECT * FROM YourOracleTable_To_Insert_Into WHERE 0=1"
>  IF NOT SQLEXEC(lnhandle,lcsql,'insert_table')
>    lcmessage = "Update Failed - SQL Statment Problem."
>  ELSE
>    IF USED('insert_table')
>      llReturn = .T.
>      ** CURSORSETPROP properties required to make VFP Cursors updatable
>      llReturn=llReturn AND CURSORSETPROP( 'Tables','**YourOracleInfo**', 'insert_table' )
>      llReturn=llReturn AND CURSORSETPROP( 'KeyFieldList', '**YourOracleInfo**','insert_table' )
>      llReturn=llReturn AND CURSORSETPROP( 'UpdatableFieldList','**YourOracleInfo**', 'insert_table' )
>      llReturn=llReturn AND CURSORSETPROP( 'UpdateNameList','**YourOracleInfo**', 'insert_table' )
>
>      llReturn=llReturn AND CURSORSETPROP( 'WhereType', 1, 'insert_table' )
>      llReturn=llReturn AND CURSORSETPROP( 'Buffering', 5, 'insert_table' )
>      llReturn=llReturn AND CURSORSETPROP( 'SendUpdates',.T., 'insert_table' )
>
>      IF llReturn
>        USE c:\yourimportfolder\vfp_import_table.DBF IN 0
>        SELECT ('insert_table')
>        APPEND FROM vfp_import_table
>        IF TABLEUPDATE(.T.,.F.,'insert_table')
>          lcmessage = "Update Completed!"
>        ELSE
>          TABLEREVERT(.T.,'insert_table')
>          lcmessage = "Update Failed - TABLEUPDATE Problem."
>        ENDIF
>      ELSE
>        lcmessage = "Update Failed - CURSORSETPROP Settings Problem."
>      ENDIF
>    ENDIF
>  ENDIF
>  sqldisconnect(lnhandle)
>ENDIF
>MESSAGEBOX(lcmessage)
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform