Skip to main content
Question

Can't save my results after a SQL Executor

  • February 29, 2016
  • 5 replies
  • 9 views

Forum|alt.badge.img

I have 2 tables A and B and want to increment the values from B using the last insert in A.

1- I am using the SQL Executor on B => select max(ID) from My_Table_A.

2- Then I merge B and the result from the the Sql Executor and save it as a shp file.

PROBLEM: the column ID exist now in B but is empty. I've try a lot of alternative and can't find why i am stuck whith this.

Thanxs for the answer i really need it

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • February 29, 2016

I Think it is because of the function in the SQL statement.

Try Select max(ID) ID from My_Table_A.

This will rename the max(ID) to ID.


david_r
Celebrity
  • February 29, 2016

Hi

you may have to specify "ID" as an alias for the resulting attribute in your SQL, e.g.

select max(ID) as ID from My_Table_A

David


david_r
Celebrity
  • February 29, 2016

Try this SQL statement:

select max(GID)+1 as GID from BATIMENT

For "Attributes to expose" set "GID". Also set "Combine attributes" to "Keep result attributes if conflict".

The key here is to rename your max() function call to GID. Also be aware of potential upper/lower case attribute names.

You can also delete the FeatureMerger, you do not need it.

David


Forum|alt.badge.img
  • Author
  • February 29, 2016

I Think it is because of the function in the SQL statement.

Try Select max(ID) ID from My_Table_A.

This will rename the max(ID) to ID.

Well it did work the second time i've tried. Thanxs :)


Forum|alt.badge.img
  • Author
  • February 29, 2016

Try this SQL statement:

select max(GID)+1 as GID from BATIMENT

For "Attributes to expose" set "GID". Also set "Combine attributes" to "Keep result attributes if conflict".

The key here is to rename your max() function call to GID. Also be aware of potential upper/lower case attribute names.

You can also delete the FeatureMerger, you do not need it.

David

Ok thanks a lot! I've also used an attribute keeper to be shure ^^ Have a nice day