Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored proc triggers read only error
Message
From
23/07/2008 13:18:05
 
 
To
23/07/2008 13:12:37
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01333481
Message ID:
01333485
Views:
13
David,
I don't think you can use trigger for the table to modify its contents.
You can use the trigger to insure data integrity and modify other tables as needed.
I would use default for the “ChangeDate” field to replace it with DATE() instead.

Yelena

>I have a SP that is supposed to update the current table. I get "Cannot update the cursor DEALERS, since it is read-only." The table is not read only. Does anyone know why I would get this read only error message from running the stored procedures?
>
>Here are the SPs:
>FUNCTION spDealersInsertTrigger()
> ? ISREADONLY()
> REPLACE ChangeDate WITH DATE(), Change WITH "NEW"
> RETURN
>ENDFUNC
>
>FUNCTION spDealersUpdateTrigger()
> ? ISREADONLY()
> REPLACE ChangeDate WITH DATE()
> RETURN
>ENDFUNC
>
>Here is the GENDBC code:
>DisplayStatus([Creating database...])
>CLOSE DATA ALL
>CREATE DATABASE 'MYDBC.DBC'
>DisplayStatus([Creating table DEALERS...])
>MakeTable_DEALERS()
>DisplayStatus([Finished.])
>
>FUNCTION MakeTable_DEALERS
>***** Table setup for DEALERS *****
>CREATE TABLE 'DEALERS.DBF' NAME 'DEALERS' ( ;
> COMPANY C(45) NOT NULL, ;
> ADDR1 C(45) NOT NULL, ;
> ADDR2 C(45) NOT NULL, ;
> CITY C(21) NOT NULL, ;
> ST C(2) NOT NULL, ;
> ZIP C(10) NOT NULL, ;
> CHANGE C(62) NOT NULL, ;
> CHANGECODE C(1) NOT NULL, ;
> CHANGEDATE D NOT NULL)
>
>***** Change properties for DEALERS *****
>CREATE TRIGGER ON 'DEALERS' FOR INSERT AS spdealersinserttrigger()
>CREATE TRIGGER ON 'DEALERS' FOR UPDATE AS spdealersupdatetrigger()
>ENDFUNC
>
>FUNCTION DisplayStatus(lcMessage)
>WAIT WINDOW NOWAIT lcMessage
>ENDFUNC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform