Sql escape

I have a table bound to an sql query and when a result returns that contains a field with a single quote, the query fails. How do I implement the sql escape character function?

thanks
travis

What property is your query on? What is the error you are getting? An SQL query returning a single quote should not cause an error if it is going to a string or dataset property.

I have a table component that i am populating with a dataset from an mssql db.
SELECT RecipeName as “Recipe”, Brand, RecipeCode as “Item Code” FROM FSQLDB

When a single quote was returned in the Brand field (ie Todd’s), it stopped working. Changed the table to reflect Todds in the field and it worked fine.

thanks
t.

That is bizarre. What version of FactoryPMI are you running?

1.8.3----

on a side note - how do i specify datasource.table.field properly in a SQL query to bind to table component? I have multiple datasource i need to bring together for a table.

thanks
t.

To pull a single value out of the table, you can create a dynamic property and set an Expression binding to something like this:if(len({Root Container.Table.data})>0, {Root Container.Table.data}[{Root Container.Table.selectedRow},"ColumnName"], 0)That will give you the Column you want from the row that is currently selected, and if nothing is selected, then it will return 0.

As far as the bug you reported at the top of this thread, I would recommend upgrading, as version 1.8.3 is quite out-of-date.

I talked to Vannessa last week about an upgrade - we will probably try to work it in middle of next month.

thanks
t.