1. David Peace (Powersoft)
  2. PowerBuilder
  3. Wednesday, 13 May 2020 09:10 AM UTC

Hi Guys

Just a quick one as I suspect I know the answer really. I'm using the following code and getting an error saying that the Sql arguments are invalid or incomplete.

My simple reproducable is:

ls_sql = dw_1.GetSQLSelect ( )

ls_dw = sqlca.syntaxfromsql( ls_sql, 'Style(Type=Grid)', ls_err)

 

The DW on dw_1 is a simple single table DW and the GetSQLSelect returns:

PBSELECT( VERSION(400) TABLE(NAME="TestTable" ) COLUMN(NAME="TestTable.testkey") COLUMN(NAME="TestTable.testvalue") COLUMN(NAME="TestTable.testamount") COLUMN(NAME="TestTable.testdate")WHERE(    EXP1 ="~"TestTable~".~"testvalue~""   OP ="like"    EXP2 =":as_val"    LOGIC ="or" ) WHERE(    EXP1 ="~"TestTable~".~"testdate~""   OP ="="    EXP2 =":as_date"    LOGIC ="or" ) WHERE(    EXP1 ="~"TestTable~".~"testamount~""   OP ="="    EXP2 =":as_number" ) ) ARG(NAME = "as_val" TYPE = string)  ARG(NAME = "as_date" TYPE = datetime)  ARG(NAME = "as_number" TYPE = decimal)

My guess is that the SyntaxFromSql function was never designed to interpret a PBSELECT statement. Am I correct or have I screwed up somewhere?

I know that dw_1 is not connected to a DB which is why the GetSQlSelect returns the PBSELECT synatx. I just wanted to be sure that the SyntaxFromSql will never work this way.....

A quick yes it should work or no never will do, thanks :)

Cheers

David

 

mike S Accepted Answer Pending Moderation
  1. Wednesday, 13 May 2020 12:44 PM UTC
  2. PowerBuilder
  3. # 1

it will never work this way for graphical dws without connecting to the database.

IF you change from graphical to sql syntax, then you can get the sql without the connection.

 

Unpopular opinion:  The graphical painter is obsolete and should not be used.  It generates bad sql, does not work with things like you just pointed out, does not work correctly with database stored datawindow syntax for powerserver, and the list goes on.   It was a great feature back when the sql standard was not followed by oracle/sybase/microsoft for things like outer joins, but that is no longer the case.  

 

 

Comment
  1. David Peace (Powersoft)
  2. Wednesday, 13 May 2020 15:46 PM UTC
Thanks, I agree.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 13 May 2020 09:28 AM UTC
  2. PowerBuilder
  3. # 2

Hi David,

I don't think that it would accept PBSELECT syntax.

My advice is to simply use:

ls_sql = dw_1.object.datawindow.table.select"

instead of:

GetSQLSelect()

though I don't know what you're doing exactly.

 

regards

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.