2011-02-28 60 views
-1

任何一个可以更正下面的语句吗?plpgsql函数文本串联错误

strdir := 'copy ' 
      || t_name.relname 
      || ' from E'''' || C: || ''''' 
      || t_name.relname || '''.txt'' using delimiters '|''; 
+0

什么问题?只需计算报价。使用荧光笔更容易,但... – GolezTrol 2011-02-28 13:41:42

+0

错误是线1:... rom E''''|| C:||'''''|| $ 2 ||'''。txt''使用分隔符'|'' – kallem 2011-02-28 13:56:47

回答

0

我认为最后|周围的单引号应该是每两个单引号。

+0

我试过我得到follwoing错误“错误:操作符不存在:文本|未知 行1:... E''''|| C:||'''''|| $ 2 ||'''.txt''使用分隔符'''|''''“ – kallem 2011-02-28 13:59:57

1
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 |