General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
VFP 7.0 to SQL Server - Remote view will not insert.
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only