首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将oracle迁移到PostgreSQL时出现错误:“ERROR:语法错误在或靠近"@”第16行: from csm016@fbi a,csm013@fbi b“

将oracle迁移到PostgreSQL时出现错误:“ERROR:语法错误在或靠近"@”第16行: from csm016@fbi a,csm013@fbi b“
EN

Stack Overflow用户
提问于 2020-12-04 15:38:46
回答 1查看 39关注 0票数 0
代码语言:javascript
复制
CREATE OR REPLACE FUNCTION ecs_pkg.get_busi_type ( acct_no_in text, cont_no_in text, p_message OUT text ) AS $body$
DECLARE

    V_SEQ_NO varchar(6);
    v_date_time_crte timestamp:=clock_timestamp();
    w_cust_type varchar(5);
    w_count integer;

BEGIN
    RAISE NOTICE 'write_notepad start';
    w_cust_type := 'NIL';

    -- verify account number and check for customer type ( VOICE or DATA )
    select count(*), max(t.cust_type) into STRICT w_count, w_cust_type
    from (SELECT 'VOICE' as cust_type
          from csm016@fbi a, csm013@fbi b
          where a.acct_no = acct_no_in and a.cont_no = cont_no_in
          and b.acct_no = a.acct_no
          and b.acct_catg in ('B','BT','C','CB','CR','G','GK','IB','IC','L','MB','MC','ME','VB','VG','Z')

union

          SELECT 'DATA' as cust_type
          from dcsm016@fbi a, dcsm013@fbi b
          where a.acct_no = acct_no_in and a.cont_no = cont_no_in
          and b.acct_no = a.acct_no
          and b.busi_code in ('BBS','DATA','METRONET')
          
union

          select 'ISP' as cust_type
          from icsm016@fbi a, icsm013@fbi b
          where a.acct_no = acct_no_in and a.cont_no = cont_no_in
          and b.acct_no = a.acct_no
          ) t;

    --//if w_count = 0 then
    --//    return -2;
    --//end if;
    p_message := w_cust_type;
END;


$body$
LANGUAGE PLPGSQL
 STABLE;
EN

回答 1

Stack Overflow用户

发布于 2020-12-04 17:34:43

@fbi指的是名为fbi的非本地数据库。Postgres不支持此语法。您可能希望研究dblink来实现外部表。

诚挚的问候,

比亚尔尼

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65139635

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档