| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Error ORA-06502
Hello,
Why the following Stored Procedure shows me Error as follows -
"ORA-06502: PL/SQL: numeric or value error: character to number
conversion error
ORA-06512: at line 1"
I am calling this stored procedure from VB 2005
PROCEDURE sp_dbservdate (p_dbservdate OUT CHAR) IS
dbservdate1 CHAR (20);
BEGIN
dbservdate1 := '';
SELECT TO_CHAR (SYSDATE, 'YYYY/MM/DD HH:MM:SS')
INTO dbservdate1
FROM DUAL;
p_dbservdate := dbservdate;
END sp_dbservdate;
The calling function of VB 2005 as follows
Public Function DBServDate() As String
'
DBServDate = ""
Try
Dim dteServDate As String = ""
Dim cmDataInit As New OleDbCommand
cmDataInit.Parameters.Clear()
'
cmDataInit.Parameters.Add("P_DBSERVDATE", DbType.String,
20).Direction = ParameterDirection.Output
'
cmDataInit.CommandType = CommandType.StoredProcedure
cmDataInit.CommandText = "DB_GLOBAL.SP_DBSERVDATE"
'
ConnectData() '
function to open cnData connection object
cmDataInit.Connection = cnData
cmDataInit.ExecuteNonQuery() ' at this line
the error shows
DisconnectData()
'
DBServDate =
CType(cmDataInit.Parameters("P_DBSERVDATE").Value, String)
'
Catch eEx As System.Data.OleDb.OleDbException
blnHasError = True
strErrorMsg = eEx.Message
'
Catch ex1 As Exception
'
blnHasError = True
strErrorMsg = ex1.Message
End Try
Thanks
Nitin. Received on Fri Nov 17 2006 - 03:07:39 CST
![]() |
![]() |