SQL
INSERT INTO t_publikasi
("idPublikasi","kdBahanPustaka","bulanTerbit", "tahunTerbit", "noUrutBI",
"pdfDir", "judul")
SELECT *
FROM dblink('dbname=perpus2 port=5432 user=dbdev password=develop',
'SELECT '113' || substring("no_pustaka",4,2) as bb ||
substring("no_pustaka",6,2) as cc ||
substring("no_pustaka",9,4) as dd,
'113',
substring("no_pustaka",4,2) as bb,
substring("no_pustaka",6,2) as cc,
substring("no_pustaka",9,4) as dd,
"file_pdf","judul"
FROM kuesioner
ORDER BY bb, cc, dd') AS kuesioner (
id varchar(10),
kd varchar(10),
bln varchar(10),
thn varchar(10),
urut varchar(10),
file_pdf varchar(50),
judul varchar(50));
ОШИБКИ
ERROR: syntax error at or near "113"
LINE 1: ...2 port=5432 user=dbdev password=develop','SELECT '113' || su...
^
ERROR: syntax error at or near "113"
SQL state: 42601