Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Unable to execute DBMS_DATAPUMP.ADD_FILE

Re: Unable to execute DBMS_DATAPUMP.ADD_FILE

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Mon, 22 Jan 2007 17:05:12 GMT
Message-ID: <JCA4sy.JMq@igsrsparc2.er.usgs.gov>


sjoshi wrote:
> Hello All
> I'm unable to use the ADD_FILE procedure from .NET. I can seem to get
> others to work but I think I'm passing arguments incorrecty. The
> message I get is:
>
> Message: ORA-06550: line 1, column 15:
> PLS-00306: wrong number or types of arguments in call to 'ADD_FILE'
> ORA-06550: line 1, column 7:
>
> These are the arguments to be passed:
>
> /*ParameterName: HANDLE
> Direction: Input
> OleDbType: Decimal
> ParameterName: FILENAME
> Direction: Input
> OleDbType: Varchar2
> ParameterName: DIRECTORY
> Direction: Input
> OleDbType: Varchar2
> ParameterName: FILESIZE
> Direction: Input
> OleDbType: Varchar2
> ParameterName: FILETYPE
> Direction: Input
> OleDbType: Decimal, KU$_FILE_TYPE_DUMP_FILE CONSTANT BINARY_INTEGER
> := 1*/
>
> //This is what I tried:
> //code snippet
>
> OracleDecimal odec = new OracleDecimal(jobHandle);
> OracleDecimal odecFileType = new OracleDecimal(1);
>
> cmd.CommandText = "DBMS_DATAPUMP.ADD_FILE";
>
> cmd.Parameters.Add("HANDLE", OracleDbType.Decimal,
> ParameterDirection.Input).Value = odec.Value;
> cmd.Parameters.Add("FILENAME", OracleDbType.Varchar2,
> ParameterDirection.Input).Value = dumpFile;
> cmd.Parameters.Add("DIRECTORY", OracleDbType.Varchar2,
> ParameterDirection.Input).Value = dumpDirObj;
> cmd.Parameters.Add("FILESIZE", OracleDbType.Varchar2,
> ParameterDirection.Input).Value = string.Empty;
> cmd.Parameters.Add("FILETYPE", OracleDbType.Decimal,
> ParameterDirection.Input).Value = odecFileType.Value;
>
> cmd.ExecuteNonQuery();
>
> Any hints are greatly appreciated.
>
> thanks
> Sunit
>

Did you look at the documentation?

http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_datpmp.htm#i997139

It looks like you have the correct number of parameters defined in your code. The only thing I would change would be the datatype. Instead of DECIMAL, consider NUMBER.

HTH,Brian

-- 
===================================================================

Brian Peasland
dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Received on Mon Jan 22 2007 - 11:05:12 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US