.NETGURU
Oracle stored procedure with an out parameter with VB.NET
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-oledb' list.


Wally McClure
-- Copied from [aspngdata] to [ngfx-oledb] by Charles M. Carroll <Click here to reveal e-mail address> --I am trying to call a stored procedure in Oracle that contains an outparameter. Here is my code: Dim oledbCn As OleDbConnection Dim oledbCm As OleDbCommand Dim strCn As String = "Provider=OraOleDb.Oracle;DataSource=dotnet_localhost.wallymdevelopment.com;UserId=usruser;PassWord=usruser;" Dim strSql As String = "sp_tblidentity_insert_new" Try oledbCn = New OleDbConnection(strCn) oledbCm = New OleDbCommand(strSql, oledbCn) oledbCm.CommandType = CommandType.StoredProcedure oledbCm.Parameters.Add("OutVal", OleDbType.Numeric, 10) oledbCm.Parameters("OutVal").Direction =ParameterDirection.Output oledbCm.Parameters.Add("myvalin", OleDbType.VarChar, 50) oledbCm.Parameters("myvalin").Direction =ParameterDirection.Input oledbCm.Parameters("myvalin").Value = "Hello" oledbCn.Open() oledbCm.ExecuteNonQuery() MessageBox.Show(oledbCm.Parameters("OutVal").Value) Catch oledbEx As System.Data.OleDb.OleDbException MessageBox.Show(oledbEx.Message.ToString()) Finally oledbCn.Close() End TryHere is the stored procedure:CREATE OR REPLACE SP_TBLIDENTITY_INSERT_NEW (myvalin IN VARCHAR2, OutVal out NUMBER) ASnSeqVal NUMBER;BEGIN SELECT sq_tblIdentity_new.nextval INTO nSeqVal FROM dual; INSERT INTO tblidentity_usr( tblIdentityId, fieldvalue ) VALUES(nSeqVal, myvalin); COMMIT; OutVal:= nSeqVal;END;I receive the following error message:Ora-01401: INSERTED VALUE TOO LARGE FOR COLUMNOra-06512: at "USRUSER.SP_TBLIDENTITY_INSERT_NEW", line 8ORA-06512: at line 1I have tried to change the size of the parameters that are inserted withno luck. Does anyone have any ideas as to why this is occurring and howto fix it?WallyMcClure Development865-693-3004118 Durwood Rd.Knoxville, TN 37922
Reply to this message...
 
    
Wally McClure
Never mind folks. I got this to work. The problem is that decided to
look at someone else's code. When I went back to my SQL Server code and
ported it to Oracle, it almost worked. I just needed a small change.
It works perfectly now!!!!!!!!!!!!

Wally

McClure Development
865-693-3004
118 Durwood Rd.
Knoxville, TN 37922

[Original message clipped]

Reply to this message...
 
 
System.Data.CommandType
System.Data.OleDb.OleDbCommand
System.Data.OleDb.OleDbConnection
System.Data.OleDb.OleDbException
System.Data.OleDb.OleDbType
System.Data.ParameterDirection
System.Windows.Forms.MessageBox




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification