Skip to content
Advertisement

Type introspection in mysql query

Is there a function in mysql that tells what type the evaluated expression/column/literal is in a query? I don’t mean the information schema, but something like:

And I would get something llike:

This is mainly for debugging purposes.

Advertisement

Answer

No, there’s no function for what you’re describing.

The closest thing to what you’re talking about is using the MySQL client with the --column-type-info option to display result set metadata.

But that wouldn’t help you if you’re using SQL programmatically.

Output:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement