Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP 7.0 to SQL Server - Remote view will not insert.
Message
De
05/02/2002 13:05:02
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
VFP 7.0 to SQL Server - Remote view will not insert.
Divers
Thread ID:
00615612
Message ID:
00615612
Vues:
65
I am having a problem with a remote view to SQL Server. I get an error saying that it cannot insert he record because there is a null value in the Company field.

Here is my code:
****************************************************************************
USE Sql_mdc!clmaster IN 0 EXCLUSIVE
USE Sql_mdc!cldemog IN 0 EXCLUSIVE
USE demog.dbf IN 0 exclusive

i = 100000
SELECT demog
SCAN
i = i + 1
cAddress = ALLTRIM(demog.address1) + ALLTRIM(address2)
INSERT INTO clmaster ;
(company,account,ssno,pid,plname,pfname,pmname, ;
address,city,state,zip,hphone,wphone,sex, ;
dob,glname,gfname,gmname,gid,entered) ;
VALUES ;
('Lansing',ALLTRIM(STR(i)),ALLTRIM(STR(i)),demog.account, ;
demog.plname,demog.pfname,demog.pmname, ;
cAddress,demog.city,demog.state,demog.zip, ;
demog.hphone,demog.wphone,demog.sex, ;
demog.dob,demog.glname,demog.gfname,demog.gmname, ;
demog.doctorname,demog.entry_dt)
INSERT INTO cldemog ;
(company,account,ssno,otherid,plname,pfname,pmname, ;
address,city,state,zip,phone1,phone2,dob,sex) ;
VALUES ;
('Lansing',ALLTRIM(STR(i)),ALLTRIM(STR(i)),demog.account, ;
demog.plname,demog.pfname,demog.pmname, ;
cAddress,demog.city,demog.state,demog.zip, ;
demog.hphone,demog.wphone,demog.dob,demog.sex)
ENDSCAN
****************************************************************************


1. The "Send SQL Updates" is checked ON
2. Both tables require values in the company field.
3. I think I am inserting a string.

Here is the error msg:
"[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'COMPANY', table 'medical.dbo.CLMASTER'; column does not allow nulls. INSERT fails."

Any Ideas?

Thanks,
Mike
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform