SmartForms - How to insert Empty String instead of NULL value

  • 13 August 2014
  • 3 replies
  • 5 views

Badge +4

Using the out of the box SmartObject SQL broker, is there any way to insert the Empty String value instead of a NULL value in the SQL table in SmartForms? Even if I use an expression to set the value to the EmptyString, it still tries to insert a NULL value into the table. (The string column in the table does not allow nulls.) 


3 replies

Badge +8

O,


 


Have you tried double tick marks?  if you execute the following statement, I believe it will instert an empty string into col1: INSERT INTO testtable(col1, col2, col3) values ('', 'foo', 2);


 


So, instead of the expression putting in the empty string...change it to tick marks.  


 


If it inserts the tick marks as data, you might need to setup a stored procedure to fire that insert if your data source is empty.

Badge +2

We have the same issue here.  What was your resolution?

 

We require a string rather than a null as we later filter a grid based on a like clause.

Userlevel 3
Badge +8

Dear ,

 

Could u provide more explanation about the issue u r facing ? (the full scenario)

u want to send empty string to no NULLS field ? 

 

Regards.

Reply