
A medida que avanzo la cosa se verá mejor, el que quiera ayudarme con este proyecto, será sumamente bienvenido

Saludos.
Posted 08 November 2008 - 07:32 PM
Posted 10 November 2008 - 02:25 PM
Posted 10 November 2008 - 03:57 PM
Posted 10 November 2008 - 07:14 PM
SHOW INDEX FROM tabla FROM basededatos
Posted 11 November 2008 - 06:02 AM
Posted 11 November 2008 - 06:32 AM
Posted 11 November 2008 - 06:47 AM
Posted 11 November 2008 - 06:51 AM
mysql> SHOW INDEX FROM reg_pedidos FROM sigesped; +-------------+------------+----------+--------------+-------------+-----------+ -------------+----------+--------+------+------------+---------+ | TABLE | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | NULL | Index_type | Comment | +-------------+------------+----------+--------------+-------------+-----------+ -------------+----------+--------+------+------------+---------+ | reg_pedidos | 0 | PRIMARY | 1 | no | A | 4185 | NULL | NULL | | BTREE | | +-------------+------------+----------+--------------+-------------+-----------+ -------------+----------+--------+------+------------+---------+ 1 ROW IN SET (0.00 sec)
Posted 11 November 2008 - 07:03 AM
Posted 11 November 2008 - 07:13 AM
Posted 12 November 2008 - 10:23 AM
Posted 12 November 2008 - 10:38 AM
Posted 13 November 2008 - 06:30 PM
Posted 13 November 2008 - 07:34 PM
mysqlDDL.lines.Add(ZShowCreate.Fields[1].AsString);
mysqlDDL.text := ZShowCreate.Fields[1].AsString;
Posted 14 November 2008 - 08:24 AM
Posted 14 November 2008 - 09:35 AM
por fin que resolvistes con los indices???
Posted 17 November 2008 - 06:36 PM
Posted 17 November 2008 - 07:17 PM
procedure TFMain.Button4Click(Sender: TObject); Var Lineas,I,J,Idx: Integer; Separador: String; NombreCampo,Indice: String; begin Memo1.Clear; for i := 0 to Tablas.Items.Count - 1 do begin ZTablas.Close; ZTablas.TableName := Tablas.Items[i].Text; Try ZTablas.Open; cdTablas.Open; except ShowMessage('se produjo un problema al abrir'); Exit; End; cdTablas.First; Memo1.Lines.Add('CREATE TABLE '+UpperCase(Tablas.Items[i].Text)); Memo1.Lines.Add('('); for J := 0 to cdTablas.FieldCount-1 do begin if J < cdTablas.FieldCount-1 then Separador := ',' else begin if (J = cdTablas.FieldCount-1) and (cdTablas.IndexFieldCount > 0) then begin Separador := ','; end else Separador := ' '; end; if cdTablas.Fields[j].IsIndexField then Separador := ' NOT NULL' + Separador; NombreCampo := cdTablas.Fields[j].FieldName; If UpperCase(NombreCampo) = 'PASSWORD' Then NombreCampo := 'PASSCODE'; If UpperCase(NombreCampo) = 'SIZE' Then NombreCampo := 'SIZE1'; //Elimine estas lineas porque agregué caracteres a las constantes //usadas por la función TranslateChars() de Federico Firenze //NombreCampo := StringReplace(NombreCampo,' ','_',[rfReplaceAll]); //NombreCampo := StringReplace(NombreCampo,'ñ','n',[rfReplaceAll]); //NombreCampo := StringReplace(NombreCampo,'Ñ','N',[rfReplaceAll]); NombreCampo := StringReplace(NombreCampo,'(','',[rfReplaceAll]); NombreCampo := StringReplace(NombreCampo,')','',[rfReplaceAll]); NombreCampo := TranslateChars(NombreCampo, CHARS_ACENTUADOS, CHARS_SINACENTO); case cdTablas.Fields[j].DataType of ftString, ftWideString: begin Memo1.Lines.Add(' '+NombreCampo+' VARCHAR('+ inttostr(cdTablas.Fields[j].DisplayWidth)+')'+ Separador); end; ftFloat : begin Memo1.Lines.Add(' '+NombreCampo+' FLOAT'+Separador); end; ftCurrency : begin Memo1.Lines.Add(' '+NombreCampo+' NUMERIC(10,2)'+Separador); end; ftTime : begin Memo1.Lines.Add(' '+NombreCampo+' TIME'+Separador); end; ftDate : begin Memo1.Lines.Add(' '+NombreCampo+' DATE'+Separador); end; ftDateTime, ftTimeStamp : begin Memo1.Lines.Add(' '+NombreCampo+' TIMESTAMP'+Separador); end; ftAutoInc, ftInteger : begin Memo1.Lines.Add(' '+NombreCampo+' INTEGER'+Separador); end; ftMemo : begin Memo1.Lines.Add(' '+NombreCampo+' BLOB SUB_TYPE 1'+Separador); end; ftBlob, ftTypedBinary, ftGraphic : begin Memo1.Lines.Add(' '+NombreCampo+' BLOB SUB_TYPE 0'+Separador); end; ftBoolean, ftSmallint : begin Memo1.Lines.Add(' '+NombreCampo+' SMALLINT'+Separador); end; end; end; if cdTablas.IndexFieldCount > 0 then begin for Idx := 0 to cdTablas.IndexDefs.Count - 1 do begin Indice := cdTablas.IndexDefs[Idx].Fields; If UpperCase(Indice) = 'PASSWORD' Then Indice := 'PASSCODE'; If UpperCase(Indice) = 'SIZE' Then Indice := 'SIZE1'; Indice := StringReplace(Indice,'(','',[rfReplaceAll]); Indice := StringReplace(Indice,')','',[rfReplaceAll]); Indice := TranslateChars(Indice, CHARS_ACENTUADOS, CHARS_SINACENTO); with cdTablas.IndexDefs[Idx] do begin if ixPrimary in Options then begin Memo1.Lines.Add(' CONSTRAINT PK_'+Tablas.Items[i].Text+' PRIMARY KEY ('+Indice+')'); Memo1.Lines.Add(');'); Memo1.Lines.Add(''); end; if ixCaseInsensitive in Options then begin Memo1.Lines.Add('CREATE INDEX '+Tablas.Items[i].Text+'_IDX'+inttostr(Idx)+ ' ON '+Tablas.Items[i].Text+' ('+Indice+');'); Memo1.Lines.Add(''); end; end; end; end else begin Memo1.Lines.Add(');'); Memo1.Lines.Add(''); end; end; end;
CREATE TABLE AREA
(
area VARCHAR(25)
);
CREATE TABLE CAJACHICA
(
area VARCHAR(25)
);
CREATE TABLE CARTADETALLES
(
area VARCHAR(25)
);
CREATE TABLE CARTASORDEN
(
area VARCHAR(25)
);
CREATE TABLE CAT_USER
(
area VARCHAR(25)
);
CREATE TABLE COMPCAJA
(
area VARCHAR(25)
);
CREATE TABLE CUENTAS
(
area VARCHAR(25)
);
CREATE TABLE DEPARTAMENTO
(
area VARCHAR(25)
);
CREATE TABLE DESPEXP
(
area VARCHAR(25)
);
CREATE TABLE DOCUMENTO
(
area VARCHAR(25)
);
CREATE TABLE FACTURAS
(
area VARCHAR(25)
);
CREATE TABLE FONDO
(
area VARCHAR(25)
);
CREATE TABLE HIST_TRA
(
area VARCHAR(25)
);
CREATE TABLE HISTORICO
(
area VARCHAR(25)
);
CREATE TABLE ITEMS
(
area VARCHAR(25)
);
CREATE TABLE MODALIDAD
(
area VARCHAR(25)
);
CREATE TABLE MONEDA
(
area VARCHAR(25)
);
CREATE TABLE ORDENES
(
area VARCHAR(25)
);
CREATE TABLE ORDENGAS
(
area VARCHAR(25)
);
CREATE TABLE ORDGASDETALLES
(
area VARCHAR(25)
);
CREATE TABLE PED_DETALLES
(
area VARCHAR(25)
);
CREATE TABLE REG_PEDIDOS
(
area VARCHAR(25)
);
CREATE TABLE REPOSICION
(
area VARCHAR(25)
);
CREATE TABLE RESPONSABLES
(
area VARCHAR(25)
);
CREATE TABLE RESPONSABLES1
(
area VARCHAR(25)
);
CREATE TABLE RUBROS
(
area VARCHAR(25)
);
CREATE TABLE SISTEMA
(
area VARCHAR(25)
);
CREATE TABLE STATUS
(
area VARCHAR(25)
);
CREATE TABLE STATUS_ORDEN
(
area VARCHAR(25)
);
CREATE TABLE STATUS_OUT
(
area VARCHAR(25)
);
CREATE TABLE STATUS_PAGO
(
area VARCHAR(25)
);
CREATE TABLE SUPLI_RUBRO
(
area VARCHAR(25)
);
CREATE TABLE SUPLIDORES
(
area VARCHAR(25)
);
CREATE TABLE TRAMITES
(
area VARCHAR(25)
);
CREATE TABLE URGENCIA
(
area VARCHAR(25)
);
CREATE TABLE USERS
(
area VARCHAR(25)
);
CREATE TABLE USERS_LOGGED
(
area VARCHAR(25)
);
CREATE TABLE USERS_LOGS
(
area VARCHAR(25)
);
Posted 18 November 2008 - 08:49 AM
Posted 18 November 2008 - 06:05 PM
cdTablas.next;