0

我正在努力找出错误的来源。这是我的插入语句。

INSERT INTO dimension_tab
SELECT
TRUNC(DBMS_RANDOM.value(low = > 1, high => 3)) AS fact_1_id,
TRUNC(DBMS_RANDOM.value(low = > 1, high => 6)) AS fact_2_id,
TRUNC(DBMS_RANDOM.value(low = > 1, high => 11)) AS fact_3_id,
TRUNC(DBMS_RANDOM.value(low = > 1, high => 11)) AS fact_4_id,
ROUND(DBMS_RANDOM.value(low = > 1, high => 100), 2) AS sales_value
FROM dual
CONNECT BY level <= 1000;

这是我得到的错误

TRUNC(DBMS_RANDOM.value("low" = > 1, high => 3)) AS fact_1_id,
                          *
ERROR at line 3:
ORA-00907: missing right parenthesis

请告诉我哪里出错了。

4

2 回答 2

5

运算符是=>,不是= >

于 2013-05-06T12:07:34.453 回答
2

You're misusing DBMS_RANDOM.value with parameters; use

TRUNC(DBMS_RANDOM.value(1, 3)) AS fact_1_id,

Example Took from this Reference

于 2013-05-06T12:08:31.677 回答