Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

ERROR: column "numbervalue" is of type double precision but expression is of type character varying Hint: You will need to rewrite or cast the expression.

dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 20, 2013

Hi,

JIRA : 5.2.11

My created custom field plugin raise me below error while creating an issue (create issue screen contain that custom field):

Error creating issue: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:CustomFieldValue][id,14375][issue,13194][numbervalue,1.554][parentkey,input1][customfield,11274] (SQL Exception while executing the following:INSERT INTO public.customfieldvalue (ID, ISSUE, CUSTOMFIELD, PARENTKEY, STRINGVALUE, NUMBERVALUE, TEXTVALUE, DATEVALUE, VALUETYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: column "numbervalue" is of type double precision but expression is of type character varying Hint: You will need to rewrite or cast the expression. Position: 160))

My customf field plugin is uses - "PersistenceFieldType CASCADE_VALUE_TYPE = PersistenceFieldType.TYPE_DECIMAL" as all input will be Numeric only.

what should i handle in this field "getStringFromSingularObject" as it seems exception raise from this method ?

at present below is the stuff for "getStringFromSingularObject"

public String getStringFromSingularObject(Object singularObject) {
		if((singularObject instanceof Integer ) == true)
		{			
				return Integer.toString((Integer)singularObject);
		}
		if((singularObject instanceof Double ) == true)
		{			
				return Double.toString((Double)singularObject);
		}
		return singularObject.toString();
	}

[I need input as a - NUMBER only then it would work correctly. But, user has entered numerics though it raise me an error as shown above.]

thanks

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 20, 2013

Your data is not the right type. It looks like your code is trying to handle it as a string, but you are trying to put it in as a number.

You say you're using cascade_value_type of decimal, but the error you're getting is you trying to store a numeric value.

dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 20, 2013

Hi Nic

Please see updated question.

Basically, my field should have input as Numeric data only.

so, i have taken "cascade_value_type" is type of decimal.

Now, its working fine at locally but facing that mentioned error in live JIRA.

(it seems to me, input data is unable to cast in "getStringFromSingularObject" method and throw such exception). when i faced this error then data are numeric only and it should work as correct input.

how it could be resolve ?

Thank You

TAGS
AUG Leaders

Atlassian Community Events