问题描述
我有一个表,其中一列的字符串数据类型名称为ITEM_NO。
我有一个函数,我已经逐个传递了项目编号并测试该项目编号。在测试了项目编号之后我想将它存储在一个动态大小的数组(String数据类型)中。
我的问题是,我将如何插入列值使用pl / sql进入该数组?
示例:
ITEM_NO ='980124','970125','781202','874562 ','9234567'。
I have a table which has one column with string datatype name as ITEM_NO.
I have a function, in which i have passed the item number one by one and test that item number. After testing that item numbers i want to store it in an array (String datatype) which is dynamic in size.
My question is, how i will insert the column value into that array using pl/sql?
Example:
ITEM_NO = '980124', '970125', '781202', '874562', '9234567'.
推荐答案
ID Column1 Column2
1 Hello World
2 Eat Spaghetti
表2
Table2
ID ITEM_NO Table1_ID
1 980124 1
2 970125 1
3 781202 1
4 874562 1
5 9234567 1
6 1233456 2
7 2344556 2
8 5667789 2
9 980124 2 -- Same ITEM_NO as in row 1
当你想要获得Table1中某个ID的所有项目编号都是这样的:
When you want to get all the item numbers for a certain ID in Table1 just do like this:
SELECT ITEM_NO FROM Table1 WHERE Table1_ID = 1;
添加或删除单个项目编号也很容易。
It is also easy to add or remove a single item number.
这篇关于如何在pl / sql中的动态数组中插入用户输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!