AnsweredAssumed Answered

Gel Script Update Statement

Question asked by MikeGillespie on Aug 4, 2010
Latest reply on Aug 5, 2010 by MikeGillespie
I am on Clarity 8.1.5 and I need to have a custom attribute set on the project object with a value from a sub-object based on a update in the sub-object.

I thought a process would work but I was unable to find a way to set attributes to other variables so I figured a Gel script tied to a process would work.
I setup a process on the sub object and attempted to utilize the following logic to set the field on the project object.
1. Get the project id from the current sub-object id using the odf_parent_id field
2. Update the project object field with the sub-object field

However, I don't know if this is even possible. For the first item I tried the following gel script just to see that I could get the proper project id. It fails with this message: An error occurred while executing custom script: org.apache.commons.jelly.JellyTagException: null:13:13: <sql:update> update odf_ca_project set bb1=org.apache.commons.jelly.tags.sql.ResultImpl@19435ce where id=5005189: [CA Clarity][Oracle JDBC Driver][Oracle]ORA-01729: database link name expected.

I think the error has more to do with the value being placed in the projid field.

<gel:script xmlns:core="jelly:core" xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
<gel:setDataSource dbId="Niku"/>

<sql:query var="projid">
select odf_parent_id from odf_ca_csx_prb where id=${gel_objectInstanceId}

update odf_ca_project set bb1=${projid} where id=5005189

Assuming the above can be fixed how do I reference fields from Gel so I can write the proper update statement? Something like this:
update odf_ca_project set bb1="sub_object field1 value" where id=${projid}

Thank you!