Skip to content

Instantly share code, notes, and snippets.

@viggin543
Created April 28, 2023 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viggin543/fcad64875f272dd2c2239b84e668c497 to your computer and use it in GitHub Desktop.
Save viggin543/fcad64875f272dd2c2239b84e668c497 to your computer and use it in GitHub Desktop.
get table schema
SELECT c.COLUMN_NAME name, c.DATA_TYPE type
FROM INFORMATION_SCHEMA.COLUMNS c,
INFORMATION_SCHEMA.TABLES t
WHERE t.TABLE_NAME = c.TABLE_NAME
AND t.TABLE_SCHEMA = c.TABLE_SCHEMA
and c.TABLE_NAME = ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment