MySQL Forums
Forum List  »  Newbie

Re: Using a global variable in a DECLARE statement
Posted by: Peter Brawley
Date: August 20, 2021 09:19PM

SQL is by design an incomplete computer language, so the answers are 1:no, 2:no, and generally, it's not designed for data-driving database object names.

In a relational database, the usual method for what you're trying to do is to carry a key date column in the table (obviating the need to create a new table for each distinct date).

And, BTW, Cursors are for those rare cases where row-by-row processing is unavoidable; are you sure you need that cursor, straight SQL will be much much faster.

Options: ReplyQuote


Subject
Written By
Posted
Re: Using a global variable in a DECLARE statement
August 20, 2021 09:19PM


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.