When using adoquery of Delphi to connect to the Oracle database, NOTE: When SQL contains multiple case when, you must add an arc. Otherwise, an exception or CPU debugging will be reported directly.
The problem is very strange. If the same SQL statement is placed in PL/SQL, it can be executed without an arc. It seems that the adoquery that can be executed in PL can also be used.
SQL example
Select. marc_rec_no, (Case marc_use_flag when '1' order 'when' 2' then' to be edited 'when' 3' then' edited 'when' 4' then' 'end) as marc_use_flag, marc_type, cata_oper, cata_date, lang_code, doc_type_code, m_call_no, m_title, m_author, m_publisher, m_pub_year, m_isbn, B. asord_no, get_mode_code, carrier_code, publ_freq, kind_no, (Case peri_type when '0' then' normal publication 'when' 1 'then' renamed publication 'when' 2 'then' discontinued publication 'when' 3 'then' stopped publication 'end) as peri_type, peri_ord_qty, peri_price, peri_total_price, remark, (Case ord_flag when '0' then' unordered 'when' 1 'then' ordered 'end') as ord_flag from Marc, peri_ord_detl B where. marc_rec_no = B. marc_rec_no and B. peri_ord_cata_id = '4be9f5ba819749c984ce13d922e22c87'