Inner queries are returning more than one row

SELECT 
    FORM_OF_PAYMENT_CD paymentMethod,   
    DECODE (CC_TYPE_CD, 'V', 'VS', 'M', 'MC', 'A', 'AM', 'D', 'DC', NULL) paymentSubMethod,
    PAYMENT_AMOUNT amount,
    LPAD(SUBSTR(trim(PCI_PKG.D_CC(op.CC_NUMBER, 654916320742196284)),
    LENGTH(trim(PCI_PKG.D_CC(op.CC_NUMBER, 654916320742196284)))-3),
    LENGTH(trim(PCI_PKG.D_CC(op.CC_NUMBER, 654916320742196284))) , '*') ccNumber,
    CC_EXP_DATE ccExpirationDate,
    IAI.ADDRESS addressLine1,
    IAI.ZIP zipCode,
    IAI.ZIP_EXTENSION zip4Code,
    DECODE(ORM.EPP_CHANNEL_ID, NULL, NULL, (ORM.EPP_CHANNEL_ID ||'^'   || ORM.EPP_ACTOR_ID   ||'^'   || OP.EPP_TOKEN_ID   ||'^'   || OP.EPP_TOKEN_TYPE   ||'^'   ||       (
        SELECT DISTINCT AUTH.EPP_PAYMENT_ID
        FROM OEMADM.AUTHORIZATION_INFO AUTH
        WHERE AUTH.ORDER_KEY= OP.ORDER_KEY   )) ) eppPaymentInfo,
    (SELECT AI.AUTH_CODE
     FROM AUTHORIZATION_INFO AI
     WHERE AI.PAYMENT_TYPE_CD = op.PAYMENT_TYPE_CD
       AND AI.ORDER_KEY = op.ORDER_KEY
       AND AI.AUTH_TYPE_CD = 'PRE' ) AUTHORIZATION_CODE,
    (SELECT AI.AUTH_STATUS_DESC
     FROM AUTHORIZATION_INFO AI
     WHERE AI.PAYMENT_TYPE_CD = op.PAYMENT_TYPE_CD  
       AND AI.ORDER_KEY = op.ORDER_KEY
       AND AI.AUTH_TYPE_CD = 'PRE' ) PRE_AUTHORIZATION_MSG,
    (SELECT UPDATED_DT   
     FROM SETTLEMENT_REFUND_RESP   
     WHERE TRANSACTION_TYPE_CODE = 'SET'   
       AND PAYMENT_TYPE_CD ='DQP'   
       AND ORDER_KEY = OP.ORDER_KEY   ) REQUEST_DATE ,
    OP.PAYMENT_TYPE_CD paymentTypeCode 
FROM 
    OEMADM.ORDER_PAYMENTS OP,   
    OEMADM.IDENT_ADDRESS_INFO IAI,   
    OEMADM.ORDER_MASTER ORM 
WHERE 
    OP.ORDER_KEY           = 'ow-srso-229451126' 
AND ORM.ORDER_KEY          = OP.ORDER_KEY 
AND IAI.IDENT_ADDR_INFO_ID = OP.PAYER_ADDR_INFO_ID

Above query is not executing because

inner queries are returning more than one row.


Source: oracle

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.