创建返回 SQL 查询的函数时出现问题

Issue in creating a Function returning a SQL Query

我目前正在尝试在 oracle Apex 中创建一个函数来 return SQL 查询,我的代码中似乎有一些错误。谁能看一下,看看有什么问题。

  RETURN
'SELECT 1, LAN_ID label,'||
'   '#'              target,'||
'    NULL          is_current_list_entry,'||
'   'http://orig03.deviantart.net/efa6/f/2015/200/5/6/anon_icon_thinger_by_arofexdracona-d920vda.png'    image,'|| 
'    NULL             image_attribute,'||
'    NULL             image_alt_attribute,'||
'    'left'           attribute1,'||
'    'fa-clock-o'     attribute2,'||
'    DATE_POSTED      attribute3,'||
'    RESPONSE         attribute4'||
'from CHAT_RESPONSE'||
'where LAN_ID IS NOT NULL'||
'order by DATE_POSTED DESC;'||

以正确的方式引用 ' 并将结尾的 || 替换为 ;:

RETURN
'SELECT 1, LAN_ID label,'||
'  ''#''              target,'||
'    NULL          is_current_list_entry,'||
'  ''http://orig03.deviantart.net/efa6/f/2015/200/5/6/anon_icon_thinger_by_arofexdracona-d920vda.png''    image,' || 
'    NULL             image_attribute,'||
'    NULL             image_alt_attribute,'||
'  ''left''           attribute1,'||
'  ''fa-clock-o''     attribute2,'||
'    DATE_POSTED      attribute3,'||
'    RESPONSE         attribute4'||
'  from CHAT_RESPONSE'||
' where LAN_ID IS NOT NULL'||
' order by DATE_POSTED DESC;';

... 并在 fromwhere.

之前添加一些空格