Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 7.0 to SQL Server - Remote view will not insert.
Message
From
05/02/2002 13:25:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/02/2002 13:05:02
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00615612
Message ID:
00615635
Views:
17
This message has been marked as the solution to the initial question of the thread.
>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

Mike,
Besides 'Send SQL updates' is company field marked as updatable ?
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform