[Lazarus-es] Sentencia larga Sql
francisco prieto
fajprieto en gmail.com
Vie Ago 14 03:00:47 CEST 2015
El 13 de agosto de 2015, 13:34, Maxi <maximiliano.duarte en gmail.com>
escribió:
> quotedString()
Excelente lo suyo...
Quedo asi,
lcSql:='SELECT RF.RDB$FIELD_NAME AS FIELD_NAME,CASE FL.RDB$FIELD_TYPE '+
' WHEN 7 THEN '+QuotedStr('SMALLINT')+
' WHEN 8 THEN '+QuotedStr('INTEGER')+
' WHEN 9 THEN '+QuotedStr('QUAD')+
' WHEN 10 THEN '+QuotedStr('FLOAT')+
' WHEN 11 THEN '+QuotedStr('D_FLOAT')+
' WHEN 12 THEN '+QuotedStr('DATE')+
' WHEN 13 THEN '+QuotedStr('TIME')+
' WHEN 14 THEN '+QuotedStr('CHAR')+
' WHEN 16 THEN '+QuotedStr('INT64')+
' WHEN 27 THEN '+QuotedStr('DOUBLE')+
' WHEN 35 THEN '+QuotedStr('TIMESTAMP')+
' WHEN 37 THEN '+QuotedStr('VARCHAR')+
' WHEN 40 THEN '+QuotedStr('CSTRING')+
' WHEN 261 THEN '+QuotedStr('CSTRING')+
' ELSE '+QuotedStr('DESCONOCIDO')+
' END AS FIELD_TYPE,'+
' FL.RDB$FIELD_LENGTH AS FIELD_LENGTH,'+
' COALESCE(CS.RDB$CHARACTER_SET_NAME,'''') AS FIELD_CHARSET'+
' FROM RDB$RELATION_FIELDS RF '+
' LEFT JOIN RDB$FIELDS FL ON RF.RDB$FIELD_SOURCE = FL.RDB$FIELD_NAME'+
' LEFT JOIN RDB$CHARACTER_SETS CS ON FL.RDB$CHARACTER_SET_ID =
CS.RDB$CHARACTER_SET_ID'+
' WHERE RF.RDB$RELATION_NAME=:nomTabla AND RF.RDB$FIELD_NAME=:nomCampo'+
' ORDER BY RF.RDB$FIELD_POSITION';
ModuloDatos.qAccionSql.SQL.Text:=lcSql;
ModuloDatos.qAccionSql.Params.ParamByName('nomTabla').AsString:=lcTabla;
ModuloDatos.qAccionSql.Params.ParamByName('nomCampo').AsString:=lcCampo;
Saludos y Gracias,
Pancho
Córdoba
Argentina
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus-es/attachments/20150813/ec007061/attachment-0002.html>
More information about the Lazarus-es
mailing list