<small id='d7hUn'></small><noframes id='d7hUn'>

    <legend id='d7hUn'><style id='d7hUn'><dir id='d7hUn'><q id='d7hUn'></q></dir></style></legend>
  • <i id='d7hUn'><tr id='d7hUn'><dt id='d7hUn'><q id='d7hUn'><span id='d7hUn'><b id='d7hUn'><form id='d7hUn'><ins id='d7hUn'></ins><ul id='d7hUn'></ul><sub id='d7hUn'></sub></form><legend id='d7hUn'></legend><bdo id='d7hUn'><pre id='d7hUn'><center id='d7hUn'></center></pre></bdo></b><th id='d7hUn'></th></span></q></dt></tr></i><div id='d7hUn'><tfoot id='d7hUn'></tfoot><dl id='d7hUn'><fieldset id='d7hUn'></fieldset></dl></div>

      1. <tfoot id='d7hUn'></tfoot>
          <bdo id='d7hUn'></bdo><ul id='d7hUn'></ul>

        检查字符串是否为有效日期

        时间:2023-11-02
          <bdo id='u1g8P'></bdo><ul id='u1g8P'></ul>

            • <small id='u1g8P'></small><noframes id='u1g8P'>

                <tbody id='u1g8P'></tbody>
              <tfoot id='u1g8P'></tfoot>
              <i id='u1g8P'><tr id='u1g8P'><dt id='u1g8P'><q id='u1g8P'><span id='u1g8P'><b id='u1g8P'><form id='u1g8P'><ins id='u1g8P'></ins><ul id='u1g8P'></ul><sub id='u1g8P'></sub></form><legend id='u1g8P'></legend><bdo id='u1g8P'><pre id='u1g8P'><center id='u1g8P'></center></pre></bdo></b><th id='u1g8P'></th></span></q></dt></tr></i><div id='u1g8P'><tfoot id='u1g8P'></tfoot><dl id='u1g8P'><fieldset id='u1g8P'></fieldset></dl></div>

                <legend id='u1g8P'><style id='u1g8P'><dir id='u1g8P'><q id='u1g8P'></q></dir></style></legend>
                  本文介绍了检查字符串是否为有效日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个带有 sourcefilename 字段的表,它有 5 条记录.以下是记录.

                  I have a table with field sourcefilename which has 5 records. Following are the records.

                  SN. SOURCEFILENAME
                  1. 20170215095453_1.Iredell Memorial Hospital Dental Eligibility.xls_INFREPT01.txt
                  2. Iredell Memorial Hospital Eligibility April 2017.xls_INFREPT01.txt
                  3. Iredell Memorial Hospital Eligibility March 2017.xls_INFREPT01.txt
                  4. Iredell Memorial Hospital Eligibility May 2017.xls_INFREPT01.txt
                  5. Iredell Memorial Hospital October 2016 Dental Eligibility.xls_EligData.txt
                  

                  我只需要提取前 8 个字符并检查其是否为有效日期.如果它是一个有效日期,则返回 TRUE,否则返回 FALSE.

                  I just need to extract first 8 characters and check if its a valid date. If it is a valid date then return TRUE else FALSE.

                  我尝试过 ISDATE 函数.还有其他选择吗?

                  I tried ISDATE function. Is there are any other alternatives?

                  SELECT DISTINCT SubStr(sourcefilename,1,8),
                  CASE WHEN isdate(SubStr(sourcefilename,1,8),'YYYYMMDD') = 1 THEN 'TRUE' ELSE 'FALSE' END  FROM ai_4451_1_metl;
                  

                  推荐答案

                  Oracle 12.2 提供了一个新功能 VALIDATE_CONVERSION.到目前为止,我从未使用过它,但我认为它会是这样的:

                  Oracle 12.2 provides a new function VALIDATE_CONVERSION. So far I never used it, but I assume it would be like this:

                  CASE VALIDATE_CONVERSION(SubStr(sourcefilename,1,8) AS DATE, 'YYYYMMDD') 
                     WHEN 1 THEN 'TRUE'
                     ELSE 'FALSE'
                  END
                  

                  这篇关于检查字符串是否为有效日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:SQL 语句中不允许使用本地集合类型 下一篇:如何将 Oracle PL/SQL 包中的电子邮件发送给多个收件人?

                  相关文章

                      <bdo id='R0mbh'></bdo><ul id='R0mbh'></ul>
                  1. <legend id='R0mbh'><style id='R0mbh'><dir id='R0mbh'><q id='R0mbh'></q></dir></style></legend>
                  2. <small id='R0mbh'></small><noframes id='R0mbh'>

                  3. <tfoot id='R0mbh'></tfoot>

                    <i id='R0mbh'><tr id='R0mbh'><dt id='R0mbh'><q id='R0mbh'><span id='R0mbh'><b id='R0mbh'><form id='R0mbh'><ins id='R0mbh'></ins><ul id='R0mbh'></ul><sub id='R0mbh'></sub></form><legend id='R0mbh'></legend><bdo id='R0mbh'><pre id='R0mbh'><center id='R0mbh'></center></pre></bdo></b><th id='R0mbh'></th></span></q></dt></tr></i><div id='R0mbh'><tfoot id='R0mbh'></tfoot><dl id='R0mbh'><fieldset id='R0mbh'></fieldset></dl></div>