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.
Cargar Estructura de una tabla Mysql
Moderator: Rathinagiri
Cargar Estructura de una tabla Mysql
Skydone Solutions
www.skydone.com
www.skydone.com
- dragancesu
- Posts: 931
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: Cargar Estructura de una tabla Mysql
Try this, it work
Only need libmysql.dll
Only need libmysql.dll
- Attachments
-
- mysqlfunc.ZIP
- (3.37 KiB) Downloaded 283 times
Re: Cargar Estructura de una tabla Mysql
Muchas Gracias, me ha resultado de gran utilidad.
Otra pregunta, habría alguna manera de comprobar si una tabla especifica de mi base de datos a sido modificada, desde la ultima vez que la comprobe?
Si te sirve de ayuda, la tabla lleva un campo que indica el día y hora que ha sido modificada, pero no esta indexada por ese orden.
Gracias de nuevo.
Otra pregunta, habría alguna manera de comprobar si una tabla especifica de mi base de datos a sido modificada, desde la ultima vez que la comprobe?
Si te sirve de ayuda, la tabla lleva un campo que indica el día y hora que ha sido modificada, pero no esta indexada por ese orden.
Gracias de nuevo.
Skydone Solutions
www.skydone.com
www.skydone.com
- dragancesu
- Posts: 931
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: Cargar Estructura de una tabla Mysql
If I understand you want to know whether the record changed
Add fields status_insert and status_update as datetime and make a trigger before insert and before update to fill in the value of these fields
Add fields status_insert and status_update as datetime and make a trigger before insert and before update to fill in the value of these fields
Re: Cargar Estructura de una tabla Mysql
Te explico, tengo un programa de gestion con una base de datos es MySql.
Y estoy haciendo un programa paralelo, que cuando alguien desde el programa de gestion, actualice o añada algun registro de una derterminada tabla, el programa que estoy haciendo realizar unos procesos.
Es por eso que necesito controla cuando se modifica esa tabla.
La tabla tiene un campo donde esta guardando la ultima vez que se ha modificado el registro.
* * * * * Traduccion by Google * * * *
I mean, I have a management program with a database is MySQL.
And I'm doing a parallel program, when someone from the management program, update or add some derterminada register a table, the program I'm doing make some processes.
That's why I need to control when the table is modified.
The table has a field where you are saving the last time the record was modified.
Y estoy haciendo un programa paralelo, que cuando alguien desde el programa de gestion, actualice o añada algun registro de una derterminada tabla, el programa que estoy haciendo realizar unos procesos.
Es por eso que necesito controla cuando se modifica esa tabla.
La tabla tiene un campo donde esta guardando la ultima vez que se ha modificado el registro.
* * * * * Traduccion by Google * * * *
I mean, I have a management program with a database is MySQL.
And I'm doing a parallel program, when someone from the management program, update or add some derterminada register a table, the program I'm doing make some processes.
That's why I need to control when the table is modified.
The table has a field where you are saving the last time the record was modified.
Skydone Solutions
www.skydone.com
www.skydone.com
- dragancesu
- Posts: 931
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia