MySQL Forums
Forum List  »  Stored Procedures

Re: set the value of AS clause name in stored procedure
Posted by: Terry Warren
Date: December 26, 2020 08:43AM

Peter Brawley Wrote:
-------------------------------------------------------
> Simplest possible example given table t(i,j)...
>
>
> set @sql = "select i as 'first column',j as
> 'second column' from t";
> prepare stmt from @sql;
> execute stmt;
> +--------------+---------------+
> | first column | second column |
> +--------------+---------------+
> |            2 |             2 |
> +--------------+---------------+
> drop prepare stmt;
>
>
> In your case you'd concat strings as required to
> assemble @sql.

thanks for this added response; using this technique I was able to do exactly what I wanted to. thanks again.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: set the value of AS clause name in stored procedure
32
December 26, 2020 08:43AM


Sorry, only registered users may post in this forum.

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.