By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,361 Members | 3,185 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,361 IT Pros & Developers. It's quick & easy.

VFP9 and SQL 2005 using VFP remote view Cannot insert the value NULL into column

P: n/a
Just trying to upsize using VFP 9 with SQL 2005 using VFP remote
views. One in particular keeps coming up and saying Cannot insert the
value NULL into column, when I really don't think I am inserting a
NULL value. Oddly sometimes it works but I don't know why. Can anyone
suggest anything else I can try? Perhaps this is the wrong group I'm
posting to - it was just the one that came up with other errors giving
the same message, but none of these seem to be the same?

I created a new SQL table and VFP remote view (code below)

then I run:
SELECT fund_code, "GB" as countryCode, 1 as derived ;
FROM factsheets!funds ;
WHERE fd_type_cd in ("UKA","OIC","INS","UKP","ITR") ;
AND fund_code+"GB" NOT in ;
(SELECT fund_code+CountryCode FROM RegisteredForSaleIn) ;
INTO cursor TmpReg

Then
INSERT INTO RegisteredForSaleIn (fund_code, CountryCode, derived) ;
SELECT fund_code, CountryCode, Derived FROM TmpReg

I've tried adding to INSERT
WHERE !isnull(fund_code)
and then
WHERE EXISTS(SELECT fund_code, CountryCode, Derived FROM TmpReg)

Yesterday resetting the UpdateName for the fund_code field worked, but
not today.

I have set and reset
keyfieldList (fund_code, Countrycode)
set all fields as updateable
set fund_code, Countrycode as Keyfield

I have 5 other tables that work ok.

************************************************** ****************************
This is the SQL used to create table
USE [dbFactSheetCollDev]
GO
/****** Object: Table [dbo].[fsRegisteredForSaleIn] Script Date:
05/30/2007 11:58:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[fsRegisteredForSaleIn](
[FundCode] [char](10) COLLATE Latin1_General_CI_AS NOT NULL,
[CountryCode] [char](2) COLLATE Latin1_General_CI_AS NOT NULL,
[Derived] [smallint] NOT NULL CONSTRAINT
[DF_fsRegisteredForSaleIn_Derived] DEFAULT ((0)),
CONSTRAINT [PK_fsRegisteredForSaleIn] PRIMARY KEY CLUSTERED
(
[FundCode] ASC,
[CountryCode] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
************************************************** *******************************
Create VFP view
CREATE SQL VIEW RegisteredForSaleIn ;
REMOTE CONNECTION dbFactsheetColl SHARE ;
as select FundCode as fund_code, CountryCode, Derived ;
from dbo.fsRegisteredForSaleIn

************************************************** *******************************

May 31 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.