Subject | Re: [IBO] edit SQL question |
---|---|
Author | Helen Borrie |
Post date | 2003-07-24T22:37:06Z |
At 05:20 PM 24/07/2003 +0200, you wrote:
myTable
SET
id = :id,
myString = :myString
WHERE
id = :old_id
AND
((myString = :old_myString) or (myString is NULL))
This doesn't sound like a very good thing to do, since it appears you are
changing the primary key...
The golden rule for table design is that, if a PK, or a column of a
composite PK, is going to change, then it shouldn't be a PK. You surrogate
the PK in these cases.
Helen
>Hi,UPDATE
>
>I use a handbuilt editSQL:
>
>UPDATE
> myTable
>SET
> id = :id,
> myString = :myString
>WHERE
> id = :old_id
>AND
> myString = :old_myString
>
>If oldMyString = <null> then I get the error message that it's unable to
>locate my record
>if oldMyString <> null then everything runs OK
myTable
SET
id = :id,
myString = :myString
WHERE
id = :old_id
AND
((myString = :old_myString) or (myString is NULL))
This doesn't sound like a very good thing to do, since it appears you are
changing the primary key...
The golden rule for table design is that, if a PK, or a column of a
composite PK, is going to change, then it shouldn't be a PK. You surrogate
the PK in these cases.
Helen