IDE error running postgreSQL

Post your Gambas programming questions here.
Online
monteiro
Newbie
Posts: 29
Joined: Mon Sep 26, 2016 11:40 am

Re: IDE error running postgreSQL

Post by monteiro »

thatbruce wrote: Fri Jul 04, 2025 8:42 pm What is mGlobal.rs and mGlobal.db when that line is executed? IOW has the result and the connection been established? I see no other problems with your SQL statement.
b
The connection to PostgreSQL is initially established in a login window.
After successful login, a main window is loaded. And several SQL queries are successfully executed.
This has been working fine for quite some time and is still ok.
I have now added this new SQL query and it is the only one that returns this error that makes no sense to me.
Also, if I execute this same SQL query manually in connection1 within the project, it works without error. The error only occurs when the program is running.

It seems that the structure of THIS SQL query is supported in connection1 but, when the program is running, another control is used and this one does not support the structure of THIS SQL query well.
Online
monteiro
Newbie
Posts: 29
Joined: Mon Sep 26, 2016 11:40 am

Re: IDE error running postgreSQL

Post by monteiro »

Grayghost, The other routines I mentioned are other SQL queries that perform other tasks and are working fine, only THIS SQL query returns this error.

sholzy: I'll try to use debug in this sub. I'll only be able to do this on Monday
Online
monteiro
Newbie
Posts: 29
Joined: Mon Sep 26, 2016 11:40 am

Re: IDE error running postgreSQL

Post by monteiro »

Debug did not show anything. Just the same error message appeared.
But this is a bug for sure, because the SQL statement returns the right values with no errors.
I tested it by not doing the math in the query but in the following way:
.rs = .db.Exec("Select numero,data_venda,prazo,cliente from vendas Where faturado IS FALSE And setor ='Laudos'
If Format(DateAdd(.rs!data_venda, gb.Day, (.rs!prazo - 2)), "ddmmyy") = Format(Now, "ddmmyy") Then
And no errors....

But if I put the calculations inside the SQL statement, the recordset returns that same error (a 'void' value).
User avatar
grayghost4
Regular
Posts: 224
Joined: Wed Dec 05, 2018 5:00 am
Location: Marengo, Illinois usa

Re: IDE error running postgreSQL

Post by grayghost4 »

Did you look at the values of all the variables ... I think debug show them, are they all properly initialize it this sub?
User avatar
gbWilly
Site Admin
Posts: 486
Joined: Fri Sep 23, 2016 11:41 am
Location: Netherlands
Contact:

Re: IDE error running postgreSQL

Post by gbWilly »

monteiro wrote: Mon Jul 07, 2025 10:17 am Debug did not show anything. Just the same error message appeared.
But this is a bug for sure, because the SQL statement returns the right values with no errors.
I tested it by not doing the math in the query but in the following way:
.rs = .db.Exec("Select numero,data_venda,prazo,cliente from vendas Where faturado IS FALSE And setor ='Laudos'
If Format(DateAdd(.rs!data_venda, gb.Day, (.rs!prazo - 2)), "ddmmyy") = Format(Now, "ddmmyy") Then
And no errors....

But if I put the calculations inside the SQL statement, the recordset returns that same error (a 'void' value).
You say you are on 3.20.
1. What exact version of the 3.20 series?
2. Are you using gb.db2 component or gb.db?

There have been bugs in 3.20 in gb.db2 component as discovered in this topic :arrow: viewtopic.php?t=1981
Somewhere past halfway into the topic a gb,db2 bug seemed to be the cause. This was in Gambas 3.20.2.
So, maybe you're still on the buggy 3.20 version?
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- Gambas3 Debian/Ubuntu repositories

- GambOS

... there is always a Catch if things go wrong!
Online
monteiro
Newbie
Posts: 29
Joined: Mon Sep 26, 2016 11:40 am

Re: IDE error running postgreSQL

Post by monteiro »

My version is 3.20.4
In it gb.db appears as 'deprecated' and so I'm using gb.db2
I'll check out this topic you mentioned, but I think there must be some minor bugs left.
User avatar
thatbruce
Regular
Posts: 314
Joined: Sat Sep 04, 2021 11:29 pm
Location: Sitting at my desk in South Australia

Re: IDE error running postgreSQL

Post by thatbruce »

Only one guess...
the IS NOT NULL in your original post is the only thing I could see which may have been incorrectly substituted.
Did using db.debug=true not print the actual SQL that was used?
b

p.s. This could well be a gb.db2 bug as I have previously reported errors in this area.
Post Reply