Ver Mensaje Individual
  #1  
Antiguo 17-04-2018
Avatar de lbidi
lbidi lbidi is offline
Miembro
 
Registrado: oct 2003
Ubicación: Montevideo- URUGUAY
Posts: 417
Reputación: 21
lbidi Va por buen camino
Manejo de Indices en Mysql temporal

Estimados..

Tengo el siguiente codigo para crear una tabla temporal en un server MYSQL.
Código Delphi [-]
FDQuery.SQL.Clear;
FDQuery.SQL.Add( 'CREATE TEMPORARY TABLE temp ( ');
FDQuery.SQL.Add( 'Cliente Double,');
FDQuery.SQL.Add( 'Nombre Char(30),');
FDQuery.SQL.Add( 'Direccion Char(30),');
FDQuery.SQL.Add( 'Total Double,');
FDQuery.SQL.Add( 'Telefono Char(10) );');
FDQuery.SQL.Add( 'CREATE INDEX xCliente   on temp (Cliente);');
FDQuery.SQL.Add( 'CREATE INDEX xNombre    on temp (Nombre);');
FDQuery.SQL.Add( 'CREATE INDEX xDireccion on temp (Direccion);');
FDQuery.SQL.Add( 'CREATE INDEX xTotal     on temp (Total DESC);');
FDQuery.ExecSQL;

cTablaMy.IndexName := 'xTotal';  <<---- aqui me da error

cual es la sintaxis correcta para tomar por defecto el indice que le indico.
estan bien creados los indices de esta manera ??

Gracias.
Responder Con Cita