Good morning, I have a simple Add/Chg/Delete pgm and I use sql to insert, update and delete.
This original one works, but when I just populate the sku, I get 'Character in CAST argument not valid'. When all fields have a value it inserts fine.
Here is the first version of the insert statement and then my attempt to handle it:
Original:
If @Error = *Blank;
exec sql insert into PrtSku values(
pSku,pDesc,PDim,pwghta,pwghtb,pwghtc);
Retry version:
exec sql insert into PrtSku values(pSku,
case when pDesc is null then ' ' else PDesc end,
case when pDim is null then ' ' else pDim end,
case when pwghta is null then ' ' else pwghta end,
case when pwghtb is null then ' ' else pwghtb end,
case when pwghtc is null then ' ' else pwghtc end);
any help would be appreciated. Thanks.
This original one works, but when I just populate the sku, I get 'Character in CAST argument not valid'. When all fields have a value it inserts fine.
Here is the first version of the insert statement and then my attempt to handle it:
Original:
If @Error = *Blank;
exec sql insert into PrtSku values(
pSku,pDesc,PDim,pwghta,pwghtb,pwghtc);
Retry version:
exec sql insert into PrtSku values(pSku,
case when pDesc is null then ' ' else PDesc end,
case when pDim is null then ' ' else pDim end,
case when pwghta is null then ' ' else pwghta end,
case when pwghtb is null then ' ' else pwghtb end,
case when pwghtc is null then ' ' else pwghtc end);
any help would be appreciated. Thanks.





Comment