-
Daniel Seguin
- PowerBuilder
- Saturday, 8 February 2025 02:02 PM UTC
Hello,
I am in the process of migrating a powerbuilder 2017 app from using sybase ASE to SQL Server
I just found 2 reports which used to use a store procedure to populate the data source of datawindow (datawindow.table.procedure)
since the end users could create procedures in the database
Now in sql server, the dba does not want to give admin rights to regular database user.
So I am trying to change the report to use SetTransObject (dw_form,sqlca)
ls_cmd = "datawindow.Table.Select='" + trim(ls_sql) + "'"
rc = dw_form.Modify(ls_cmd)
The value of ls_cmd command contains a line like
CONCAT(ISNULL(rtrim(individual.last_name), ''), ' ', ISNULL(rtrim(individual.first_name), ''), ' ', ISNULL(rtrim(individual.middle_name), '')) as name
When I run this report within the PB app, I get this error
102 - Select Error: SQLSTATE = 42000
Microsoft SQL Server Native Client 10.0
Incorrect syntax near ','.
But when copy the entire SQL in SSMS. it works perfectly!
Note that I am using
// Profile PSDCA UAT
SQLCA.DBMS = "SNC SQL Native Client(OLE DB)"
SQLCA.LogPass = <*********>
SQLCA.ServerName = "-----------------------------------------"
SQLCA.LogId = "*******"
SQLCA.AutoCommit = False
SQLCA.DBParm = "Database='psdca',Provider='SQLNCLI11'"
Is there any issues with loading the sql statement this way
Also note that there many filters and sort options the user can select which is why I need to build the SQL within the powerscript.
Please advise.
Thanks
Daniel
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.