annu
annu

Reputation: 103

Getting error ORA-00909: invalid number of arguments

CREATE VIEW ITCC.release_testcase_count 
AS 
(
SELECT CONCAT(rtm.requirement_id,'-',tct.release_id) AS id,
       rtm.requirement_id AS requirement_id,
       tct.release_id AS release_id, 
       COUNT(tct.release_id) AS testcase_count
from testcase_version tcv 
  INNER JOIN tcr_catalog_tree_testcase tct ON tcv.id = tct.testcase_version_id 
  LEFT JOIN requirement_testcase_mapping rtm ON rtm.testcase_id=tcv.testcase_id
GROUP BY tct.release_id , rtm.requirement_id
);

same query is working for ms sql and my sql without any syntax error. i want to execute it in oracle as well but i am getting error for the same

Upvotes: 0

Views: 6981

Answers (1)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 521073

The Oracle CONCAT function only takes two, not three or more, parameters. Instead of using CONCAT, just use the concatenation operator:

CREATE VIEW ITCC.release_testcase_count AS (
    SELECT rtm.requirement_id || '-' || tct.release_id AS id,
    ...
)

Or, if you really want to use CONCAT here, then you may chain them together:

CREATE VIEW ITCC.release_testcase_count AS (
    SELECT CONCAT(rtm.requirement_id, CONCAT('-', tct.release_id)) AS id,
    ...
)

Upvotes: 4

Related Questions