Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with SQL Uniqueidentifier column and Remote vie
Message
From
25/05/2006 16:33:45
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01124968
Message ID:
01125061
Views:
14
>Hi all,
>
>I have a SQL SERVER Table with PK column defined as Uniqueidentifier
>
>
>[CustomerID]  uniqueidentifier ROWGUIDCOL  NOT NULL ,
>
>CONSTRAINT [DF_TR_TRAN_tr_id] DEFAULT (newid()) FOR [CustomerID],
>
>
>(Name:CustomerId RowGuid = Yes, Default value = Newid())
>
>The problem starts when I try to update the above table using SQL Pass-through from Foxpro.
>
>I have set up the cursor as follows:
>
>	CURSORSETPROP("FetchMemo", .T.)
>	CURSORSETPROP("Tables", "Customers")
>	CURSORSETPROP("UpdatableFieldList", "Col1, Col2... )
>	CURSORSETPROP("UpdateNameList", "Col1 Customers.Col1, Col2... )
>	CURSORSETPROP("KeyFieldList","CustomerId")
>	CURSORSETPROP("WhereType",  3)
>	CURSORSETPROP("SendUpdates", .T.)
>
>
>
>If I exclude the "CustomerId" column from the
> "UpdatableFieldList" and "UpdateNameList" properties of the cursor,
> - INSERT works ok,
> - UPDATE and DELETE are throwing the following error :
> "No key columns specified for the update table "name".
> Use the KeyFieldList property of the cursor"
>
>(Please note that KeyFieldList property of the cursor has been set corectly.)
>
>
>
>When I add the "CustomerId" column to the "UpdatableFieldList" and "UpdateNameList"
>
> - UPDATE and DELETE work fine,
> - INSERT repors the error :"Invalid character value for CAST specification"
>
>
>I guess I can't have it both ways.
>
>Any ideas? Any help highly appreciated!
>
>
>Regards,
>
>Zoran

Zoran,
Second version is the right one IMHO. It says invalid character for cast specification. Did you use some non hex digit as your GUID for insert?
Guids are like:
5D63CA4C-30E7-482C-8D2F-8E34AF1DA4FB
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