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

D

diane

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top