|
|
Archives of the TeradataForum
Message Posted: Fri, 02 Feb 2007 @ 23:12:05 GMT
Subj: | | Re: Named pipes with Fastload |
|
From: | | Takahashi, Takashi |
> Does anybody have a Fastload script using named pipes?
Here is an example of Fastload script along with a Fastexport script. Run the fastload script first - reader must run first and wait for a
writer, then run Fastexport script to write data to the pipe.
<Fastload script>
SESSIONS 4;
SET SESSION CHARSET 'WIN936_6R0' ;
ERRLIMIT 1000;
LOGON xxx/xxx, xxx;
DROP TABLE wrk_xxx.Latin_GB2312;
DROP TABLE wrk_xxx.Err1Latin_GB2312;
DROP TABLE wrk_xxx.Err2Latin_GB2312;
CREATE SET TABLE wrk_xxx.Latin_GB2312 ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT
(
Id INTEGER,
Description VARCHAR(10) CHARACTER SET UNICODE NOT CASESPECIFIC,
CharData VARCHAR(50) CHARACTER SET UNICODE NOT CASESPECIFIC)
UNIQUE PRIMARY INDEX ( Id );
BEGIN LOADING wrk_xxx.Latin_GB2312
ERRORFILES wrk_xxx.Err1Latin_GB2312, wrk_xxx.Err2Latin_GB2312
INDICATORS;
axsmod c:\Windows\System32\np_AXSMOD.dll "fallback_directory=c:\";
DEFINE
field0(INTEGER),
field1(VARCHAR(10)),
field2(VARCHAR(50))
File=\\.\pipe\Latin_GB2312 ;
SHOW;
INSERT INTO wrk_xxx.Latin_GB2312
(
Id,
Description,
CharData
)
VALUES
(
:field0,
:field1,
:field2
)
;
END LOADING;
LOGOFF;
<Fastexport script>
.LOGTABLE utillog;
.LOGON xxx/xxx,xxx;
.BEGIN EXPORT
SESSIONS 4;
.EXPORT
OUTFILE \\.\pipe\Latin_GB2312
FORMAT FASTLOAD
MODE INDICATOR ;
SELECT * from xxx.Latin_GB2312 ;
.END EXPORT;
.LOGOFF;
Tak T
Teradata San Diego
| |