Question
Hcl
IN
Last activity: 24 Feb 2017 4:37 EST
Obj Save nulls the column
Hi,
If a table has 10 columns and the values for 4 columns are modified using Property-Set.If Obj-Save is called to update the table, the other columns are updated with null values.Is there a way to avoid overriding the other columns in obj-save.
Thanks,
Chitra R
***Updated by moderator: Lochan to add Categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Evoke Technologies
IN
Browse all the cloumns and update the required fileds to eliminate the issue...
if you browse only the required columns that needs to be updated then obj save takes other columns as a null value due to which your old data gets erased...
Please suggest if my assumption is wrong...
Hcl
IN
Can it be done without browsing and getting all the columns, I don't want to go for Browse approach becasue the table might have millions of records, Since I have the key of the row to update,I want to do it without browsing or opening the record.
Pegasystems Inc.
IN
Do you mean that the existing data are getting overridden when you are performing an obj save ?
If yes then definitely thats a wrong behavior .
Can you please run tracer with DB query on to see what query is getting generated when you are performing obj-save ?
Hcl
IN
Yup the existing data are set to null. I traced and got the query. It is trying to update all the columns in the table with default null values for the ones which doesnt have value in Obj-Save step page.
Phalanx Consultancy Limited
GB
If you are browsing to get the rows from your table, then perform an Obj-Open (or its equivalent) for each instance, set the properties that you want to update and then perform a save on the step page where you have opened your instance and updated.
Hcl
IN
yes that is what I am currently doing, I am using an obj-open and then setting the necessary columns and doing a save. But since I know the record to be updated, I was wondering if we can do without an Obj-Open.
Pegasystems Inc.
US
When you look at the properties on the work object that correspond to the columns getting nulled out, are they also null or is there a value that is written to the blob? The exposed columns should contain the same data as the blob, if they don't there is something wrong. If they do, the question then becomes what is nulling out the value (and should it have nulled out the exposed columns earlier, or is the change recent)?
Thanks,
Mike
Hcl
IN
It is not a work object table. I am trying to update few columns in data table(exposed columns). Since Obj-Save nulls out any column not available in the step page, I have used an Obj-open before the save to retain the existing data.