[Gambas-user] Extracting fields from a Result
Doug Hutcheson
owlbrudder at gmail.com
Tue Jan 2 05:34:47 CET 2018
On Mon, 2018-01-01 at 23:12 -0500, T Lee Davidson wrote:
> On 01/01/2018 10:00 PM, Doug Hutcheson wrote:
> > I changed the code to connect to my database and the following was
> > the output:
> > [doug at womble <mailto:doug at womble> CommandLinePostgreSQLtestApp]$
> > ./CommandLinePostgreSQLtestApp.gambas
> > Connected.
> > Main.Main.24: 35
> > Main.Main.25: Main.Main.25: Unknown field: txtMasterDatabase
> > Main.Main.25
> >
> > 35 is the correct field count; txtMasterDatabase is the first field
> > in the table.
> >
> > I have attached two source archives: one is my PostgreSQL test
> > application - the one which started this thread - and the other
> > is your command line application. Please feel free to point out if
> > I have done something stupid, because I am at the start of my
> > Gambas learning curve and welcome any input.
> >
>
> Looking at the name of the first field in the table reminded me of
> something I stumbled across during my foray into PostgreSQL
> land. It has an issue with mixed-case names.
>
> https://stackoverflow.com/questions/20878932/are-postgresql-column-na
> mes-case-sensitive :
> "All identifiers (including column names) that are not double-quoted
> are folded to lower case in PostgreSQL."
>
>
Darn! I knew about that restriction and commonly double-quote my
identifiers for that reason. Sure 'nuff, when I change the first field
name to all lower-case the loop works fine, then barfs on the next one
which I have not changed.
Looks like you have solved that much of the quandary for me, Lee. Give
yourself a gold star and an elephant stamp! "8-)
Now I will see if it solves the problem of the Connections not wanting
to play nicely. I'll get back to you on that.
Cheers, Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180102/7562f4be/attachment.html>
More information about the User
mailing list