given, if I have a table as follows:
create table test (
fieldA date not null,
fieldB char (6) not null,
fieldC char (30) not null,
fieldD char (10) not null,
constraint pk_test primary key (fieldA, fieldB))
How can I write a update procedure where the update
statement is dynamic?
eg.
I may pass in to the update procedure fieldA to fieldD as
parameters.
1. But fieldA and fieldB will not be modifiable.
2. But fieldC and fieldD, they may/may not be updated.
So, sometimes I may pass a NULL for fieldC or fieldD.
Under those circumstances, how can I build an update
statment that take care of fieldC and filedD when they
are NULL?
Thanks
create table test (
fieldA date not null,
fieldB char (6) not null,
fieldC char (30) not null,
fieldD char (10) not null,
constraint pk_test primary key (fieldA, fieldB))
How can I write a update procedure where the update
statement is dynamic?
eg.
I may pass in to the update procedure fieldA to fieldD as
parameters.
1. But fieldA and fieldB will not be modifiable.
2. But fieldC and fieldD, they may/may not be updated.
So, sometimes I may pass a NULL for fieldC or fieldD.
Under those circumstances, how can I build an update
statment that take care of fieldC and filedD when they
are NULL?
Thanks