Skip to main content

Hi all,


 


I have a smartforms list view built on top of a smartobject which is built on top of a stored procedure. The input parameteres for the stored procedure are uniqueidentifiers, nvarchars and decimals. Here is the scenerio:


 


I add a record by clicking 'add' button onthe lsit view and then fill in all the fields. And submit the form where I call "Execute a view method for items that are in a specific state(Added)". Lets say the decimal value I passed in was 9.89. I look in the database and everything I have types are stored fine. I then open another form which loads all the values for that list view including the decimal value correctly. I then change the value for that decimal using the 'edit' button and on form submit; I execute "Execute a "update" method for items that are in a specific state(Changed). The input for that method comes as usual from the instance of list view smartobject. This time I get the error message "Error converting data type varchar to numeric.' message. The data type for the forms conftrols, the smartobject properties and the stored procedure for the decimal is decimal, so i dont understand this problem.


 


Please let me know if you have any solutions or comments. Thanks in advance.


 


 

Hi


 



  • Please make sure that somewhere in your query you don't  mix data types. because mixing data type can cause the error you getting.
  • Also Check the data you trying to convert contain any non numeric characters or not..

 


Could you plase try uploading a snapshot of the query you are getting an error at and the snapshot for that specific error.


 


To upload a file do the following:


 



  1. go to Attached Files below
  2. Click Browse button
  3. Select the file you wish to upload
  4. To add more files you can Click on +Add button

You can also Insert/edit image:



  • To do so, on the task bar click on the tree like image button
  • A new window will apear to add image

 


 


Kind Regards


Julia


 


Hi S0m3one


 


Please note that when working with data types, a varchar (a word) cannot be converted to a numeric (number) value.


I suggest having a look at your Retrieval and Destination SmartObjects, there should be a data type in one of these SmartObjects that does not return a value of the same data type, thus resulting in the error "Error converting data type varchar to numeric" or this could be a conversion that is not configured to do what intended.


The Retrieval Data Type should be the same as the Destination Data type.  But it is possible to convert one data Type to another by using a "Expression" with the inner configuration set to something like this "ToNumber(Varchar Text Box)".


 


You can have a look at these documents explaining the different data types:


Data Type Mappings


XML Data Types


 


You can have a look at this Document regarding coversions:


Data Type Conversions


 


 


Hi S0m3one


 


Just doing a quick follow up on the post, was my posting able to help in the process of either getting or being the solution?


or has this issue been solved as yet?


 


Hi


 


I just wanted to follow up on the error you had with "Stored Procedure Smartobject Problems", did you manage to fix the error and were my suggestion helpfull. please let me know if you managed to fix the error.


 


Regards


Julia


Reply