Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursor just dies in SP
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00662658
Message ID:
00662684
Vues:
15
>Cursor from hell project #3.
>
>Lets take oracle data into a SQL Server DW in raw format. Now lets take the tables and add columns for the lookups.
>
>I am using 4 SP's to do this. First creates a Cursor for all the different apps we have in Oracle (Services). This calls #2 whick takes the meta data for the tables and blows away the existing table from yesterday and re-creates it today. #3 does the table creation. #4 makes the script to poplulate the new table .
>
>Problem is in #3.
>
>I loose the logging of print lines to the Messages, and it appears like the batch is stuck. Yet I get more data tables created. Anybody know something about this?

I have a VFP app that replicates an Oracle database with no problem. The app retrieves the list of tables in the original DB. I use SQLExec() instead of SQLTables() to do this. I query the USER_TABLES view to get the list of table names. I then scan through that cursor and create a SQL that retrieves all the column definitions for each table. I query the USER_TAB_COLUMNS view to get that info. I then use that data to generate the SQL used to create the table in the local DB. I then use SQLExec() again to retrieve the data from the parent into a cursor. Finally I scan that cursor and generate an INSERT SQL for each record to send the data to the local DB.

This all works and runs as fast as I could possibly expect. There are better ways and faster ways to do this, but because of our security and [what I consider] arbitray DBA policies, I have no other options for this particular case.

If you can be more specific about what you are doing and maybe some sample code, I may be able to provide better help.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform