Connecting Tech Pros Worldwide Help | Site Map

Passing large value to Oracle stored procedure

Member
 
Join Date: Nov 2008
Location: UK
Posts: 117
#1: Feb 6 '09
Hi there.

I am writing a C# application and need to pass in a number such as

200003141070 but I'm not sure which datatype to use here as this number is a reference number but cannot be a string value for business reasons.

I am using the System.Data.OracleClient and so when adding a parameter to the stored procedure command call, I am using a line such as:

Expand|Select|Wrap|Line Numbers
  1. comm.Parameters.Add("param1", OracleType.Number).Value = largeValue;
  2.  
Where largeValue is as specified above.

Am I right to use .Number as the type here? Also when returning a value from the respective database column, what would you say is the best primitive type to store this in, as this is too large for an Int32 and the such..?

Thank you.

M :o)
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,500
#2: Feb 7 '09

re: Passing large value to Oracle stored procedure


That number can easily be stored in a number type field in oracle.

in c# you can use int64
Reply


Similar Oracle Database bytes