Subject Re: [ib-support] Generating a external table
Author Marco Bommeljé
Hello Clementdoss, Lele,

I use this external table definition, watch the newline column closely

CREATE TABLE Dba_Log EXTERNAL FILE '\TEMP\DBA_LOG.TXT'
(
Seq_no CHAR(12),
Inserted_on CHAR(26) DEFAULT '',
Line CHAR(127) DEFAULT '<empty>',
Newline CHAR(2) DEFAULT '
'
);

It works, but I will now change it to Lele's solution.

Cheers,
Marco

Lele Gaifax wrote:
> >>>>> 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.
>
>
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
> <http://rd.yahoo.com/M=246920.2960106.4328965.2848452/D=egroupweb/S=1705115386:HM/A=1481646/R=0/*http://www.gotomypc.com/u/tr/yh/cpm/grp/300_flake/g22lp?Target=mm/g22lp.tmpl>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/>.

--
-------------------------------------
-- Marco Bommeljé
-- Bommeljé Crompvoets en partners bv
-- W: www.bcp-software.nl
-- E: mbommelj@...
-- T: +31 (0)30 2428369
-------------------------------------