ora 00907 missing right parenthesis during an update statement

Error: ora 00907 missing right parenthesis during an update statement

the custid in cust_rds table has data in string like p0037,p106 etc.gcdb_source_key and gcdb_source_key_org in customer table is in number,so trying to gcdb_source_key,gcdb_source_key_org to string and trying to do an insert ,but here i get missing right parenthesis at to_c

UPDATE Customer c
SET
   (
      c.city
    , c.description
    , c.state
    , c.postal_code_1
    , c.address_1
    , to_char(c.gcdb_source_key)
    , to_char(c.gcdb_source_key_org)
    , c.true_gcdb_source_key
   )  =
(SELECT 
      cr.city
    , cr.name
    , cr.sub_cntry
    , cr.postl_code
    , cr.stret_addr_line_1
    , cr.cust_id
    , cr.cust_id
    , cr.cust_id
FROM cust_rds cr
WHERE cr.cust_id = c.true_gcdb_source_key)
WHERE c.true_gcdb_source_key IS NOT NULL
AND c.true_gcdb_source_key IN (SELECT cust_id FROM cust_rds);

CREATE TABLE CUSTOMER
(
  CLASS                 VARCHAR2(40 BYTE)       DEFAULT 'TEMPORARY',
  CREATED               DATE                    DEFAULT sysdate               NOT NULL,
  CITY                  VARCHAR2(40 BYTE),
  COUNTRY               VARCHAR2(40 BYTE),
  CUST_CUST_ID          NUMBER(10),
  DESCRIPTION           VARCHAR2(40 BYTE),
  STATE                 VARCHAR2(40 BYTE),
  DS_DS_ID              NUMBER(10)              NOT NULL,
  EXPIRES               DATE,
  POSTAL_CODE_1         VARCHAR2(20 BYTE),
  POSTAL_CODE_2         VARCHAR2(20 BYTE),
  ADDRESS_1             VARCHAR2(40 BYTE),
  ADDRESS_2             VARCHAR2(40 BYTE),
  SOURCE_KEY            VARCHAR2(15 BYTE),
  CUST_ID               NUMBER(10)              NOT NULL,
  SECONDARY_SOURCE_KEY  VARCHAR2(15 BYTE),
  GCDB_SOURCE_KEY       NUMBER(10),
  GCDB_SOURCE_KEY_ORG   NUMBER(10),
  TRUE_GCDB_SOURCE_KEY  VARCHAR2(20 BYTE)

 )


CREATE TABLE CUST_RDS
(
  CUST_ID             VARCHAR2(15 BYTE)         NOT NULL,
  TRADE_CHANL_ID      VARCHAR2(15 BYTE),
  NAME                VARCHAR2(30 BYTE)         NOT NULL,
  LONG_NAME           VARCHAR2(60 BYTE),
  LONG_DESC           VARCHAR2(2000 BYTE),
  STRET_ADDR_LINE_1   VARCHAR2(30 BYTE),
  STRET_ADDR_LINE_2   VARCHAR2(30 BYTE),
  CITY                VARCHAR2(30 BYTE),
  SUB_CNTRY           VARCHAR2(30 BYTE),
  POSTL_CODE          VARCHAR2(10 BYTE),
  ISO_CNTRY_NUM       VARCHAR2(3 BYTE),
  STTUS_CODE          VARCHAR2(1 BYTE),
  DELET_DATE          DATE,
  CUST_ACCT_GRP_CODE  VARCHAR2(4 BYTE)          NOT NULL,
  TRNSP_ZONE          VARCHAR2(30 BYTE)
  )

Answers


You can't use to_char() like that, in the middle of your set clause. If you want to apply a function to one of the values you are setting, it belongs in the select clause, not the set.


Need Your Help

Data filteration based on regular monthly basis

oracle hadoop filter hive

I want to filter the data according to my requirement in Hive or oracle

SVG rotation in IE (all) fails

javascript internet-explorer animation svg

I have an SVG animation that requires a spinning element. SMIL and css based animations are out of the question as IE does not support them and the beginElement() property is also not supported in ...