1. Rômulo Sorato
  2. PowerBuilder
  3. Friday, 27 September 2019 17:13 PM UTC

Hello.

I have a set filter expression but the PB is telling that has an syntax error.

What is the right syntax to compare a column to a long variable?

Here is the expression that is returning me an error

parent.dw_listagem_pessoas.SetFilter("estados_id = '"+ string(llIdEstado) +" '")

Accepted Answer
James Pendarvis Accepted Answer Pending Moderation
  1. Friday, 27 September 2019 17:38 PM UTC
  2. PowerBuilder
  3. # Permalink
1
Votes
Undo
string Var1 
Var1 = string(long(llIdEstado))
parent.dw_listagem_pessoas.SetFilter("estados_id = '"+ var1 +" '")


This might work.
Comment
i removed but still not working.

Im inside a button click event
  1. Rômulo Sorato
  2. Friday, 27 September 2019 18:01 PM UTC
It´s working now.

I was typing the column name wrong.

Thanks!
  1. Rômulo Sorato
  2. Friday, 27 September 2019 20:02 PM UTC
NOTE: Watch out for the space before final single quote. Say llIdEstado = 56. In that case the filter expression above becomes >>estados_id = '56 '
  1. Michael Kramer
  2. Sunday, 29 September 2019 13:29 PM UTC
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 27 September 2019 18:52 PM UTC
  2. PowerBuilder
  3. # 1
2
Votes
Undo

Hi  Rômulo;

    Another trick that I do quite often is to use the DW Painter. In this painter, select the DWO you are working scripting. Then proceed to the Filter dialogue (Rows=>Filter menu). In the Filter dialogue, play with the filter expression until it works (use the Verify CB). Once you have that expression working, copy the filter expression back over to your PowerScript area.

HTH

Regards ... Chris

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 27 September 2019 17:41 PM UTC
  2. PowerBuilder
  3. # 2
1
Votes
Undo

Hi  Rômulo;

  Try it without the single quotes ...

 parent.dw_listagem_pessoas.SetFilter("estados_id = "+ string(llIdEstado) )

Regards ... Chris

Comment
I had already tried this way, but still not worked
  1. Rômulo Sorato
  2. Friday, 27 September 2019 17:46 PM UTC
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.