Skip to main content
Solved

SQLExecutor error exposing feature attribute

  • November 14, 2019
  • 7 replies
  • 10 views

acusig
Participant
Forum|alt.badge.img+1

I try to extract values from a Postgresql 12 DB (to populate another pg table) by matching a feature attribute.

"pk_numart" (column)

"editor"."articles" (schema.table)

"codarticle" (column)

 

The query : 

SELECT "pk_numart" FROM "editor"."articles" WHERE "codarticle" = @Value(Mesure)

 

Then I get the following error : 

Executing custom data query: 'SELECT "pk_numart" FROM "editor"."articles" WHERE "codarticle" = 13.E'
Error executing SQL command ('declare "editor_custom_query_crsr" cursor for SELECT "pk_numart" FROM "editor"."articles" WHERE "codarticle" = 13.E'): 'ERREUR:  erreur de syntaxe sur ou près de « E »
LINE 1: ...k_numart" FROM "editor"."articles" WHERE "codarticle" = 13.E

Seems that the point causes the query to fail. I've tried several combinations, with or without hyphen before query or delimiter, but still no luck. 

Thanks already for any help.

Best answer by itay

Hi @acusig,

what about:

SELECT "pk_numart" FROM "editor"."articles" WHERE "codarticle" = '@Value(Mesure) '

View original
Did this help you find an answer to your question?

7 replies

itay
Supporter
Forum|alt.badge.img+16
  • Supporter
  • Best Answer
  • November 14, 2019

Hi @acusig,

what about:

SELECT "pk_numart" FROM "editor"."articles" WHERE "codarticle" = '@Value(Mesure) '


acusig
Participant
Forum|alt.badge.img+1
  • Author
  • Participant
  • November 15, 2019

Hi @itay,

Yes, I already tried with single quotes around the feature attribute as well as CAST(@Value(Mesure) as varchar) to be sure I'm dealing with a string but always the same error message. One can see a little vertical arrow under the point to locate the issue. Dunno if it's of any help ...

Thanks for your help


nampreetatsafe
Safer
Forum|alt.badge.img+12

Hi @acusig!  What is the datatype of the "codarticle" field in the database?  

Are you able to run this query successfully in another application? 

SELECT "pk_numart" FROM "editor"."articles" WHERE "codarticle" = '13.E' 

acusig
Participant
Forum|alt.badge.img+1
  • Author
  • Participant
  • November 20, 2019
nampreetatsafe wrote:

Hi @acusig!  What is the datatype of the "codarticle" field in the database?  

Are you able to run this query successfully in another application? 

SELECT "pk_numart" FROM "editor"."articles" WHERE "codarticle" = '13.E' 

Hi @nampreetatsafe, The datatype is string and I'm able to query the DB through pgAdmin4. I'm banging my head against the wall trying to understand what's happening ...


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • November 20, 2019
acusig wrote:

Hi @nampreetatsafe, The datatype is string and I'm able to query the DB through pgAdmin4. I'm banging my head against the wall trying to understand what's happening ...

Can you post the error message you get when adding the quotes as shown in itay's answer. The "Executing custom data query" should show exactly what is being sent.


acusig
Participant
Forum|alt.badge.img+1
  • Author
  • Participant
  • November 20, 2019
ebygomm wrote:

Can you post the error message you get when adding the quotes as shown in itay's answer. The "Executing custom data query" should show exactly what is being sent.

@ebygomm, the output log extract :

Executing custom data query: 'SELECT "pk_numart" FROM "editor"."articles" WHERE "codarticle" = '1.A' '

I join a more significant part of the log file as attachment.

20191120-sqlexecutor-issue.txt


nampreetatsafe
Safer
Forum|alt.badge.img+12
acusig wrote:

@ebygomm, the output log extract :

Executing custom data query: 'SELECT "pk_numart" FROM "editor"."articles" WHERE "codarticle" = '1.A' '

I join a more significant part of the log file as attachment.

20191120-sqlexecutor-issue.txt

@acusig, are you getting the error in the logfile? I don't see it in the log you provided. It would be helpful to get the entire log if possible, or at least a significant portion before and after the error you mentioned in your original description above. Thanks!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings