[Gambas-user] A question about SQL field's names in gambas

Jorge Carrión shordi at ...626...
Tue Oct 14 11:10:00 CEST 2014


Nobody answer this question, but I want add what I've found in hope that it
helps someone who same problem:

If your SQL sentence uses a Mysql function as mid, or substring or
date_format or whatever, then table name is added to regular resultfields
name (with or without alias) and fields who uses the mysql function are
returned just with the alias.
When you sql sentence is created by the user choosing tables, relationships
and fields... this is a mess.

Regards.

2014-10-13 14:15 GMT+02:00 Jorge Carrión <shordi at ...626...>:

> When I do a call to my_conexion.exec method, like this.
>
> myresult=myconexion.exec("select
> `idactuacion`,`iddocumentos`,`fecha`,concat(`nombre`,`extension`) as
> `Nombre` from `documentos` where `idactuacion`= 288)
>
> (Two first fields ar integer, third a date and the rest strings.)
>
> Sometimes I receive a result wich have the Fields name as I defined in sql
> sentence and sometimes I receive a tableName.Fieldname as field name and
> not even in every field of same sql sentence...
>
> I always thought that tablename.fieldname where returned as desambiguation
> of similar names but that's not so since in the sql there isn't ambiguities.
>
> Same sql sentence in phpmyadmin, by example, works fine...
>
>
> How can be controled the fieldsname to be returned?
>
> Regards
>



More information about the User mailing list