Oracle SELECT with an array using an IN
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
declare -- CREATE OR REPLACE TYPE PROD_TYPES.TYPE_NUMBER_ARRAY AS TABLE OF NUMBER nt_src prod_types.type_number_array := PROD_TYPES.TYPE_NUMBER_ARRAY(); -- Constructor nt_dest prod_types.type_number_array := PROD_TYPES.TYPE_NUMBER_ARRAY(); -- Constructor begin -- Test data (no order) select product_version_id bulk collect into nt_src from product_version v
where v.product_version_id between 138120 and 140000;
-- select * from table(sys.dbms_debug_vc2coll(1,2,'a')) order by 1 desc -- Data ordered select product_version_id bulk collect into nt_dest from product_version where product_version.product_version_id in ( select column_value from table ( cast (nt_src AS prod_types.type_number_array)))
order by
product_version.expiration_date2 desc , product_version.base_price desc , product_version.expiration_date2 desc ; for i in nt_dest. first .. nt_dest. last loop
dbms_output.put_line(to_char(nt_dest(i))); end loop;
exception when others then
dbms_output.put_line( 'sqlerrm : ' ||sqlerrm); |
相关推荐
ORACLE常用命令 一、ORACLE的启动和关闭 1、在单机环境下 要想启动或关闭ORACLE系统必须首先切换到ORACLE用户,如下 su - oracle a、启动ORACLE系统 oracle>svrmgrl SVRMGR>connect internal SVRMGR>startup ...
OracleCommand cmd = new OracleCommand("SELECT * FROM table WHERE column IN (SELECT COLUMN_VALUE FROM TABLE(:arrayParam))", conn); cmd.Parameters.Add(new OracleParameter("arrayParam", OracleDbType....
Written by a MySQL Community Manager for Oracle, MySQL and JSON: A Practical Programming Guide shows how to quickly get started using JSON with MySQL and clearly explains the latest tools and ...
* Using the Delphi 7 version of midas.dll to open an XML file that was saved with the Delphi 6 version of midas.dll results in an illegal operation. * Incorrect filter expression parsing occurs when ...
在C#中,我们通过`using`语句引入`System.Data.OracleClient`等库来处理Oracle数据库连接和数据读取。而在C语言中,我们需要包含Oracle Instant Client中的头文件,如`oci.h`和`oraocci.h`,这些头文件提供了必要的...
copy from username/password@oraclename append table_name1 using select * from table_name2; ``` 2. **常规插入方式** - 直接使用`INSERT INTO...SELECT FROM`语句将数据从一个表插入到另一个表。 - 为了...
With sample files and help, as well as ample remarks.<END><br>9 , pb_test.zip Test project illustrating high performance Data Access for SQL Server using ADO command objects and Stored Procedures ...
recommending using the production ini in production and testing environments. ; php.ini-development is very similar to its production variant, except it's ; much more verbose when it comes to errors...
Some of these classes also have an OpenCL and OpenGL counterpart, their names ending with CL or starting with GL, i.e.: JavaCVCL, GLCanvasFrame, etc. To learn how to use the API, since documentation...
COPY FROM user/pwd@sid – TO user/pwd@sid – INSERT tab1 USING SELECT ... ``` SQL*Plus的COPY命令允许批量插入,通过调整`ARRAYSIZE`和`COPYCOMMIT`参数可以进一步优化性能。 这些技巧可以根据实际场景灵活...
### PL/SQL最佳实践 #### 概述 PL/SQL是一种专门为Oracle数据库设计的过程化语言,它结合了SQL的数据操作能力和传统过程化语言的控制...- 使用`EXECUTE IMMEDIATE`时,可以通过`USING IN`等选项指定变量值。 - 示例:...
它支持多种数据源,包括但不限于DataTable、BindingSource、List、Array等。对于本问题而言,我们主要关注其与数据库交互的功能。 #### 2. 删除DataGridView中的数据 要删除DataGridView中的数据,首先需要确保已经...
**ADO.NET**:ADO.NET是Microsoft提供的一套数据访问技术,用于.NET应用程序访问多种类型的数据源,如SQL Server、Oracle等。`SqlCommand`对象的`ExecuteNonQuery`方法用于执行SQL命令,如INSERT、UPDATE、DELETE等...
17. **using**: 用于引入命名空间内的标识符或声明类型别名。 18. **::范围解析运算符**: 指明特定的命名空间、类或基类。 19. **enum枚举类型**: 定义整型常量的集合。 20. **decltype**: 获取表达式的类型。 21. *...