in reply to Re^2: using stdin with sqlldr
in thread using stdin with sqlldr
Perl:LOAD DATA INFILE '\\.\pipe\sql_pipe\' REPLACE INTO TABLE my_table FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' (col1,col2,col3,col4)
Note: the pipe in the open was just a leftover from my first attempt... You could remove that and do something more sensible for launching sqlldr...use strict; use Win32::Pipe; $|=1; # autoflush for messages my $pipe_name = "sql_pipe"; my $pipe = new Win32::Pipe($pipe_name)|| die "Can't Create Named Pipe: + $!\n"; open(my $ldr,"|sqlldr.exe a/b\@c control=control.ctl log") || die "Unable to execute sqlldr: $!"; $pipe->Connect(); #... do something interesting to get data, and probably loop $pipe->Write(join(",",$1,$2,$3,$4)."\n"); #... $pipe->Disconnect(); $pipe->Close(); close $ldr;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: using stdin with sqlldr
by chuckd (Scribe) on Nov 20, 2008 at 01:39 UTC | |
by cmdrake (Acolyte) on Nov 22, 2008 at 20:45 UTC | |
|
Re^4: using stdin with sqlldr
by chuckd (Scribe) on Dec 03, 2008 at 20:10 UTC |