I am update the record using trigger.
Am tried
CREATE OR REPLACE FUNCTION fn_trg_sales2()
RETURNS trigger AS
$BODY$ declare
xNarr text='';
select name into xNarr from t1 where id =1;
update t2 set narration =E narration || case when narration ='' then xNarr else
'\n' || xNarr end where id=1
return null;
end;
$BODY$
above procedure show error.
How to use escape character in this update query using variable?
How to use escape character with variable?. Don't suggest with out variable using escape character.
Am using postgresql 9.1
EDIT
I get information form some command so i update like this in my trigger
update t2 set narration =narration || case when narration ='' then xNarr else
quote_literal('\n') || xNarr end where id=1
Now it show in table in two lines but its end and start with '.
like
narration
this is first'
'this is second
how to store with out single qutoation?