472,371 Members | 1,550 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 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 1994

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)...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...

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.