<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>

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

        Check String of characters is a valid date or not(检查字符串是否为有效日期)
          <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
                  

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

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to redirect the output of DBMS_OUTPUT.PUT_LINE to a file?(如何将 DBMS_OUTPUT.PUT_LINE 的输出重定向到文件?)
                  How do I get column datatype in Oracle with PL-SQL with low privileges?(如何使用低权限的 PL-SQL 在 Oracle 中获取列数据类型?)
                  Get a list of all functions and procedures in an Oracle database(获取 Oracle 数据库中所有函数和过程的列表)
                  Why cannot I create triggers on objects owned by SYS?(为什么我不能在 SYS 拥有的对象上创建触发器?)
                  Returning result even for elements in IN list that don#39;t exist in table(即使对于表中不存在的 IN 列表中的元素也返回结果)
                  Reset Sequence in oracle 11g(oracle 11g 中的重置序列)

                      <bdo id='R0mbh'></bdo><ul id='R0mbh'></ul>
                        <tbody id='R0mbh'></tbody>
                      <legend id='R0mbh'><style id='R0mbh'><dir id='R0mbh'><q id='R0mbh'></q></dir></style></legend>
                    • <small id='R0mbh'></small><noframes id='R0mbh'>

                      <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>