如何读取excel文件并将数据插入到oracle表中

2023-12-08

我正在使用 oracle 11g。如何使用 plsql 和 oracle forms 读取 excel 文件并将数据插入到 oracle 表中。我对他的主题很陌生。enter code here

i tried https://sites.google.com/site/craigsoraclestuff/oracle-forms-webutil/read-excel-into-forms

我需要简单的正确答案。

如何将此部分插入到程序中:

v_fName := WebUtil_File.File_Open_Dialog(
                  directory_name => 'C:\'
                  ,File_Filter => null
                  ,Title => 'Select Client filename to Open.'
            );

如何获取变量的单元格值。我在这个例子中没有看到它。我只有一张 Excel 工作表。不需要检查工作表的数量。不知道如何自定义所有这些东西。

我需要来自第四列、第五列、第五列和第五行的数据,我希望将第五列与另一个表匹配,并且不匹配分配标志变量“N”,如果匹配则每行的标志变量“y”。


一个名叫安东·谢弗 wrote this允许您直接查询 Excel 文件的软件包(当然是上传到数据库后):

select * from table( as_read_xlsx.read( as_read_xlsx.file2blob( 'DOC', 'Book1.xlsx' ) ) );

  SHEET_NR SHEET_NAME ROW_NR COL_NR CELL  CEL STRING_VAL NUMBER_VAL DATE_VAL
---------- ---------- ------ ------ ----- --- ---------- ---------- --------------------------
         1 Mijn naam       1      1 A1    N                      11
         1 Mijn naam       1      2 B1    N                      12
         1 Mijn naam       1      3 C1    N                      13
         1 Mijn naam       2      1 A2    N                      21
         1 Mijn naam       2      2 B2    N                      22
         1 Mijn naam       2      3 C2    N                      23
         1 Mijn naam       3      1 A3    N                      31
         1 Mijn naam       3      2 B3    N                      32
         1 Mijn naam       3      3 C3    N                      33
         1 Mijn naam       4      4 D4    S   D4
         1 Mijn naam       6      2 B6    D
         1 Mijn naam       7      2 B7    D
         1 Mijn naam       8      2 B8    D
         1 Mijn naam       9      2 B9    D
         1 Mijn naam      10      2 B10   D
         2 Sheet3          2      2 B2    S   Test
         2 Sheet3          3      3 C3    D                         19-JAN-2013 20:17:00
         2 Sheet3          4      1 A4    S   Anton

一些例子

// every sheet and every cell
    select * 
    from table( as_read_xlsx.read( as_read_xlsx.file2blob( 'DOC', 'Book1.xlsx') ) );

// cell A3 from the first and the second sheet
    select *
    from table( as_read_xlsx.read( as_read_xlsx.file2blob( 'DOC', 'Book1.xlsx' ), '1:2', 'A3' ) )

// every cell from the sheet with the name "Sheet3"
    select *
    from table( as_read_xlsx.read( as_read_xlsx.file2blob( 'DOC', 'Book1.xlsx' ), 'Sheet3' ) )

因此,一旦获得查询结果,您就可以根据需要将它们插入表中

这是完整的包:

CREATE OR REPLACE package as_read_xlsx
is
/**********************************************
**
** Author: Anton Scheffer
** Date: 19-01-2013
** Website: http://technology.amis.nl/blog
**
** Changelog:
** 18-02-2013 - Ralph Bieber
                Handle cell type "str" to prevent ORA-06502
                if cell content is a string calculated by formula, 
                then cell type is "str" instead of "s" and value is inside <v> tag
** 19-02-2013 - Ralph Bieber
                Add column formula in tp_one_cell record, to show, if value is calculated by formula 
** 20-02-2013 - Anton Scheffer
                Handle cell types 'inlineStr' and 'e' to prevent ORA-06502
** 19-03-2013 - Anton Scheffer
                Support for formatted and empty strings
                Handle columns per row to prevent ORA-31186: Document contains too many nodes 
** 12-06-2013 - Anton Scheffer
                Handle sharedStrings.xml on older Oracle database versions
** 18-09-2013 - Anton Scheffer
                Fix for LPX-00200 could not convert from encoding UTF-8 to ...
                (Note, this is an error I can't reproduce myself, maybe depending on database version and characterset)
                Thank you Stanislav Safonov for this solution
                Handle numbers with scientific notation
** 20-01-2014 - Anton Scheffer
                Fix for a large number (60000+) of strings
** 16-05-2014 - Anton Scheffer
                round to 15 digits

******************************************************************************
******************************************************************************
Copyright (C) 2013 by Anton Scheffer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

******************************************************************************
*************************************************************************** */
/*
**
** Some examples
**
--
-- every sheet and every cell
    select *
    from table( as_read_xlsx.read( as_read_xlsx.file2blob( 'DOC', 'Book1.xlsx' ) ) )
--
-- cell A3 from the first and the second sheet
    select *
    from table( as_read_xlsx.read( as_read_xlsx.file2blob( 'DOC', 'Book1.xlsx' ), '1:2', 'A3' ) )
--
-- every cell from the sheet with the name "Sheet3"
    select *
    from table( as_read_xlsx.read( as_read_xlsx.file2blob( 'DOC', 'Book1.xlsx' ), 'Sheet3' ) )
--
*/
  type tp_one_cell is record
    ( sheet_nr number(2)
    , sheet_name varchar(4000)
    , row_nr number(10)
    , col_nr number(10)
    , cell varchar2(100)
    , cell_type varchar2(1)
    , string_val varchar2(4000)
    , number_val number
    , date_val date
    , formula varchar2(4000)
  );
  type tp_all_cells is table of tp_one_cell;
--
  function read( p_xlsx blob, p_sheets varchar2 := null, p_cell varchar2 := null )
  return tp_all_cells pipelined;
--
  function file2blob
    ( p_dir varchar2
    , p_file_name varchar2
    )
  return blob;
--
end as_read_xlsx;
/

CREATE OR REPLACE package body as_read_xlsx
is
--
  function read( p_xlsx blob, p_sheets varchar2 := null, p_cell varchar2 := null )
  return tp_all_cells pipelined
  is
    t_date1904 boolean;
    type tp_date is table of boolean index by pls_integer;
    t_xf_date tp_date;
    t_numfmt_date tp_date;
    type tp_strings is table of varchar2(32767) index by pls_integer;
    t_strings tp_strings;
    t_sheet_ids tp_strings;
    t_sheet_names tp_strings;
    t_r varchar2(32767);
    t_s varchar2(32767);
    t_val varchar2(32767);
    t_t varchar2(400);
    t_nr number;
    t_c pls_integer;
    t_x pls_integer;
    t_xx pls_integer;
    t_ns varchar2(200) := 'xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"';
    t_nd dbms_xmldom.domnode;
    t_nd2 dbms_xmldom.domnode;
    t_nl dbms_xmldom.domnodelist;
    t_nl2 dbms_xmldom.domnodelist;
    t_nl3 dbms_xmldom.domnodelist;
    t_one_cell tp_one_cell;
--
    function blob2node( p_blob blob )
    return dbms_xmldom.domnode
    is
    begin
      if p_blob is null or dbms_lob.getlength( p_blob ) = 0
      then
        return null;
      end if;
      return dbms_xmldom.makenode( dbms_xmldom.getdocumentelement( dbms_xmldom.newdomdocument( xmltype( p_blob, nls_charset_id( 'AL32UTF8' ) ) ) ) );
    exception
      when others
      then
        declare
          t_nd dbms_xmldom.domnode;
          t_clob         clob;
          t_dest_offset  integer;
          t_src_offset   integer;
          t_lang_context number := dbms_lob.default_lang_ctx;
          t_warning      integer;
        begin
          dbms_lob.createtemporary( t_clob, true );
          t_dest_offset := 1;
          t_src_offset  := 1;
          dbms_lob.converttoclob( t_clob
                                , p_blob
                                , dbms_lob.lobmaxsize
                                , t_dest_offset
                                , t_src_offset
                                , nls_charset_id('AL32UTF8')
                                , t_lang_context
                                , t_warning
                                );
          t_nd := dbms_xmldom.makenode( dbms_xmldom.getdocumentelement( dbms_xmldom.newdomdocument( t_clob ) ) );
          dbms_lob.freetemporary( t_clob );
          return t_nd;
      end;
    end;
--  
    function blob2num( p_blob blob, p_len integer, p_pos integer )
    return number
    is
    begin
      return utl_raw.cast_to_binary_integer( dbms_lob.substr( p_blob, p_len, p_pos ), utl_raw.little_endian );
    end;
--  
    function little_endian( p_big number, p_bytes pls_integer := 4 )
    return raw
    is
    begin
      return utl_raw.substr( utl_raw.cast_from_binary_integer( p_big, utl_raw.little_endian ), 1, p_bytes );
    end;
--  
    function col_alfan( p_col varchar2 )
    return pls_integer
    is
    begin
      return ascii( substr( p_col, -1 ) ) - 64
           + nvl( ( ascii( substr( p_col, -2, 1 ) ) - 64 ) * 26, 0 )
           + nvl( ( ascii( substr( p_col, -3, 1 ) ) - 64 ) * 676, 0 );
    end;
--  
    function get_file
      ( p_zipped_blob blob
      , p_file_name varchar2
      )
    return blob
    is
      t_tmp blob;
      t_ind integer;
      t_hd_ind integer;
      t_fl_ind integer;
      t_encoding varchar2(10);
      t_len integer;
    begin
      t_ind := dbms_lob.getlength( p_zipped_blob ) - 21;
      loop
        exit when t_ind < 1 or dbms_lob.substr( p_zipped_blob, 4, t_ind ) = hextoraw( '504B0506' ); -- End of central directory signature
        t_ind := t_ind - 1;
      end loop;
--  
      if t_ind <= 0
      then
        return null;
      end if;
--  
      t_hd_ind := blob2num( p_zipped_blob, 4, t_ind + 16 ) + 1;
      for i in 1 .. blob2num( p_zipped_blob, 2, t_ind + 8 )
      loop
        if utl_raw.bit_and( dbms_lob.substr( p_zipped_blob, 1, t_hd_ind + 9 ), hextoraw( '08' ) ) = hextoraw( '08' )
        then
          t_encoding := 'AL32UTF8'; -- utf8
        else
          t_encoding := 'US8PC437'; -- IBM codepage 437
        end if;
        if p_file_name = utl_i18n.raw_to_char
                           ( dbms_lob.substr( p_zipped_blob
                                            , blob2num( p_zipped_blob, 2, t_hd_ind + 28 )
                                            , t_hd_ind + 46
                                            )
                           , t_encoding
                           )
        then
          t_len := blob2num( p_zipped_blob, 4, t_hd_ind + 24 ); -- uncompressed length
          if t_len = 0
          then
            if substr( p_file_name, -1 ) in ( '/', '\' )
            then  -- directory/folder
              return null;
            else -- empty file
              return empty_blob();
            end if;
          end if;
--  
          if dbms_lob.substr( p_zipped_blob, 2, t_hd_ind + 10 ) = hextoraw( '0800' ) -- deflate
          then
            t_fl_ind := blob2num( p_zipped_blob, 4, t_hd_ind + 42 );
            t_tmp := hextoraw( '1F8B0800000000000003' ); -- gzip header
            dbms_lob.copy( t_tmp
                         , p_zipped_blob
                         ,  blob2num( p_zipped_blob, 4, t_hd_ind + 20 )
                         , 11
                         , t_fl_ind + 31
                         + blob2num( p_zipped_blob, 2, t_fl_ind + 27 ) -- File name length
                         + blob2num( p_zipped_blob, 2, t_fl_ind + 29 ) -- Extra field length
                         );
            dbms_lob.append( t_tmp, utl_raw.concat( dbms_lob.substr( p_zipped_blob, 4, t_hd_ind + 16 ) -- CRC32
                                                  , little_endian( t_len ) -- uncompressed length
                                                  )
                           );
            return utl_compress.lz_uncompress( t_tmp );
          end if;
--  
          if dbms_lob.substr( p_zipped_blob, 2, t_hd_ind + 10 ) = hextoraw( '0000' ) -- The file is stored (no compression)
          then
            t_fl_ind := blob2num( p_zipped_blob, 4, t_hd_ind + 42 );
            dbms_lob.createtemporary( t_tmp, true );
            dbms_lob.copy( t_tmp
                         , p_zipped_blob
                         , t_len
                         , 1
                         , t_fl_ind + 31
                         + blob2num( p_zipped_blob, 2, t_fl_ind + 27 ) -- File name length
                         + blob2num( p_zipped_blob, 2, t_fl_ind + 29 ) -- Extra field length
                         );
            return t_tmp;
          end if;
        end if;
        t_hd_ind := t_hd_ind + 46
                  + blob2num( p_zipped_blob, 2, t_hd_ind + 28 )  -- File name length
                  + blob2num( p_zipped_blob, 2, t_hd_ind + 30 )  -- Extra field length
                  + blob2num( p_zipped_blob, 2, t_hd_ind + 32 ); -- File comment length
      end loop;
--  
      return null;
    end;
--
  begin
    t_one_cell.cell_type := 'S';
    t_one_cell.sheet_name := 'This doesn''t look like an Excel (xlsx) file to me!';
    t_one_cell.string_val := t_one_cell.sheet_name;
    if dbms_lob.substr( p_xlsx, 4, 1 ) != hextoraw( '504B0304' )
    then
      pipe row( t_one_cell );
      return;
    end if;
    t_nd := blob2node( get_file( p_xlsx, 'xl/workbook.xml' ) );
    if dbms_xmldom.isnull( t_nd )
    then
      pipe row( t_one_cell );
      return;
    end if;
    t_date1904 := lower( dbms_xslprocessor.valueof( t_nd, '/workbook/workbookPr/@date1904', t_ns ) ) in ( 'true', '1' );
    t_nl := dbms_xslprocessor.selectnodes( t_nd, '/workbook/sheets/sheet', t_ns );
    for i in 0 .. dbms_xmldom.getlength( t_nl ) - 1
    loop
      t_sheet_ids( i + 1 ) := dbms_xslprocessor.valueof( dbms_xmldom.item( t_nl, i ), '@r:id', 'xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"' );
      t_sheet_names( i + 1 ) := dbms_xslprocessor.valueof( dbms_xmldom.item( t_nl, i ), '@name' );
    end loop;
    t_nd := blob2node( get_file( p_xlsx, 'xl/styles.xml' ) );
    t_nl := dbms_xslprocessor.selectnodes( t_nd, '/styleSheet/numFmts/numFmt', t_ns );
    for i in 0 .. dbms_xmldom.getlength( t_nl ) - 1
    loop
      t_val := dbms_xslprocessor.valueof( dbms_xmldom.item( t_nl, i ), '@formatCode' );
      if (  instr( t_val, 'dd' ) > 0
         or instr( t_val, 'mm' ) > 0
         or instr( t_val, 'yy' ) > 0
         )
      then
        t_numfmt_date( dbms_xslprocessor.valueof( dbms_xmldom.item( t_nl, i ), '@numFmtId' ) ) := true;
      end if;
    end loop;
    t_numfmt_date( 14 ) := true;
    t_numfmt_date( 15 ) := true;
    t_numfmt_date( 16 ) := true;
    t_numfmt_date( 17 ) := true;
    t_numfmt_date( 22 ) := true;
    t_nl := dbms_xslprocessor.selectnodes( t_nd, '/styleSheet/cellXfs/xf/@numFmtId', t_ns );
    for i in 0 .. dbms_xmldom.getlength( t_nl ) - 1
    loop
      t_xf_date( i ) := t_numfmt_date.exists( dbms_xmldom.getnodevalue( dbms_xmldom.item( t_nl, i ) ) );
    end loop;
    t_nd := blob2node( get_file( p_xlsx, 'xl/sharedStrings.xml' ) );
    if not dbms_xmldom.isnull( t_nd )
    then
      t_x := 0;
      t_xx := 5000;
      loop
        t_nl := dbms_xslprocessor.selectnodes( t_nd, '/sst/si[position()>="' || to_char( t_x * t_xx + 1 ) || '" and position()<=" ' || to_char( ( t_x + 1 ) * t_xx ) || '"]', t_ns );
        exit when dbms_xmldom.getlength( t_nl ) = 0;
        t_x := t_x + 1;
        for i in 0 .. dbms_xmldom.getlength( t_nl ) - 1
        loop
          t_c := t_strings.count;
          t_strings( t_c ) := dbms_xslprocessor.valueof( dbms_xmldom.item( t_nl, i ), '.' );
          if t_strings( t_c ) is null
          then 
            t_strings( t_c ) := dbms_xslprocessor.valueof( dbms_xmldom.item( t_nl, i ), '*/text()' );
            if t_strings( t_c ) is null
            then 
              t_nl2 := dbms_xslprocessor.selectnodes( dbms_xmldom.item( t_nl, i ), 'r/t/text()' );
              for j in 0 .. dbms_xmldom.getlength( t_nl2 ) - 1
              loop
                t_strings( t_c ) := t_strings( t_c ) || dbms_xmldom.getnodevalue( dbms_xmldom.item( t_nl2, j ) );
              end loop;
            end if;
          end if;
        end loop;
      end loop;
    end if;
    t_nd2 := blob2node( get_file( p_xlsx, 'xl/_rels/workbook.xml.rels' ) );
    for i in 1 .. t_sheet_ids.count
    loop
      if ( p_sheets is null
         or instr( ':' || p_sheets || ':', ':' || to_char( i ) || ':' ) > 0
         or instr( ':' || p_sheets || ':', ':' || t_sheet_names( i ) || ':' ) > 0
         )
      then
        t_val := dbms_xslprocessor.valueof( t_nd2, '/Relationships/Relationship[@Id="' || t_sheet_ids( i ) || '"]/@Target', 'xmlns="http://schemas.openxmlformats.org/package/2006/relationships"' );
        t_one_cell.sheet_nr := i;
        t_one_cell.sheet_name := t_sheet_names( i );
        t_nd := blob2node( get_file( p_xlsx, 'xl/' || t_val ) );
        t_nl3 := dbms_xslprocessor.selectnodes( t_nd, '/worksheet/sheetData/row' );
        for r in 0 .. dbms_xmldom.getlength( t_nl3 ) - 1
        loop
          t_nl2 := dbms_xslprocessor.selectnodes( dbms_xmldom.item( t_nl3, r ), 'c' );
          for j in 0 .. dbms_xmldom.getlength( t_nl2 ) - 1
          loop
            t_one_cell.date_val := null;
            t_one_cell.number_val := null;
            t_one_cell.string_val := null;
            t_r := dbms_xslprocessor.valueof( dbms_xmldom.item( t_nl2, j ), '@r', t_ns );
            t_val := dbms_xslprocessor.valueof( dbms_xmldom.item( t_nl2, j ), 'v' );
            -- see Changelog 2013-02-19 formula column 
            t_one_cell.formula := dbms_xslprocessor.valueof( dbms_xmldom.item( t_nl2, j ), 'f' );
            -- see Changelog 2013-02-18 type='str' 
            t_t := dbms_xslprocessor.valueof( dbms_xmldom.item( t_nl2, j ), '@t' );
            if t_t in ( 'str', 'inlineStr', 'e' )
            then
              t_one_cell.cell_type := 'S';
              t_one_cell.string_val := t_val;
            elsif t_t = 's'
            then
              t_one_cell.cell_type := 'S';
              if t_val is not null
              then
                t_one_cell.string_val := t_strings( to_number( t_val ) );
              end if;
            else
              t_s := dbms_xslprocessor.valueof( dbms_xmldom.item( t_nl2, j ), '@s' );
              t_nr := to_number( t_val
                               , case when instr( t_val, 'E' ) = 0
                                   then translate( t_val, '.012345678,-+', 'D999999999' )
                                   else translate( substr( t_val, 1, instr( t_val, 'E' ) - 1 ), '.012345678,-+', 'D999999999' ) || 'EEEE'
                                 end
                               , 'NLS_NUMERIC_CHARACTERS=.,'
                               );
              if t_s is not null and t_xf_date( to_number( t_s ) )
              then
                t_one_cell.cell_type := 'D';
                if t_date1904
                then
                  t_one_cell.date_val := to_date('01-01-1904','DD-MM-YYYY') + to_number( t_nr );
                else
                  t_one_cell.date_val := to_date('01-03-1900','DD-MM-YYYY') + ( to_number( t_nr ) - 61 );
                end if;
              else
                t_one_cell.cell_type := 'N';
                t_nr := round( t_nr, 14 - substr( to_char( t_nr, 'TME' ), -3 ) );
                t_one_cell.number_val := t_nr;
              end if;
            end if;
            t_one_cell.row_nr := ltrim( t_r, rtrim( t_r, '0123456789' ) );
            t_one_cell.col_nr := col_alfan( rtrim( t_r, '0123456789' ) );
            t_one_cell.cell := t_r;
            if p_cell is null or t_r = upper( p_cell )
            then
              pipe row( t_one_cell );
            end if;
          end loop;
        end loop;
      end if;
    end loop;
    return;
  end;
--
  function file2blob
    ( p_dir varchar2
    , p_file_name varchar2
    )
  return blob
  is
    file_lob bfile;
    file_blob blob;
  begin
    file_lob := bfilename( p_dir, p_file_name );
    dbms_lob.open( file_lob, dbms_lob.file_readonly );
    dbms_lob.createtemporary( file_blob, true );
    dbms_lob.loadfromfile( file_blob, file_lob, dbms_lob.lobmaxsize );
    dbms_lob.close( file_lob );
    return file_blob;
  exception
    when others then
      if dbms_lob.isopen( file_lob ) = 1
      then
        dbms_lob.close( file_lob );
      end if;
      if dbms_lob.istemporary( file_blob ) = 1
      then
        dbms_lob.freetemporary( file_blob );
      end if;
      raise;
  end;
--
END as_read_xlsx;
/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何读取excel文件并将数据插入到oracle表中 的相关文章

  • 如何在PL/SQL中模拟32位有符号整数溢出?

    您知道如何在 Oracle PL SQL 中模拟 32 位整数溢出吗 例如 2147483647 1 2147483648 or 2147483648 1 212147483647 我尝试了 PLS INTEGER 但它引发了溢出异常 我终
  • 使用 JDBC 获取 Oracle 11g 的最后插入 ID

    我是使用 Oracle 的新手 所以我将放弃之前已经回答过的内容这个问题 https stackoverflow com questions 3131064 get id of last inserted record in oracle
  • 在实体框架中设置获取大小

    我正在将 ado net 代码转换为使用 EF 在我的 ado net 代码中我设置dataReader FetchSize command RowSize 1000与默认的获取大小相比 这极大 地提高了性能 当我将代码转换为 EF 时 性
  • 浏览多个字段的值并将它们插入到同一列中

    我正在尝试使用重复行为我的 oracle apex 应用程序创建一个功能 假设我有一个车辆表 CREATE TABLE vehicles brand VARCHAR2 50 model VARCHAR2 50 comment VARCHAR
  • 如何使用Oracle在日期和时间之间添加字母“T”?

    我想使用 oracle 在日期和时间之间添加字母 T 像这样 2015 01 01T00 00 00 日期脚本 to char l date generated yyyy mm dd hh24 mi ss 甲骨文文档 http docs o
  • 转置和聚合 Oracle 列数据

    我有以下数据 Base End RMSA Item 1 RMSA Item 2 RMSA Item 3 RMSB Item 1 RMSB Item 2 RMSC Item 4 我想将其转换为以下格式 Key Products RMSA RM
  • 在 PL/SQL 中创建队列订阅者的语法是什么?

    我正在尝试创建一个队列和一个在消息排队时触发的回调 但我无法触发回调 我究竟做错了什么 我有一个将消息入队的触发器 我可以在队列消息表上看到它 我可以手动将其出队并处理它 我只是无法在入队时触发回调 BEGIN DBMS AQADM CRE
  • 金融 - 计算到期收益率

    我读了this https stackoverflow com questions 1173555 open source financial library specifically yield to maturity发布关于 net 库
  • Postgresql存储过程中基于会话的全局变量?

    在 Oracle 的 PL SQL 中 我可以使用包定义创建基于会话的全局变量 对于 Postgresql 的 PLpg SQL 这似乎是不可能的 因为没有包 只有独立的过程和函数 以下是 PL SQL 将 g spool key 声明为全
  • Oracle PL/SQL 将行类型作为构造函数参数传递

    是否可以将 table rowtype 作为构造函数中的参数传递 我有这样的东西 这有效 CREATE OR REPLACE TYPE shape AS OBJECT name VARCHAR2 30 area NUMBER CONSTRU
  • 我可以从匿名 PL/SQL 块向 PHP 返回值吗?

    我正在使用 PHP 和 OCI8 执行匿名 Oracle PL SQL 代码块 有没有什么方法可以让我绑定一个变量并在块完成后获取其输出 就像我以类似的方式调用存储过程时一样 SQL declare something varchar2 I
  • 如何打印Oracle中过程的定义?

    oracle中有没有办法查看过程的结构是什么 我正在尝试记录并运行程序 并希望将实际的程序结构存储在我的日志中 您可以查询ALL SOURCE table SELECT text FROM all source WHERE owner lt
  • 是否允许在流水线 PL/SQL 表函数中使用 SELECT?

    管道函数的文档指出 在 SQL 语句 通常是SELECT 并且在大多数示例中 管道函数用于数据生成或转换 接受客户作为参数 但不发出任何 DML 语句 现在 从技术上讲 可以使用 SELECT 而不会出现 Oracle 中的任何错误 ORA
  • 当我输入 dateadd 或 datediff 代码时,我总是收到此错误“ORA-00904“DATEADD”无效标识符。”

    我有一个大学项目 并且有一个包含入院和出院日期属性的患者表 我需要删除超过 7 年的记录 我使用了以下代码 delete from patient where dis date gt datedadd yy 7 getdate 我收到错误
  • 关于pl/sql异常的问题

    以下文字摘录自oracle文档Oracle Database PL SQL 语言参考 11g 第 1 版 11 1 未处理的异常也会影响 子程序 如果退出子程序 成功后 PL SQL 将值分配给 输出参数 但是 如果您退出 带有未处理的异常
  • ORACLE SQL 中的 MAX()

    我有一个表 存储已完成的维护任务的记录列表以及完成的日期和时间 我正在尝试执行子查询来提取具有最新日期的每个任务的记录 我的SQL语句是 SELECT ENGINEERING COMPLIANCE EO AS EO ENGINEERING
  • 实体框架与oracle数据库的连接

    我使用的是 Entity Framework 6 1 版本和 oracle 11 我是实体框架的新手 任何人都可以建议连接 oracle 的先决条件是什么 任何更改都需要在 web config 中进行 在web config中 默认它是与
  • Oracle中“NUMBER”和“NUMBER(*,0)”相同吗?

    在甲骨文中文档 http docs oracle com cd B28359 01 server 111 b28318 datatype htm i22289据说 数字 精度 小数位数 如果未指定精度 则该列将存储给定的值 如果 未指定比例
  • Oracle 中的函数与过程

    Oracle 中函数和过程的主要区别是什么 如果我可以用函数完成所有事情 为什么我必须使用过程 如果我无法在sql语句中调用过程 好吧 我会编写一个函数来完成相同的工作 过程不返回值 好的 在任何 dml 操作后我将仅返回 sql rowc
  • TOAD 将 &String 视为绑定变量

    我正在使用 Oracle Data Integrator 开发一些 ETL 有时会使用 TOAD 测试部分代码 今天我遇到了 TOAD 的问题 我有一行像 AND column value like DEV PROD 当我尝试运行包含上面过

随机推荐

  • iOS 中捆绑资源中的 Sqlite3

    您好 我计划从我的项目资源文件夹添加静态 SQLite3 但我不知道我是否正确执行 到目前为止 这是我的进展 创建 SQLite3 数据库SQLite 数据库浏览器 Copied Sqlite3 Database to my project
  • 经典 ASP、MySQL 或 ODBC UTF8 编码

    我有一个由 GoDaddy 托管的网站 包括后端的 MySQL 数据库 该网站是斯洛文尼亚网站 因此使用了特殊字符 该网站是用经典 ASP 构建的 我在 Notepad 中创建了所有页面 其中使用了 utf 8 编码 在每个页面的顶部 我还
  • 使用curl POST multipart/form-data 的正确方法是什么?

    我使用此语法来发布文件以及一些参数 curl v include form key1 value1 form upload localfilename URL 该文件大小约为 500K 首先 我看到发送端的内容长度为 254 之后服务器响应
  • 如何使用python下载谷歌云平台上文件夹内的文件?

    from google cloud import storage client storage Client bucket client get bucket bucket name blob bucket get blob path to
  • 可变递归预处理器宏 - 可能吗?

    我遇到了一些理论问题 在我维护的一段代码中有一组宏 例如 define MAX OF 2 a b a gt b a b define MAX OF 3 a b c MAX OF 2 MAX OF 2 a b c define MAX OF
  • 将 Yii2 应用程序部署到共享主机步骤

    我觉得奇怪的是 关于将 Yii2 应用程序部署到共享主机服务器的注意事项的详细信息如此之少 如果有的话 有人对此有一些步骤 技巧 注意事项吗 您是否遵循一个流程可以将问题 错误降至最低 数据库如何迁移 带有数据 我假设我可以导出 导入数据库
  • C# 比较两个泛型值[重复]

    这个问题在这里已经有答案了 可能的重复 运算符 不能应用于 C 中的泛型类型吗 我编写了这样的代码 public bool IsDataChanged T value1 GetValue2 T value2 GetValue1 return
  • 模块 appregistry 不是已注册的可调用模块(调用 runApplication)

    我根本找不到让反应导航工作的方法 我从互联网上复制了工作示例 但它们似乎也不起作用 有人可以告诉我我做错了什么吗 我在用着 节点 8 9 4 反应 16 3 0 alpha 1 反应本机 0 54 0 反应导航 1 4 0 index js
  • 谷歌地图折线的中间(质心?)

    我有一个折线列表 就像谷歌地图一样does当我单击折线时 我希望在我单击的位置显示一个信息窗口 并且它与此功能配合得很好 function mapsInfoWindow polyline content google maps event
  • 在最新的 Python 3 版本中实现“openssl_private_encrypt”

    我正在尝试用 Python 维护 FastSpring 电子商务平台 Secure Payload api 实现 他们的文档提供了使用 Java 和 PHP 中的私钥加密 或技术上签名 有效负载的示例 https developer fas
  • 如何在 Ruby 中将八进制数转换为十进制数?

    我试图找到一种使用八进制编号引用数组索引的干净方法 如果我正在寻找八进制 13 的数组索引 它应该返回以下值 a 11 这是我想出的方法来完成它 但它看起来不是很优雅或有效 a 50 51 52 53 54 55 56 57 58 59 6
  • 本地 WCF 服务的 ClientAccessPolicy.xml 放置在哪里?

    我正在尝试创建一个基本的 WCF 服务和 Silverlight 客户端 我已按照以下教程进行操作 http channel9 msdn com shows Endpoint Endpoint Screencasts Creating Yo
  • 如何将参数传递给 karate.call [重复]

    这个问题在这里已经有答案了 我正在将参数传递给karate call如下 getting object by name def id response content 0 id And eval if size response conte
  • ./spark-shell无法正确启动(spark1.6.1-bin.hadoop2.6版本)

    我安装了这个spark版本 spark 1 6 1 bin hadoop2 6 tgz 现在当我开始火花时 spark shell命令我遇到了这个问题 它显示了很多错误行 所以我只放了一些看起来很重要的错误行 Cleanup action
  • 如何在 LIKE 子句中转义方括号?

    我正在尝试用存储过程 using like 该列是 varchar 15 我尝试过滤的项目名称中带有方括号 例如 WC R S123456 如果我做一个LIKE WC R S123456 它不会返回任何东西 我找到了一些有关使用的信息ESC
  • 所有 Unicode 左括号/右括号的列表

    每个 Unicode 括号字符的列表是什么 包括 例如 lt gt 搜索 Unicode 字符的好方法是什么 有一个纯文本数据库有关 Unicode 联盟提供的每个 Unicode 字符的信息 格式描述于统一码附件 44 主要信息包含在Un
  • 是否有任何公式可以根据进程的 cpu 使用情况查找电池使用情况?

    在我的应用程序中 我想计算进程处理 CPU 周期所消耗的电池 是否有任何公式可以计算执行 CPU 周期的进程所使用的电池 None
  • 如何有条件地将属性添加到 javascript 对象文字

    我正在尝试执行以下操作来满足代码生成器 具体来说是 Sencha Cmd 的要求 这就是我需要做的本质 关键因素是函数体必须以返回对象文字结束 由于构建器的限制 我无法返回变量 那么 如果参数 includeB 为 true 如何在下面的伪
  • 通过引用传递数组

    通过引用传递静态分配的数组是如何工作的 void foo int myArray 100 int main int a 100 foo a Does myArray 100 有什么意义或者只是通过引用传递任何数组的语法 我不明白这里的单独括
  • 如何读取excel文件并将数据插入到oracle表中

    我正在使用 oracle 11g 如何使用 plsql 和 oracle forms 读取 excel 文件并将数据插入到 oracle 表中 我对他的主题很陌生 enter code here i tried https sites go