General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only