Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
13 replies
Subscribers
6 subscribers
Views
9601 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
Can't Insert Null into DB
zrizvi
over 8 years ago
I'm getting the following error when using the "Write to Data Store Entity" smart service. All my variables have nillable = true. Any suggestions?
There is a problem with task “Add Budget Details to DB” in the process “TVP_App_Budget”. An error occurred while trying to write to the entity “TVP_App_Budget” [id=3edb9a28-551e-442b-85f2-1274ed8dc3f8@8017, type=TVP_App_Budget (id=1880)] (data store: TVP_App_Budget). Details: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("BPM_BUS_DB"."tvpappbudget"."A_ID") Data: TypedValue[it=1880,v={1.0,5.0,2.0,6.0,3.0,7.0,4.0,<null>,8.0,<null>,<null>,,,<null>,206504472,<null>,<null>,<null>,,<null>,<null>,,<null>,test4,<null>,9.0,china,2016-10-17,2016-10-13,2016-10-17,testtest,3444mm,8424,<null>,22,206508903,<null>,<null>}]
OriginalPostID-244278
Discussion posts and replies are publicly visible
0
abhinavg712
Certified Lead Developer
over 8 years ago
The error occurs when you try to insert a NULL value in a column A_ID that does not accept NULL values.
forum.appian.com/.../Write_to_Data_Store_Entity_Smart_Service.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
zrizvi
over 8 years ago
thanks.. its giving the same error when I specify an A_ID. Also, A_ID should accept null values as per the forum guide you sent says "You must designate a field in the CDT as your record ID (primary key) and specify an existing value, or the data written is always inserted as a new record."
Shouldn't this data be written as a new record if the primary key is null?
Thanks for your help.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhinavg712
Certified Lead Developer
over 8 years ago
Is this A_ID primary key was annotated with a @GenereratedValue
forum.appian.com/.../Custom_Data_Types_from_XSD.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
zrizvi
over 8 years ago
yes it was, as follows:
<xsd:element name="id" nillable="true" type="xsd:int">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">@Id @GeneratedValue</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ChristineH
Certified Lead Developer
over 8 years ago
A_id is different than the Id column you have here. A_id is auto. Rested by Appian when you publish a cdt to create table without identifying @ID in your xsd. Is it possible you published, then made a change? You may want to drop your table and try publishing again.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
kondetiv
over 8 years ago
Could you please attach xsd file here?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Dastagiri Dudekula
over 8 years ago
Try manually assigning empty double quotes for the variable which are assigned null in the above error.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 8 years ago
@rizviz org.hibernate.exception.ConstraintViolationException always appears if you want to insert a row with a value in a column having a unique index or constraint, and the inserted value for this column already exists in an other row. And you are getting error code ORA-01400 that means you are working with Oracle database, And Oracle Database Does not support AUTO_INCREMENT Strategy. As per my understanding the column A_id is AUTO_INCREMENT Type, i recommend you drop your existing Table, try correcting your XSD, as JPA Clear mention that AUTO_INCREMENT not supported by Oracle DB but Oracle supports Sequence generation.
And please have a look on Complete specification and resolution of error Code ORA-01400 at this Link:- http://www.dba-oracle.com/t_ora_01400_cannot_insert_null.htm
I Hope this can help you to resolve the issue
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
pavanik
Certified Senior Developer
over 8 years ago
@rizviz...
The problem might be, one of the columns in your DB is not null constraint.You are trying to insert null into that column.Just check your DB and uncheck that not null constraint.I hope it will work fine.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
zrizvi
over 8 years ago
@kondetiv attached is the xsd. please let me know your thoughts. thank you.
TVP_App_Budget.xsd
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>