JICGreg
Technical User
- Mar 14, 2007
- 34
I often update sql tables from foxpro using a remote view. The sql programmer takes over after that -- so fox is just used to get data into sql.
I'm trying to do this with a new sql table and I am running into problems. I used the foxpro upsizing wizard to get the table created in sql.
I have an existing odbc connection that I use for other tables and I have created my remote view -- I can browse the sql table via this remote view.
I then follow my "normal" process to update a table, but I'm getting this error:
Connectivity error: [MICROSOFT][odbc SQL Server Driver] Numeric value out of range.
Below is my code -- any insights as to why I'm getting this error would be really appreciated.
PROCEDURE upload_data_to_sql
CLOSE TABLES all
SELECT g
USE n:\research\trading\transaction_data\trading
DELETE ALL
PACK
SELECT c
USE n:\research\trading\transaction_data\&manager_allocation_name
SCAN
SCATTER memvar
SELECT g
APPEND blank
GATHER memvar
ENDSCAN
STORE "n:\research\trading\transaction_data\transaction_data" to dbasename
STORE "trading" TO foxpro_source_table
STORE "trading" TO sql_source_table
STORE "n:\research\trading\transaction_data\" to directory
STORE "view_trading" TO table_view
STORE "delete FROM " + sql_source_table TO table_select
lnConn = SQLCONNECT("JicReturns",.T.)
nret=SQLEXEC(lnConn,table_select)
IF nRet = 1
CLEAR
@10,10 say "success"
ELSE
@10,10 say "failure"
fdsa
endif
SQLDISCONNECT(lnConn)
CLOSE TABLES all
OPEN DATABASE &dbasename
USE &table_view
STORE directory + foxpro_source_table + ".dbf" TO file_name
APPEND FROM &file_name
TABLEUPDATE(.T.)
endproc
I'm trying to do this with a new sql table and I am running into problems. I used the foxpro upsizing wizard to get the table created in sql.
I have an existing odbc connection that I use for other tables and I have created my remote view -- I can browse the sql table via this remote view.
I then follow my "normal" process to update a table, but I'm getting this error:
Connectivity error: [MICROSOFT][odbc SQL Server Driver] Numeric value out of range.
Below is my code -- any insights as to why I'm getting this error would be really appreciated.
PROCEDURE upload_data_to_sql
CLOSE TABLES all
SELECT g
USE n:\research\trading\transaction_data\trading
DELETE ALL
PACK
SELECT c
USE n:\research\trading\transaction_data\&manager_allocation_name
SCAN
SCATTER memvar
SELECT g
APPEND blank
GATHER memvar
ENDSCAN
STORE "n:\research\trading\transaction_data\transaction_data" to dbasename
STORE "trading" TO foxpro_source_table
STORE "trading" TO sql_source_table
STORE "n:\research\trading\transaction_data\" to directory
STORE "view_trading" TO table_view
STORE "delete FROM " + sql_source_table TO table_select
lnConn = SQLCONNECT("JicReturns",.T.)
nret=SQLEXEC(lnConn,table_select)
IF nRet = 1
CLEAR
@10,10 say "success"
ELSE
@10,10 say "failure"
fdsa
endif
SQLDISCONNECT(lnConn)
CLOSE TABLES all
OPEN DATABASE &dbasename
USE &table_view
STORE directory + foxpro_source_table + ".dbf" TO file_name
APPEND FROM &file_name
TABLEUPDATE(.T.)
endproc