开发者

Incorrect number of arguments for PROCEDURE

Have not worked with ASP in a very long time and have never dealt with stored procedures. I am sure this is grade 1 stuff.

Help will be appreciated. Thank you very much.

Have a stored procedure in MYSQL:

CREATE PROCEDURE `insert_custdetails`(IN p_Email VARCHAR(100), 
IN p_Fname VARCHAR(50), IN p_Lname VARCHAR(50), 
IN p_IP VARCHAR(40), IN p_OS VARCHAR(10), 
IN p_Browser VARCHAR(20), 
OUT ID INTEGER(11))
    NOT DETERMINISTIC
    CONTAINS SQL
    SQL SECURITY DEFINER
    COMMENT ''
BEGIN
INSERT INTO
  `customerdetails`(
  Email,
  Fname,
  Lname,
  IP,
  OS,
  Browser)
VALUES(
  p_Email,
  p_Fname,
  p_Lname,
  p_IP,
  p_OS,
  p_Browser);


Set ID = LAST_INSERT_ID();

END;

Then My Code in ASP:

SQL="CALL insert_custdetails ('1'," & _
    "'2'," & _
    "'3'," & _
    "'4'," & _
    "'5'," & _
    "'6');"
If Database(SQL) Then
    Response.Write Rs("ID")
End IfError is:

The Result

-2147467259: 
[MySQL][ODBC 5.1 Driver][mysqld-5.1.34开发者_JAVA技巧-community]Incorrect 
number of arguments for PROCEDURE mytable.insert_custdetails; 
expected 7, got 6  

What exactly do I need to do to declare that 7th parameter? How do I get it?


http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.parameters.aspx

You should be using a SQLCommand and parameter properties. The link shows example.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜