<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY>
<DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=624521917-13062006>Hello 
All,</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=624521917-13062006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=624521917-13062006>I have the 
need to spawn two processes within Perl and was wondering if someone can show me 
the way.</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=624521917-13062006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=624521917-13062006>One process 
open() a named pipe and the other runs "sqlldr <A 
title=mailto:user/pass@database 
href="BLOCKED::mailto:user/pass@database">user/pass@database</A> 
control=controlfile.ctl etc...".&nbsp; The problem I am having is, when I 
attempt to "open(NP, "&gt; $namedPipe")" before executing sqlldr, the program 
hangs at "open()" so I can't continue with the program to execute sqlldr 
process.&nbsp; If I start sqlldr first, then open(), sqlldr does not read in the 
data from the open().</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=624521917-13062006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=624521917-13062006>Here 
is&nbsp;my test program:</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=624521917-13062006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=624521917-13062006>&nbsp; 
$pipeFile = "/tmp/$d_tblName";<BR>&nbsp; unless (-p $pipeFile) 
{<BR>&nbsp;&nbsp;&nbsp; print "$pipeFile does not 
exist.\n";<BR>&nbsp;&nbsp;&nbsp; unless (mkfifo($pipeFile, 0777)) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "Can't mknod $pipeFile: 
$!\n";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp; }</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=624521917-13062006>#############################################################################<BR># 
COMMENTS: Connect to the source database and prepare the SQL statement to 
#<BR>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start 
fetching the data to send to the named 
pipe.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
#<BR>#############################################################################<BR>&nbsp; 
$s_dbh = sub_connect($s_dbDriver, $INSTANCE, $DBUSER, $DBPASS);<BR>&nbsp; 
$s_dbh-&gt;{RowCacheSize} = 500;<BR>&nbsp; ($stmtType, $s_sqlString) = 
sub_readSQLFile(qq{$SQLDIR/$SQL});<BR>&nbsp; $s_sth = sub_prepare($s_dbDriver, 
$s_dbh, qq{$s_sqlString});<BR>&nbsp; $s_sth = sub_execute($s_dbDriver, $s_dbh, 
$s_sth);<BR>&nbsp; $cnt = 0;</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=624521917-13062006>###############################################################################<BR># 
COMMENTS: Open the named pipe file and start writing to it with the fetched 
#<BR>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; data from the 
source 
database.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
#<BR>###############################################################################<BR>&nbsp; 
print STDERR "Opening $pipeFile file to begin writing data.\n";<BR>&nbsp; open 
(FIFO, "&gt; $pipeFile") or die 
"$!\n";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<STRONG><FONT color=#ff0000>&lt;================= It hangs right 
here.</FONT></STRONG><BR>&nbsp; print STDERR "Entering while loop to fetch the 
source data.\n";<BR>&nbsp; while ($row = $s_sth-&gt;fetchrow_arrayref()) 
{<BR>&nbsp;&nbsp;&nbsp; die "Pipe file disappeared.\n" unless -p 
$pipeFile;<BR>&nbsp;&nbsp;&nbsp; #printf(STDERR "%s\n", join($delim, @$row)) if 
($DEBUG);<BR>&nbsp;&nbsp;&nbsp; printf(FIFO "%s\n", join($delim, 
@$row));<BR>&nbsp;&nbsp;&nbsp; $cnt++;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; print 
STDERR "We are done with while loop.&nbsp; Closing named pipe.\n";<BR>&nbsp; 
close(FIFO);<BR>&nbsp; print "Removing named pipe: $pipeFile\n";<BR>&nbsp; print 
"Unable to delete $pipeFile.\n" unless (unlink($pipeFile));</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=624521917-13062006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=624521917-13062006>So my 
question is, is there a way to force Perl to continue after the open() statement 
so that I can execute "sqlldr" statement to start receiving data from the named 
pipe?</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=624521917-13062006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=624521917-13062006>Thanks in 
advance.</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=624521917-13062006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=624521917-13062006>Sincerely,</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=624521917-13062006></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=624521917-13062006>Peter 
</SPAN></FONT></DIV></DIV></BODY></HTML>