Hi list,
When working with e.g. multiline SQL statements, sometimes I want to copy them to a string in Lazarus, e.g from something like: const
SQL =
with this on the clipboard:
SELECT
c.colid as recno,
o.name as TableName,
c.name as FieldName,
c.colorder as FieldPosition,
t.name as FieldType,
c.scale as FieldScale,
c.prec as FieldPrecision,
c.isnullable as FieldNull
FROM sys.syscolumns c
INNER JOIN sys.sysobjects o ON c.id = o.id
INNER JOIN sys.systypes t ON c.xtype = t.xtype and c.usertype=t.usertype WHERE (o.type='V' or o.type='U') and o.name='MEDEWERKERS' ORDER BY o.name, c.colorder
to something like:
Const
SQL =
'SELECT'+
'c.colid as recno,'+
'o.name as TableName,'+
'c.name as FieldName,'+
'c.colorder as FieldPosition,'+
't.name as FieldType,'+
'c.scale as FieldScale,'+
'c.prec as FieldPrecision,'+
'c.isnullable as FieldNull'+
'FROM sys.syscolumns c'+
'INNER JOIN sys.sysobjects o ON c.id = o.id'+
'INNER JOIN sys.systypes t ON c.xtype = t.xtype and c.usertype=t.usertype'+
'WHERE (o.type='V' or o.type='U') and o.name=''MEDEWERKERS'''+
'ORDER BY o.name, c.colorder';I.e. indenting, appending quotes and + sign, and escaping existing quotes. (In this case, it's SQL and having an extra space at the end of the line before the closing quote would be even nicer but that's something of a special case)
Is that possible in Lazarus?
Thanks,
Reinier
