473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
0 2058

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: btober | last post by:
I'm finding that column defaults are not being assigned to nulls when I do an insert by way of a an ON INSERT rule on a view. For example, the following script \set ON_ERROR_STOP ON \c...
7
by: Serge Rielau | last post by:
Hi all, Following Ian's passionate postings on problems with ALTOBJ and the alter table wizard in the control center I'll try to explain how to use ALTOBJ with this thread. I'm not going to get...
4
by: onecorp | last post by:
I have a SQL table comprised of 31 columns. The first column is simply an id column, the next 30 columns are labelled ,.... The numerical columns have a tinyint type and the data stored is either...
6
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1)...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.