MySQL Forums
Forum List  »  Stored Procedures

Re: Passing value beteen declared variables within cursor loop
Posted by: Peter Brawley
Date: March 17, 2016 09:52AM

Quote

Thus, even though user declared variables are 'variables', forgetting FETCH, they can only be changed/updated as being treated like a data field using the SET x = 7, rather than a programming act like x = 7.

Interesting, looks like the database type override a programming language assignment operator. I think Oracle PL/SQL has more of a programming language that is not bounded by DB structures... I think.

Yes, Set is required to set a variable to a value.

By design, SQL is an incomplete programming language. It's meant mainly to manage sets, not vectors or scalars.

It appears your problem has a SQL solution. You can use If() and Coalesce() functions to handle contingencies like null values.

Options: ReplyQuote




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.