[Gambas-user] Extracting fields from a Result

Doug Hutcheson owlbrudder at gmail.com
Wed Jan 3 05:51:32 CET 2018


Hi Zainudin Ahmad Thanks for the information. I think you are correct,
in that I will have to use lowercase names instead of CamelCase that I
have been using for years. I would still like to know exactly where in
the code I should be looking in order to fix the PostgreSQL interface,
because I am happy to go through the compile/run/debug cycle as often
as needed. "8-)Kind regards, Doug
On Wed, 2018-01-03 at 11:43 +0700, Zainudin Ahmad wrote:
> Hi
> 
> You can see this video (https://drive.google.com/open?id=1jq6I26ykS5M
> kr3L2oPA1D15ZtjLt2_S3)
> 
>   Debug hRes.Fields.Exist("\"TxtMyDb\"") ---> true
>   Debug hRes.Fields.Exist("TxtMyDb")  ----> false
> I
>  think gambas not fully support for case sensitive(for postgres)
> field 
> name. I don't know about postgres I think maybe the recommended way
> you should
>  write your field name with lower case name.
> you can see in that video, doing this :
>  Debug hRes.Fields["name"].name
>  Debug hRes.Fields["NaMe"].name
> it's no different
> I think this is also possible :
>   For Each hRes
>     Debug hRes!Name    Debug hRes!NaMe  Next
> if
>  you doing hRes!txtMasterDatabase or hRes!txtMasterDATABASE or other 
> it's mean you must have a field name with lower case name in your 
> table.
> 
> sorry for my english, I hope that can help.
> 
> On Sun, Dec 31, 2017 at 8:44 AM, Doug Hutcheson <owlbrudder at gmail.com
> > wrote:
> > Hi everyone.
> > I have successfully connected to my PostgreSQL database and the
> > field count in the Result from my query is correct, but all my
> > attempts to extract data from the fields have failed. I am cobbling
> > together code from the wiki and from other posts here, but I am
> > still missing something.
> > The table I am reading from has exactly one row and 35 fields. The
> > first field is named txtMasterDatabase.
> > My code declares a Field and a Result as follows:          Dim
> > $Field As ResultField          Dim $Result As Result
> > The query works correctly:           $Query = "Select * From
> > abpa.tblParameters"           $Result = $Con.Exec($Query)
> > The field count is correct - 35:           Message("Fields count =
> > " & $Result.Fields.Count)
> > Now I try to loop through the fields in the result:           For
> > Each $Field In
> > $Result.Fields            Message($Field.Name)           Next
> > The problem occurs on the For Each line in that the Basic IDE
> > displays an error at this point:	Unknown field:
> > txtMasterDatabase in FRMStart:41
> > As I said above, the first field in the tuple is named
> > txtMasterDatabase, so Gambas is at least seeing it. Why is it
> > telling me the field is unknown?
> > Thanks for any help and Happy New Year,Doug
> > 
> > 
> > --------------------------------------------------
> > 
> > 
> > 
> > This is the Gambas Mailing List
> > 
> > https://lists.gambas-basic.org/listinfo/user
> > 
> > 
> > 
> > Hosted by https://www.hostsharing.net
> > 
> > 
> 
> 
> --------------------------------------------------
> 
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
> 
> Hosted by https://www.hostsharing.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180103/06f62025/attachment.html>


More information about the User mailing list