in reply to Re: Storing a variable in a file and processing within the script
in thread Storing a variable in a file and processing within the script

Note that a placeholder in SQL is usually only allowed where the query engine can still create a full query plan and compile+check the query with it. This usually precludes the use of placeholders for column, table or schema names, as the validity of the query cannot be checked when the value for the placeholder is only known at a later stage.

  • Comment on Re^2: Storing a variable in a file and processing within the script

Replies are listed 'Best First'.
Re^3: Storing a variable in a file and processing within the script
by rjt (Curate) on Jul 17, 2013 at 15:38 UTC

    It's fine in this case, since the placeholder is for a column value. Even though the $table_name is the thing in question, he apparently has a table full of table names to query against. Good reminder, though.