You guys are just amazing.
Doug
A. Razzak Memon wrote:
At 12:50 PM 4/12/2011, Frank Taylor wrote:
We have a new customer that wants a flat file sent to them with
the fields separated by the | (Pipe) symbol and no quotes. I
thought this was going to be very simple, but I am having an
issue where it is giving me blank (No separator) instead of |
Here is the command I am using
gateway export Tab p:\durgin.txt select * from quotetable option
COL_NAMES ON | separator |
If I change it to Separator #, then that works as does other symbols.
I tried putting the quotes around the pipe '|' symbol but still no
luck. Any suggestions ? This is RB V9.1
Frank,
Did you know that you can use the keyword "PIPE" as a separator for
pipe symbol?
Here's how:
-- Example 01:
GATEWAY EXPORT TAB G:\Durgin.txt SELECT * FROM QuoteTable +
OPTION COL_NAME ON | SEPARATOR PIPE
LAUNCH G:\Durgin.txt
RETURN
-- Example 02:
IF (CVAL('DATABASE')) <> 'RRBYW17' OR (CVAL('DATABASE')) IS NULL THEN
CONNECT RRBYW17 IDENTIFIED BY NONE
ENDIF
SET VAR vCommand TEXT = NULL
SET VAR vFileName TEXT = 'Customer.txt'
SET ERROR MESSAGE 2077 OFF
DELETE .vFileName
SET ERROR MESSAGE 2077 ON
SET VAR vCommand = +
('GATEWAY EXPORT TAB'&.vFileName& +
'SELECT * FROM Customer'& +
'OPTION COL_NAME ON | SEPARATOR PIPE')
&vCommand
CLS
LAUNCH .vFileName
CLEAR VARIABLE vCommand
RETURN
That's all there is to it!
Very Best R:egards,
Razzak.