Noor Jahan
15th September 2015, 06:55
Hi all,
I have problem during dal. update
when iam setting the dal.set.property for particular field.
Iam getting the retrun value -12 in the dal.update() function.
The field is string filed ibd008.dori and its value getting updated is "1"
is it because the number value even though iam setting the field value as "test"
as runtime same error iam getting during update.
Please help
Regards
bhushanchanda
15th September 2015, 09:03
Hi,
Yes. If its a number field i.e. say double with domain tcamnt and you are updating as a string field, it will return -12.
Also, not sure about your version, but dal.set.property() is depreciated. Use dal.set.field() instead.
vahdani
15th September 2015, 10:07
-12 or DALHOOKERROR is the standard value returned if there is an error detected during DAL processing. In such cases you can always check the error message usibf for example show.dal.messages() to find out what was wrong:
long l.ret
db.retry.point()
dal.new.object("tcibd008")
....
dal.set.field("tcibd008.dori", value1)
dal.set.field("tcibd008.xxxx", value2)
....
l.ret = dal.save.object("tcibd008")
if l.ret = 0 then
commit.transaction()
else
abort.transaction()
show.dal.messages()
endif
Noor Jahan
15th September 2015, 10:54
Hi Thanks all,
Even though iam converting the filed value to string with str$ function
before updating iam, getting the same error
bhushanchanda
15th September 2015, 11:22
Hi,
As Vahdani rightly said, use dal.get.error.message() to get the error message. Check if you are passing any special character. Try different variations like use a variable, assign it value and then use it in dal function.
e.g.
a = str$(1)
dal...
Also, it will help if you post your code.
Noor Jahan
15th September 2015, 13:53
Hi,
My code
ex:
dal.set.property(.....awibd008.dori,hold.dori...)
ibdoo8.dori is orientation field in table ibd008
iam getting the error from dal.get.error.message is
"orienation not found in foundation table"---eror
What it means..
bhushanchanda
15th September 2015, 14:03
Hi,
It means that there is an existing DAL present for the table you are trying to update and it has a field/property hook which has a check. Also check the table definition. It might be referring to some other table for the field you are trying to update.
As it looks like a customized table, its difficult to tell the exact table name.
Basic idea is,
There is an Orientation Master Table (X) which doesn't have any value named Y which you are trying to update in your table.
Noor Jahan
16th September 2015, 06:54
Tnaks bhusan,
But stil iam fcing the problem ihave chekced the DAl for the table ibd008
it has written
function extern long awibd008.dori.check(long has_changed)
{
if not isspace(awibd008.dori) then
if not check.value(awibd008.dori,awibd.found.dori) then
RET.ERR("Orientation not found in Foundation Table")
endif
endif
return(0)
}
due to whcih iam getting the error.
but iam not geting wat it means
in program i have writen.
dal.set.property("awibd008", tawibd008, "awibd008.dori", hold.ibd008.dori, DAL_UPDATE)
PLease help
bhushanchanda
16th September 2015, 08:53
Hi,
I can see there is a function call checking for a return value and its returning as false.
Check function check.value() in your DAL script. Put the DAL under debugger and figure out the issue.
Ajesh
17th September 2015, 07:18
Hi,
My code
ex:
dal.set.property(.....awibd008.dori,hold.dori...)
ibdoo8.dori is orientation field in table ibd008
iam getting the error from dal.get.error.message is
"orienation not found in foundation table"---eror
What it means..
Does this Orientation field has any references to other Table. To me it seems Orientation field refers to a certain Table named as Foundation Table.
Try inserting the same value in Foundation Table before you set the dal.field for the orientation field.
Noor Jahan
17th September 2015, 14:15
Hi ,
I haev found that in check .value function its checking the record in table ibd025
where the record is present but still its returning false in select empty,
Whereas i have put the DAL in debugging mode
but while ruunig the sesion the control is not going to the DAL function
when the dal.set.property hit or even the dal.upadte function hit
so iam nto able to find the problem.
How to debug it when the control goes to the DAL fucntion.
bhushanchanda
17th September 2015, 14:29
Hi,
dal.set.property() should execute the DAL if its in debug mode.
1. Check if you are in the same VRC where the debugged object is.
2. Close any GTM display (ttaad4100/ttaad4500) if opened
If the above 2 doesn't solve the issue, log out and log back in.
Noor Jahan
18th September 2015, 06:33
hi Bhusan,
many thanks,it resolved.
Regards
Prudhvi0009
30th November 2018, 11:11
i'm unable to update and commit the fields in table tccom0009
while checked in debugger i found that the ret value is throwing -12 value
for the below dal.update.
could you suggest what may be the issue and in which cases does it occur?
This situation is occurring for few records only.
for few of them it's updating and committing the transaction.
dal.update("tccom009",ttccom009,ret,FALSE,DB.RETRY)
commit.transaction()