Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-3047

Cannot get right result using prepare statement with dynamic parameters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • sql-cmp
    • None

    Description

      prepare s1 from SELECT (SELECT 'Y'
      FROM dual
      WHERE EXISTS (SELECT 1
      FROM dic
      WHERE std_area_id = dom.std_area_id)) impact_yn

      , (SELECT cd_nm
      FROM code
      WHERE lang_cd = 'zh_CN'
      AND up_cd_id = '6023'
      AND cd_id = dom.dom_type_cd) dic_gbn_nm
      FROM dom
      WHERE dom.std_area_id = ?
      AND dom.dom_type_cd = '0003';

      execute s1 using '4C6A337943';

      can not get result with prepare statement. But can get the get the right result with following statement.

      prepare s1 from SELECT (SELECT 'Y'
      FROM dual
      WHERE EXISTS (SELECT 1
      FROM dic
      WHERE std_area_id = dom.std_area_id)) impact_yn

      , (SELECT cd_nm
      FROM code
      WHERE lang_cd = 'zh_CN'
      AND up_cd_id = '6023'
      AND cd_id = dom.dom_type_cd) dic_gbn_nm
      FROM dom
      WHERE dom.std_area_id = '4C6A337943'
      AND dom.dom_type_cd = '0003';

       

      Attachments

        Activity

          People

            andyyangcn Yang, Yongfeng
            andyyangcn Yang, Yongfeng
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: