Can I use symbols for the table names in a database? For instance,
$tablename
%tablename
I tested with a select query and they seems OK but I haven’t seen anyone done that before so just want to know if it is safe to do.
SELECT * FROM $tablename // returns result.
SELECT * FROM %tablename // returns result.
See documentation on valid identifiers.. You can use these, however you will need to quote any table or column name containing
%(at least according to the documentation).$is valid in unquoted identifiers, but%is not.So, it is generally safe to do so, but you’ll need to be consistent with quoting identifiers like