Hi for all, I make test with this component but i need to do 2 things. 
1 .- Create a Dabate
2.- How i can know if database is doesnt has tables, for create those.
i working cbuilder.
regards.
fernando sandoval ruiz
			
									
									
						Know if DataBase dont have tables
Hi,
For your second question
This query will return empty result if 'dbname' doesn't have table.
			
									
									
						For your second question
Code: Select all
select S.`schema_name` from `information_schema`.`schemata` S
where S.`schema_name` not in
( select T.`table_schema`
from `information_schema`.`TABLES` T where
T.`table_schema`=S.`SCHEMA_NAME` )
and S.`schema_name` = 'dbname';These are common questions of SQL for MySQL Server usage.
> 1 .- Create a Dabate
To create database you should execute a command like CREATE DATABASE database_name;
> 2.- How i can know if database is doesnt has tables, for create those.
You should use GetTableNames method of TMyConnection or SHOW TABLES command of MySQL Server. Also you should pay attention on following commands: DROP TABLE IF EXISTS and CREATE TABLE IF NOT EXISTS.
For more information read MySQL Reference Manual.
			
									
									
						> 1 .- Create a Dabate
To create database you should execute a command like CREATE DATABASE database_name;
> 2.- How i can know if database is doesnt has tables, for create those.
You should use GetTableNames method of TMyConnection or SHOW TABLES command of MySQL Server. Also you should pay attention on following commands: DROP TABLE IF EXISTS and CREATE TABLE IF NOT EXISTS.
For more information read MySQL Reference Manual.