这是用于 Excel 的 Invantive Control。
什么可能导致第二个 CREATE TABLE 出现错误?
CREATE TABLE niveau1@inmemorystorage
AS
SELECT ID
, Code
, AddressLine1
, Name
, Parent
FROM Accounts
WHERE ID=$P{P_ACCOUNTID}
CREATE TABLE niveau2@inmemorystorage
AS
SELECT ID
, Code
, AddressLine1
, Name
, Parent
FROM Accounts
WHERE Parent IN (SELECT ID FROM niveau1@inmemorystorage)
CREATE TABLE niveau3@inmemorystorage
AS
SELECT ID
, Code
, AddressLine1
, Name
, Parent
FROM Accounts
WHERE Parent IN (SELECT ID FROM niveau2@inmemorystorage)
SELECT * FROM niveau1@inmemorystorage
UNION ALL
SELECT * FROM niveau2@inmemorystorage
UNION ALL
SELECT * FROM niveau3@inmemorystorage