gb.db2 Order by
Posted
Enthusiast

Posted
Banned
I cannot imagine why Benoit would call it Subst otherwise?
Maybe something for the bugtracker?
Posted
Regular

It does what it says it does. It 'correctly' quotes data values (oh and table/column names now) suitable for the underlying database.
As the wiki says, it is ""similar to" Subst$, which if you think about it does not mean "the same as".
and further down, "the argument is supposed to be a SQL value" noting that in SQL a "value" is a specific thing, not just any old string.
Why does the command have the same name? It doesn't, it's "DB.Subst".
Yet again, "read EVERY word of the wiki page until your eyes bleed". :mrgreen:
(I'm just trying to save M. Minisini the bother.)
b
Posted
Enthusiast

Posted
Guru


thatbruce said
"read EVERY word of the wiki page until your eyes bleed". :mrgreen:
(I'm just trying to save M. Minisini the bother.)
I have referred to the corresponding Wiki page several times. And it is clearly stated there.
> I strongly suggest to use these methods for security reasons, and never build your requests by simple string concatenation!
Then I use exact the Syntax which was specified there
Code
Print DB.Subst("SELECT ** FROM [&1] WHERE '&2' = &3 ORDER BY '&4'", "Table", "Column1", "a string", "Column2")and get an Error only with gb.db2 and not with gb.db
and the same with my own Code which use the same syntax
then I don't know what else to read so that my eyes bleed
I also don't know whether anyone here has really tried this exactly.
I can also post an example tonight if that's what you want.
I would say that something has changed and Benoît had specifically asked to report problems with the new component.
best regards
Poly
Posted
Enthusiast

Gambas 3.20.2 … fresh install
still no joy
<IMG src="/home/mhc/Pictures/Screenshots/Screenshot%20From%202025-03-19%2007-40-56.png">
</IMG>
Posted
Enthusiast

Print DB.Subst("delete from [&1] where '&2' = &3 ", sFileName, sFileField, sFileIndex)
delete from ['bkaccts'] where ''accname'' = 'newAcc88'
and produces a error
while gb.db outputs this
delete from "bkaccts" where "accname" = 'newAcc88'
and works as expected
Posted
Guru


grayghost4 said
There is a bug in the new gb.db2 the line below produces the results shown
Thank you very much for the confirmation and all your efforts.
I don't have a Bug Tracker-Account yet, but would make one if no one else can or wants to do it.
Greetings Poly
Posted
Enthusiast

Posted
Administrator



grayghost4 said
I have no clue how to find or use the bugtracker
Connexion
I didn't test but it might well be a bug.
And be aware:
- Subst is part of core gb
- db.subst is part of gb.db and now gb.db2 componet and is a different ballgame meant for substitution specifically aimed at sql based databases.
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Enthusiast

maybe I will get several email by the weekend
Posted
Regular

Now, as regards the bug tracker. (greyghost, did you get my PMs?) and for everyone else … gmail is blocking the registration confirmation email from the Gambas bugtracker server, if you register with a gmail account you'll never get it. Today, I registered again with another mail account from another free mail provider and got the confirmation in seconds.
regards
b
Posted
Enthusiast

But if you file a report I don't need a error tracker account
Posted
Guru


thatbruce said
Hence my grumpy comments about "it does what it says it does". Sorry.
That is a beautiful character. Thank you.
You didn't actually say anything bad, but as I'm not an IT specialist and am currently familiarising myself with Gambas, I was a bit confused.
I'm all the more pleased that you can now confirm the error and have apologised for your grumpy comments.
Great community, many thanks to you all.
Posted
Guru


grayghost4 said
But if you file a report I don't need a error tracker account![]()
I have just written my first bug report. I hope it is understandable.
Posted
Guru


[Gambas-bugtracker] Bug #3002: DB.Subst (gb.db2)
That was quick. I am impressed.
Posted
Banned
Poly said
Have a look here, it has already been fixed.
[Gambas-bugtracker] Bug #3002: DB.Subst (gb.db2)
That was quick. I am impressed.
Welcome to the cutting edge of gambas where any problems you find get fixed quickly
Thanks to Benoit for fixing and thanks to you for reporting, Gambas is now a little bit better
8-)
Posted
Enthusiast

Posted
Banned
then bug fixes will add to stable in the next release.
Posted
Guru


BruceSteers said
Thanks to Benoit for fixing and thanks to you for reporting, Gambas is now a little bit better
8-)
Thank you for your kind words.
I can't thank Benoit and the community enough when I see how quickly the bug was fixed.
Now I'm waiting impatiently for the new release.
But thanks to Grayghost4 I now know how I can do the whole thing alternatively by using Quote.
Posted
Enthusiast

BruceSteers said
it is fixed in master (development branch) right now.
I installed the development and can verify that it works properly with sqlite database
Posted
Administrator



Poly said
Now I'm waiting impatiently for the new release.
But thanks to Grayghost4 I now know how I can do the whole thing alternatively by using Quote.
There is no need to wait for gb.db2 Subst to be in a new release.
You can use gb Subst as well. I been working like that for over 10 years and it never failed me.
Simple function as example using Subst (not the db2 Subst).
Code (gambas)
Code (gambas)
- Debug sQuery
Exampe on how to use:
Either yyyy-mm-dd
OR yyyy-mm-dd hh:nn:ss
Screenshot below is from a mariadb table taken in phpMyAdmin to show a longdate example:
Enjoy…
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Guru


gbWilly said
There is no need to wait for gb.db2 Subst to be in a new release.
You can use gb Subst as well. I been working like that for over 10 years and it never failed me.
Many thanks for the tip and your code examples.
I am really still a beginner without a project or a specific intention. I've just been playing with databases a bit.
But I think Gambas is great and I'm happy if I can perhaps help some beginners to try Gambas more by discovering errors or ambiguities and eliminating them.
My first introduction to Gambas was quickly ended by the fact that an array was read only. Because I thought I was too stupid, but that was a bug in the version at the time.
I will try to understand your examples and I am really pleased that you have added them here.
I like to learn
gbWilly said
Enjoy…
I have a lot of fun with gambas. I just need more time.
Posted
Administrator



Many moons ago I wrote a small thing aimed at people completely new to Gambas3 and programming in general. It never really got finished (personal circumstances) but it is still valid and more important usable introduction to GUI programming in Gambas3 and best of all downloadable as a pdf. Mail address in there is no longer valid and maybe some here on the forum contributed to grammar corrections and more. Check it out and discover…Poly said
Many thanks for the tip and your code examples.
I am really still a beginner without a project or a specific intention. I've just been playing with databases a bit.
In those days, I had big plans on a whole series (this was part 2, part 1 was on installing and compiling gambas and no longer valid as we moved from subversion to git). I like writing training manuals as I have worked as IT trainer for a good 5 to 6 years back in the 90ies (also developing training materials now and then).
I learned a lot a long time ago on a Gambas forum before this one (White Islands software) and learned just by trying to solve the problems people reported on the forum. Try to replicate them in a vm and see what was causing it. Kind of what I see Bruce doing on this forum, getting smarter by the day, while helping othersPoly said
But I think Gambas is great and I'm happy if I can perhaps help some beginners to try Gambas more by discovering errors or ambiguities and eliminating them.
My first introduction to Gambas was quickly ended by the fact that an array was read only. Because I thought I was too stupid, but that was a bug in the version at the time.
I discovered a lot in those days merely by doing that (and reading the wiki over and over again many, many, many, many times…
Then, in 2013, I started migrating (read code it all completely new) the software (databases and front ends) I wrote 10 yeras before, in a Windows XP and Windows 2003 server environment for the corporation I worked for to gambas3 front ends (and eventually way more), mysql (later mariadb backend) on debian servers. Never going back, the servers never had problems, software (read gambas and all underlying) stable as one wished for without having to figure out work arounds. Complete migration took me about 4 years at about 20 hours a week, running a dual environment for that period (windows/Linux). Migration period was not just that, but also improvements and new additions as Gambas offered way more freedom of doing. And developed a set of management tools in Gambas3 as well, including daemons running on the servers reporting back to me.
Gambas is great for so many things, I really love programming in Gambas and have several private projects (for my own use).
Well, enjoy it some more…Poly said
I will try to understand your examples and I am really pleased that you have added them here.
I like to learn![]()
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Guru


gbWilly said
Many moons ago I wrote a small thing aimed at people completely new to Gambas3 and programming in general.
This is from you?
I've already worked through it completely. It was what got me started with Gambas3 in the first place.
I think I know pretty much all the Gambas docs and I'm in the process of reading the wiki over and over again.
I can also highly recommend the Greek Gambas book https://github.com/demosthenesk/the_gambas3_book
I have translated it completely into German and think that your ‘How to Gambas’, the ‘Gambas from Zip’ and this book give you enough tools to get a good understanding of Gambas.
At least enough so that people are able to read the wiki better and dare to ask questions in a forum like this.
I feel really honoured to be in contact with such important people from Gambas.
Thank you very much for this great "How to…."
For the work you have put into the creation and thus for the support for Gambas.
It's good to know that such cracks are reading along here.
With the very best regards
Poly
1 guest and 0 members have just viewed this.




