MySQL Forums
Forum List  »  Stored Procedures

Re: how to set the execution for specified number of rows in stored procedures
Posted by: Roland Bouman
Date: November 03, 2005 04:45AM

What I think is happening is that in the context of @ variables in mysql (user global variable) the = operator acts as an equals operator, not an assignment operator.
Test that by doing:

CALL `northwind_dbo`.`Employee Sales by Country`(
'1996-01-01'
,'1999-01-01'
)

So, just pass the literals and if that does not work, use STR_TO_DATE (look it up) to convert the literals first to datatimes explicitly:

CALL `northwind_dbo`.`Employee Sales by Country`(
STR_TO_DATE('01/01/1996', '%m/%d/%Y')
,STR_TO_DATE('01/01/1999', '%m/%d/%Y')
)

If that works, you will know it was the @var=lit syntax bugging you.

Now, what I'd like to mention is you could probable do it like this:

CALL `northwind_dbo`.`Employee Sales by Country`(
@Beginning_Date := '1996-01-01'
, @Ending_Date := '1999-01-01'
)

so, just use the := instead of the =.

Please let me know if it works. I think that this is a very cool way to call the procedure, because it shows the intended parameter assignments explicitly. So, good one. Pls. let me know!



`(@Beginning_Date='1996-01-01', @Ending_Date='1999-01-01')

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: how to set the execution for specified number of rows in stored procedures
1710
November 03, 2005 04:45AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.