Neil,
You can write a function that & put it as Update Triger of the table, something like that:
USE YourTable EXCLUSIVE
MODIFY STRUCTURE
IIF(SUBSTR(MainKey,AT('*',mainkey)+1,6)$("SS2004SS2005"), YourFunctionName(), .t.)
Don't forget Your function must return a logical value.
>I have a stored procedure on a DBC which is invoked by triggers on a table when somebody updates. What I would like to do though is the stored procedure will only execute if the record contains particular values in the key field. Basically in my table every record has whats known as a mainkey: For example
>
>Mainkeys
>--------
>T59*SS2005*JSK034*SAMPLE
>CLASSIC*SS2004*JSK213*SAMPLE
>or
>T56*SS2003*JST098*SAMPLE
>
>What I want to do is that the procedure will only run if 'SS2004' or 'SS2005' is in the mainkey field. I need something like:
>
>IF AT('*',mainkey)$("SS2004SS2005")
>
>So basically it locates the season after the first asterisk and determines whether the next 6 characters being 'SS2005' is contained wihin the mainkey field.
>
>In the example above it would execute for the first 2 mainkeys but not for the third if my syntax was correct.
>
>Can anybody help me please
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.