Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MaxDB - Everything about MaxDB, formerly known as SAP DB
MySQL++ - Programming with the C++ API to MySQL
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
ODBC - ODBC with the MySQL Connector/ODBC driver
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
More Stored Procedure Issues

More Stored Procedure Issues

2006-07-04       - By Jesse

 Back
VB is not case sensitive, so changing the case didn't make any difference.

I'm still getting the same non-sensical error message.

Jesse

-- -- Original Message -- --
From: "DG @ NEFACOMP" <dg@(protected)>
To: "Jesse" <jlc@(protected)>; "MySQL . Net List" <dotnet@(protected)>
Sent: Tuesday, July 04, 2006 10:23 AM
Subject: Re: More Stored Procedure Issues


> On my side your code works (in C#) but I had to change one line
>        Cmd.Parameters.Add("?cInvNo",MySQLDBType.VarChar)
>
> I changed it to:
>         Cmd.Parameters.Add("?cInvNo", MySqlDbType.VarChar)
> (The difference is on the casing of <<<MySqlDbType>>>)
>
>
>
> Hope this helps
> Emery
> -- -- Original Message -- --
> From: "Jesse" <jlc@(protected)>
> To: "MySQL . Net List" <dotnet@(protected)>
> Sent: Tuesday, July 04, 2006 15:20
> Subject: More Stored Procedure Issues
>
>
>> OK, same SP, different problem.  I did some very minor editing of my SP,
>> and got rid of some space between parameters, and moved a parenthesis,
>> made sure that my user had Execute permissions for SP's, and now, I'm
>> getting a different error.  I get the error, "42000Incorrect number of
>> arguments for PROCEDURE bpa.sp_GetNextInv; expected 2, got 0", which
>> makes absolutely no sense to me, because I HAVE defined 2
>> parameters....!!!! Here is my ASP.Net code:
>>
>> <%@ Import Namespace="System.Data"%>
>> <Script Runat="Server">
>> function GetNextInv(nChapterID As Integer) As String
>>   Dim Cmd As MySQLCommand, Conn AS MySQLConnection
>>
>>   Conn = OpenConn
>>
>>   Cmd = New MySQLCommand("sp_GetNextInv", Conn)
>>   Cmd.CommandType = CommandType.StoredProcedure
>>
>>   Cmd.Parameters.Add("?nChapterID",nChapterID)
>>   Cmd.Parameters("?nChapterID").Direction = ParameterDirection.Input
>>   Cmd.Parameters.Add("?cInvNo",MySQLDBType.VarChar)
>>   Cmd.Parameters("?cInvNo").Direction = ParameterDirection.Output
>>
>>   Cmd.ExecuteNonQuery()
>>
>>   GetNextInv = CStr(Cmd.Parameters("?cInvNo").Value)
>>
>>   Cmd=Nothing
>>   Conn.Close
>>   Conn=Nothing
>>
>> end function
>> </script>
>>
>> here is the stored procedure:
>>
>> CREATE PROCEDURE `sp_GetNextInv`(
>> in nChapterID Int,
>> out cInvNo VarChar(7)
>> )
>> BEGIN
>> Declare cPrefix VarChar(1);
>> Declare cNextInv VarChar(7);
>> Set cInvNo = '';
>>
>> IF nChapterID > 0 THEN
>>  SELECT TempInvNo INTO cInvNo FROM Chapters WHERE ID=nChapterID;
>> END IF;
>>
>> IF (cInvNo = '') or (cInvNo IS NULL) THEN
>>    SELECT NextInvoiceNo INTO cInvNo FROM Config;
>>  SET cNextInv = Right('0000000' + CONVERT(CONVERT(cInvNo, UNSIGNED) + 1,
>> CHAR), 7);
>>    UPDATE Config SET NextInvoiceNo=cNextInv;
>>    IF nChapterID = -1 THEN
>>       Set cInvNo = CONCAT('L',Right(CONCAT('000000',cInvNo),6));
>>  END IF;
>>    IF nChapterID = -2 THEN
>>       Set cInvNo = CONCAT('C',Right(CONCAT('000000',cInvNo),6));
>>  END IF;
>>    IF nChapterID > 0 THEN
>>   SELECT CT.InvPrefix INTO cPrefix FROM ChapterType CT, Chapters C
>>    WHERE C.ID=nChapterID AND CT.ChapterType=C.ChapterType;
>>      Set cInvNo = CONCAT(cPrefix,Right(CONCAT('000000',cInvNo),6));
>>       UPDATE Chapters SET TempInvNo=cInvNo WHERE ID=nChapterID;
>>  END IF;
>> END IF;
>> END
>>
>> If anyone has any clue why it's telling me I haven't defined parameters
>> when I have, I would greatly appreciate it.
>>
>> Thanks,
>> Jesse
>>
>> --
>> MySQL on .NET Mailing List
>> For list archives: http://lists.mysql.com/dotnet
>> To unsubscribe:    http://lists.mysql.com/dotnet?unsub=dg@(protected)
>>
>>
>>
>


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=mysql@(protected)