in reply to writing to and reading from fifo

Two things make me wonder. You write

I can get the writer to print the line to stdout but sqlloader just hangs.

Your code

print $fifo "$categories{$ky}#";
doesn't print lines (unless there are line feeds embedded in $categories{$ky}), but you are using line oriented <STDIN> to read the data. That may lead to unexpected blocking.

Second, as far as I understand sqlldr, your command

"sqlldr control=atpctl.ctl data=atp_fifo.dat userid=someu +ser/pwd log=loader.log"
will try to read data from the disk file "atp_fifo.dat". I don't see how that file is connected to the pipe output.

Anno

Replies are listed 'Best First'.
Re^2: writing to and reading from fifo
by f00li5h (Chaplain) on Mar 26, 2007 at 10:15 UTC

    ++Anno does speak wisdom on this subject.

    All the binaries in $ORACLE_HOME/bin (that I used, with Oracle 10G) refused to read/write STDIN/STDOUT they would tend to take their configuration from files on the disk...

    I ended up generating the config files with templates, and writing them in /tmp with a unique filename. I wish I'd used File::Temp

    @_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;
      yes this approach does work but I cant understand why i cant read the named pipe to sqlldr from within the program.. iam sure something is blocking somewhere ... back to the manuals i guess ;+)
        A named pipe, written by your program and read by sqlldr, should work. Whether that's a good solution in your situation I don't know.

        Anno