PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 28 → Cómo saber el nombre de las columnas de un data source
Cómo saber el nombre de las columnas de un data source
Débuté par Alejandro Gutiérrez, 17 oct. 2020 17:47 - 5 réponses
Posté le 17 octobre 2020 - 17:47
Saludos cordiales

XCLIENTES is data source

HExecuteSQLQuery(XCLIENTES, myConn2, hQueryWithoutCorrection,"SELECT top 100 * FROM CLIENTES")

HReadFirst(XCLIENTES)

XCLIENTES.CLI_NOMBRE // Es el contenido de CLI_NOMBRE

Hay algo como ...

nombredecolumna(xclientes.1) // devuelve cli_codigo
nombredecolumna(xclientes.2) // devuelve cli_nombre
nombredecolumna(xclientes.3) // devuelve cli_ruc

?

Gracias por su ayuda.


atte.

Alejandro
Membre enregistré
1 143 messages
Popularité : +50 (142 votes)
Posté le 21 octobre 2020 - 15:43
Saludos,

Como asi : XCLIENTES.TOP ?

o con ALIAS :

HExecuteSQLQuery(XCLIENTES, myConn2, hQueryWithoutCorrection,"SELECT top As ELTOP 100 * FROM CLIENTES")

....
XCLIENTES.ELTOP

si?

--
Thierry TILLIER
Développeur Windev-Webdev
Formation Windev : https://coursdinfo.teachable.com/
Formation bureautique : https://coursdinfo.net
Membre enregistré
1 143 messages
Popularité : +50 (142 votes)
Posté le 21 octobre 2020 - 15:45
perdoname, no es corecto

--
Thierry TILLIER
Développeur Windev-Webdev
Formation Windev : https://coursdinfo.teachable.com/
Formation bureautique : https://coursdinfo.net
Membre enregistré
1 143 messages
Popularité : +50 (142 votes)
Posté le 21 octobre 2020 - 16:03
No puedo hacer en SQL server pero
no puedes cambiar * en los nombres que necessitan ?

--
Thierry TILLIER
Développeur Windev-Webdev
Formation Windev : https://coursdinfo.teachable.com/
Formation bureautique : https://coursdinfo.net
Membre enregistré
794 messages
Popularité : +40 (42 votes)
Posté le 21 octobre 2020 - 19:23
Hola, mira aqui https://ayuda.windev.es/es-ES/…

Tienes la opcion SQL.TitleCol [ n] para conocer el nombre de los campos segun su numero.

Rubén
Posté le 22 octobre 2020 - 22:10
Saludos, gracias por su ayuda.

AsÍ funcionó:

SQLExec("select * from clientes",xclientes)

SQLInfo(xclientes)

Info(SQL.TitleCol [ 1]) // muesta cli_codigo
Info(SQL.TitleCol [ 2]) // muestra cli_nombre