【问题标题】:Comparison of regexp_replace and regexp_substr variablesregexp_replace 和 regexp_substr 变量的比较
【发布时间】:2018-12-18 05:57:24
【问题描述】:

我在比较变体时遇到问题。

当我使用表达式 regexp_replaceregexp_substr 在数据库中执行查询时,我得到了预期的结果并插入到过程中创建的变量中。

SELECT SUBSTR (regexp_substr (regexp_replace (ds_text_macro, '<. *?>'), '@ [^.] *'), Macro_files_w, macro_files_final_w - 1) ds_macro
into retorno_filha_macro_w
FROM config_imp_sumario
WHERE ie_type_summary = 'RESU'
AND upper (ds_macro_reference) LIKE '%' || upper (return_macro_w) || '%';

变量return_film_macro_w 的值是“@blood_pressure”。 当我尝试将此变量与表中具有相同值的字段进行比较时,它什么也找不到。

输入非变量直接值可以正常工作。

为什么我不能比较这种类型的变量?

【问题讨论】:

  • 您使用的是哪个 dbms? (该查询是特定于产品的。)
  • 样本数据和期望的结果真的很有帮助。

标签: sql regexp-replace regexp-substr


【解决方案1】:

Procedure

请看是否更清楚!

在此过程中,我只是获取一些 xml 标记的值。 并与表 res_resultado_patient 进行比较。

变量 return_files_macro_w 返回我'@blood_pressure',res_patient 表的 ds_macro_references 字段也返回我'@blood_pressure',但是游标没有找到任何信息。

table

【讨论】:

    猜你喜欢
    • 2014-05-28
    • 2021-12-26
    • 1970-01-01
    • 2014-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-09
    • 1970-01-01
    相关资源
    最近更新 更多