SQL Query

Discuss RoboTask here
Post Reply
gremlin
Posts: 36
Joined: Sun Jan 08, 2023 3:13 pm

SQL Query

Post by gremlin »

Hy, I had a problem with SQL Query.
I open Database, no error.
Then I do a DB Exec SQL, no error
DB Close, no error
Messagebox the Result, empty

When I use the SQL Query at SQl Studio it works with a result.
screenshot_20230108_151414.png
screenshot_20230108_151414.png (14.21 KiB) Viewed 1473 times
Anyone can help me , why I get no result ?
Oleg
Site Admin
Posts: 3011
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: SQL Query

Post by Oleg »

Do you want to see the SUM?
DB Exec SQL action just execute the SQL statement. It has no any output. You can get row affected option. But this is depends on database kind.

1. 1-st line in your expression is not necessary. You can write ...[tWarenLger].kWarenLager = 1 in SQL
2. You must use DB Loop to extract some data from database. You expression returns only one row and one field
Oleg Yershov
gremlin
Posts: 36
Joined: Sun Jan 08, 2023 3:13 pm

Re: SQL Query

Post by gremlin »

Hy,
thank you. I had tried, but the result still empty...
Snipaste_2023-01-09_11-37-38.png
Snipaste_2023-01-09_11-37-38.png (33.66 KiB) Viewed 1451 times
Oleg
Site Admin
Posts: 3011
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: SQL Query

Post by Oleg »

Use LAGER1 instead of {LAGER1} (without braces)
You must specify variable name only
Oleg Yershov
gremlin
Posts: 36
Joined: Sun Jan 08, 2023 3:13 pm

Re: SQL Query

Post by gremlin »

Yes, thank you. Now it works
Post Reply