1
do
$xyz$
declare
y text;
i record;
begin
y := to_char(current_timestamp, 'YYYYMMDDHHMMSS');
raise notice '%',y;
execute 'CREATE TEMP TABLE someNewTable'
||y
||' AS select * from (VALUES(0::int,-99999::numeric), (1::int, 100::numeric)) as t (key, value)';
for i in (select * from someNewTable||y) loop
raise notice '%',i.key;
end loop;
end;
$xyz$ language 'plpgsql'
ERROR: syntax error at or near "||"
LINE 13: for i in (select * from someNewTable||y) loop
我不明白爲什麼錯誤在PIPE符號。請幫幫我。我一直在Oracle數據庫中嘗試,但同樣的錯誤。我在這裏做錯了什麼?在Postgresql中動態創建TEMP TABLE並在FOR循環中選擇相同的表。但得到PIPE符號附近的錯誤
請張貼甲骨文代碼來獲取有關Oracle的幫助。如果只是關於Postgres的問題,請刪除Oracle標籤。 – Aleksej