Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert into an SQL table from VFP
Message
De
17/09/2001 02:47:03
 
 
À
17/09/2001 00:28:09
Joel Hokanson
Services Integration Group
Bellaire, Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00557153
Message ID:
00557176
Vues:
44
>How do I move records from a VFP table in a DBC into an SQL table?? Using VFP 6 and SQL 7.
>
>I have the DBF in the DBC with the exact same fields as the SQL table.
>
>I tried to append from that DBF and it dies after one record saying that a certain field can not be blank (null) , but it is NOT blank in the DBF.
>
>I tried to scatter memvar then Insert into the SQL table (a remote view in the DBC) and it insert one record FINE, but always dies on the SECOND record it does not allow nulls (but there IS data in the DBF field for record 2).
>
>
>HELP!!!!!!!!!!




The problem is not about VFP 6 or 7, even VFP 5 or lower version will occurs.

The problem is about the data check of Table in Table Designer.
IF you can't change the defination of table,
what you can to is to replace them into empty value.

1) AField() to gather the information of the final table.
The return array fifth column, [iX, 5] will be the Null Value allow information.
You can check out the detail on VFP help

2) use a tmpTable to carry the import data and
REPLACE ALL fieldABC with [] FOR ISNULL(fieldABC)

as you know the fieldtype from 2nd Column of return Afields,
you can put the correct empty value on each type:

Numeric, Integer, Float, Double : 0
Date, DateTime: {}
Char: []
Logical: .F.

After those check and modify, no NULL on tmpTable and you can import the data.

:)
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform