|
Posted by cavassinif on 01/24/06 15:06
Thanks for all the replies,
I implemented it as Hugo sayed, with condition in the value:
>INSERT INTO OT (OTFechaBorrador, OTFechaAAsignar, ThirdColumn, ...)
>SELECT CASE WHEN @eotId = 1 THEN CURRENT_TIMESTAMP ELSE NULL END),
> CASE WHEN @eotId = 2 THEN CURRENT_TIMESTAMP ELSE NULL END),
> CASE WHEN @eotId = 3 THEN CURRENT_TIMESTAMP ELSE NULL END),
I haven't realized that in an insert...in fact all values are
modified....consequently I need to put the condition in the value.
>The problem is your database design. Instead of 30 columns for dates
>A parameter that governs in
>which of 30 columns the current date has to be inserted sounds as if the
>best solution would be a redesign of your table
I know..that there are many columns....but...the business model
requires it. In addition I don't like to have many tables in my
databases, it's too much simple to maintain a reduced (respecting
normal forms, of course) set of tables.
Best Regards
Fabio Cavassini
Navigation:
[Reply to this message]
|