Matthias Moritz
Matthias Moritz

Reputation: 121

Powerbuilder: Syntax to modify SQL of a datastore

I want to modify the SQL statement of a datasore and have problems with the single quotes. The new SQL should be:

Select 'F' as c_value from table

The problem ( I guess ) are the single quotes.

datastore.Modify( "DataWindow.Table.Select='Select 'F' as c_value from table'" )

From this command I get an incorrect syntax error near the F. I thik have to escape the quotes in 'F', right? But what is the correct syntax?

Upvotes: 0

Views: 2409

Answers (2)

Surie
Surie

Reputation: 31

try this :

datastore.Modify( "DataWindow.Table.Select='Select ~'F~' as c_value from table' ");

Upvotes: 1

Eduardo G.
Eduardo G.

Reputation: 441

This is my recommendation:

ls_Select = "Select 'F' as c_value from table"
dw_1.Object.DataWindow.Table.Select = ls_Select
dw_1.SetTransObject(SQLCA)
dw_1.Retrieve()

Upvotes: 2

Related Questions