Cargar Estructura de una tabla Mysql
Posted: Sat May 16, 2015 8:03 am
Hola amigos, estoy intentando cargar la Estructura de una tabla de MySql a un array, igual que haria dbStruct() para los ficheos DBf. pero no se por donde tirar.
La forma que estoy gastando para conectar es:
oServer := TMySQLServer():New(cHostName, cUser, cPassWord)
// Check For Error
If oServer:NetErr()
MsgStop(oServer:Error())
Win_1.Title := 'Sincronizador Sky-Line - Not Connected'
Else
MsgInfo("Connected")
Win_1.Title := 'Sincronizador Sky-Line - Connected'
EndIf
oServer:SelectDB( cDataBase )
Y con esta linea trato de grabar la estructura al array
eTabla := oServer:Query( "SELECT * FROM COLUMNS WHERE TABLE_SCHEMA = cDatabase AND TABLE_NAME = 'tabla01')
Pero no me devuelve nada.
Podrian ayudarme? Gracias.
* * * * * Traduccion by Google * * * *
Hello friends, I am trying to load the structure of a MySQL table to an array, just as you would DBSTRUCT () to DBF ficheos. but do not know where to shoot.
The way I'm spending to connect is:
oServer := TMySQLServer():New(cHostName, cUser, cPassWord)
// Check For Error
If oServer:NetErr()
MsgStop(oServer:Error())
Win_1.Title := 'Sincronizador Sky-Line - Not Connected'
Else
MsgInfo("Connected")
Win_1.Title := 'Sincronizador Sky-Line - Connected'
EndIf
oServer:SelectDB( cDataBase )
And with this line try to burn the structure to the array
eTabla := oServer:Query( "SELECT * FROM COLUMNS WHERE TABLE_SCHEMA = cDatabase AND TABLE_NAME = 'tabla01')
But I do not return anything.
Could help me? Thank you.
La forma que estoy gastando para conectar es:
oServer := TMySQLServer():New(cHostName, cUser, cPassWord)
// Check For Error
If oServer:NetErr()
MsgStop(oServer:Error())
Win_1.Title := 'Sincronizador Sky-Line - Not Connected'
Else
MsgInfo("Connected")
Win_1.Title := 'Sincronizador Sky-Line - Connected'
EndIf
oServer:SelectDB( cDataBase )
Y con esta linea trato de grabar la estructura al array
eTabla := oServer:Query( "SELECT * FROM COLUMNS WHERE TABLE_SCHEMA = cDatabase AND TABLE_NAME = 'tabla01')
Pero no me devuelve nada.
Podrian ayudarme? Gracias.
* * * * * Traduccion by Google * * * *
Hello friends, I am trying to load the structure of a MySQL table to an array, just as you would DBSTRUCT () to DBF ficheos. but do not know where to shoot.
The way I'm spending to connect is:
oServer := TMySQLServer():New(cHostName, cUser, cPassWord)
// Check For Error
If oServer:NetErr()
MsgStop(oServer:Error())
Win_1.Title := 'Sincronizador Sky-Line - Not Connected'
Else
MsgInfo("Connected")
Win_1.Title := 'Sincronizador Sky-Line - Connected'
EndIf
oServer:SelectDB( cDataBase )
And with this line try to burn the structure to the array
eTabla := oServer:Query( "SELECT * FROM COLUMNS WHERE TABLE_SCHEMA = cDatabase AND TABLE_NAME = 'tabla01')
But I do not return anything.
Could help me? Thank you.