Subject Re: [ib-support] Generating a external table
Author Lele Gaifax
>>>>> clementdoss l'ha dit:

clementdoss> Hello, I am working out some external table samples
clementdoss> for a project. Is it possible to generate a
clementdoss> "NEWLINE" character in ISQL? Could a query like
clementdoss> 'INSERT INTo EXT_TBL VALUES
clementdoss> ('NAME','LAST','20030310', <NewLine> )' be created?
clementdoss> I have tried some trivial things like
clementdoss> 'char(13)+char(10)', '\n' , a smallint field with
clementdoss> 1013 inside... Is there a way of doing this?

Yes, I use this very simple and effective trick:

CREATE TABLE LOG$Warnings EXTERNAL FILE '/tmp/WinsipexDB_Warnings.txt'
( Ora CHAR(20),
Sep1 CHAR(1) DEFAULT '@',
Livello CHAR(1),
Sep2 CHAR(1) DEFAULT ':',
Riferimento CHAR(20),
Messaggio CHAR(255),

CRLF SMALLINT DEFAULT 2573 NOT NULL
);

You can see the last field: it's default value, decimal 2573, is the
equivalent of the pair of char (CR/LF). You can now just

INSERT INTO LOG$Warnings (Ora, Livello, Riferimento)
VALUES (CAST('NOW' AS DATE), '1', 'Error')

Hope this helps,
ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
email: lele@... | -- Fortunato Depero, 1929.