Uncategorized

Error ORA-00922: missing or invalid option when run sql in python (cx_ocracle)


my sql file run ok on Sql Developer, but ORA-00922: missing or invalid option in python code, please help me

alter session set current_schema = sys_dwh_prd--REPLICATE_USER
;
SELECT CMS FROM
(
SELECT DISTINCT 1 AS seq, acct.account_number, 'CUST' || '|' || cust.customer_number 
--                   ,acct.account_number
                   || '|' || to_char(cust.customer_number) --AS additional_field_01 -- CIF
                   || '|' || cust.full_name --additional_field_02 -- Fullname
                   || '|' || cust.gender --additional_field_03 -- gender
                   || '|' || to_char(cust.birthday, 'DD/MM/YYYY') --additional_field_04 -- birthday
                   || '|' || cust.mobile_number --additional_field_05 -- mobile_number
                   || '|' || nvl(cust.email, '') --additional_field_06 -- email
                   || '|' || '' --additional_field_07
                   || '|' || '' --additional_field_08
                   || '|' || 'I' --additional_field_09 --customerType default 'I'
                   || '|' || '' --additional_field_10
                   || '|' || '' --additional_field_11
                   || '|' || '' --additional_field_12
                   || '|' || '' --additional_field_13
                   || '|' || '' --additional_field_14
                   || '|' || '' --additional_field_15
                   || '|' || '' --additional_field_16
                   || '|' || '' --additional_field_17
                   || '|' || '' --additional_field_18
                   || '|' || '' --additional_field_19
                   || '|' || '' --additional_field_20
                   || '|' || '' --additional_field_21
                   || '|' || '' --additional_field_22
            AS CMS
    FROM   dw_account_dim acct
    INNER  JOIN dw_customer_dim cust
    ON     cust.customer_id = acct.customer_id
           AND acct.status != 'ACSTCLSD'
    LEFT   JOIN dw_application_dim app
    ON     cust.app_customer_id = app.app_customer_id
           AND acct.account_number = app.account_number
    LEFT   JOIN dw_employee_dim emp
    ON     app.created_by_staff_code = emp.staff_code
           AND emp.active = 1
    WHERE  to_char(cust.card_reg_date, 'YYYYMMDD') >= to_char(SYSDATE, 'YYYYMMDD')
           OR to_char(cust.card_last_modify_date, 'YYYYMMDD') >= to_char(SYSDATE, 'YYYYMMDD')

UNION ALL

ORA-00922: missing or invalid option [73440] Failed to execute script
‘BOT_GET_FILE_BOD2’ due to unhandled exception!



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *