[MDEV-27194] Describe for Dynamic SQL in Stored Routines Created: 2021-12-07 Updated: 2021-12-13 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Stored routines |
| Fix Version/s: | None |
| Type: | Task | Priority: | Critical |
| Reporter: | Anders Karlsson | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Oracle supports the DBMS_SQL package which allows dynamic SQL with describing SQL statement in and out parameters to support fully dynamic SQL. There are much metadata that can be gotten from a SQL statement though, which would require a lot of functions to be implemented for this in MariaDB. My suggestion is instead to create just one statement to describe a prepared SQL statement and that the output of this is a JSON struct that contains all relevant data. For example:
Where the JSON in sql_desc describes the returned data:
|
| Comments |
| Comment by Sergei Golubchik [ 2021-12-13 ] |
|
we'll likely also want FORMAT=JSON for consistency. and table (not json) output |