开发者

plpgsql function text concatenation error

开发者 https://www.devze.com 2023-02-14 02:12 出处:网络
Can any one correct below statement? strdir := \'copy \' t_na开发者_StackOverflow社区me.relname

Can any one correct below statement?

strdir := 'copy '
          || t_na开发者_StackOverflow社区me.relname
          || ' from E'''' || C: || '''''
          || t_name.relname || '''.txt'' using delimiters '|'';


strdir := 'copy '
          || t_name.relname
          || ' from E''C:"'  -- one ' to many here, included C:, which had no '
                             -- and I suspect you need a double quote here "
          || t_name.relname
          || '".txt'' using delimiters ''|'''; -- closing ", double ' around |


I think the single quotes around the last | should be two single quotes each.

0

精彩评论

暂无评论...
验证码 换一张
取 消