I want alter an external table in redshift. If execute this query:
alter table "name_table"
set location 'a string' ||
TO_CHAR((getdate()-1)::date, 'YYYYMMDD') || '/';
give me a syntax error:
SQL Error [500310] [42601]: Amazon Invalid operation: syntax error at or near "||" Position: 135;
Maybe I must use dynamic SQL but I'm not sure how do that. Can someone help me?
EDIT: I try to use a procedure for alter an external table, this doesn't give me a syntax error but return an error like this:
You can't alter an external table with function or procedure.