Inappropriate ioctl for device

Hi,
We are running a perl script to upload some data using SQL* Loader. We pipe the data in a http request to SQL*Loader which loads the data to the database. We encounter the error "Inappropirate ioctl for device" when we try to upload huge data. Any solution would be greatly appreciated.
Thanks,
Jai

Could you be more specific? It seems as though you are trying to invoke sqlldr interactively. This error can happen when you try to invoke an interactive utility like sqlldr in a scripted fashion.

You can use a here document to invoke sqlldr with the interactive prompts:

{
sqlldr username/password <<EOF
... answers to your prompts...
EOF
}

sqlldr doesn't require interaction though so you can provide all the necessary information on the command line.

sqlldr username/password control=ctl_file.ctl data=data_file.dat

Hi tmarikle,
Thanks a lot for your input. Now i am using dat file instead of piping. The maximum available buffer size for piping causes the issue and now i write to a file and then give that file as input to the sqlldr. Please find below the code.

Before:
$rc = 0xfff & system ("echo \"$if_admin\"|$ORACLE_HOME/bin/sqlldr userid=$USER/$PASSWD control=cfg/IF_ADMIN.ctl bad=/dev/null discard=/dev/null log=$LOGDIR/$interface.int.log > /dev/null");

After:
$rc = 0xfff & system("$ORACLE_HOME/bin/sqlldr userid=$USER/$PASSWD data=$LOGDIR/myAdmin.log control=cfg/IF_ADMIN.ctl bad=/dev/null discard=/dev/null log=$LOGDIR/$interface.int.log > /dev/null");

I use myAdmin.log as the input file to sqlldr.

Thanks,
Jai

One point for consideration. Your user ID and password are going to be revealed to anyone running "ps". You may want to devise a way for concealing the password. There are several methods for doing so. You can pipe the password into sqlldr, you can create a named pipe PARFILE, or you can use the here document as described earlier.

Thomas

Hey..that's a good catch. But since our servers are very much secured i hope this should not be a big deal. But i will implement the idea that you suggest. Thanks a lot dude!!
Jai