简体   繁体   English

使用PL / SQL将Excel工作表中的列用作Oracle更新语句中的输入

[英]Use of a column in excel sheet as an input in update statement in Oracle using PL/SQL

I'm just curious - is it possible to use the values in a column of an excel sheet sitting in my C:/ as an input in an update statement I'm writing in PL/SQL connected to an Oracle DB. 我很好奇-是否可以将C:/中的Excel工作表的列中的值用作我在连接到Oracle DB的PL / SQL中编写的更新语句中的输入。 Update Statement: 更新声明:

update inventorylist
set Type = "Metals"
    Location = "Store A"
where Unique_ID IN (2234, 2455, 5578);

The Unique_ID values are in this particular column of the Excel file. 唯一ID值在Excel文件的此特定列中。 So is it possible to pull the values from the file into the update statement? 那么有可能将文件中的值拉到update语句中吗?

No doubt, there is a way to read the values directly from Excel into Oracle. 毫无疑问,有一种方法可以直接从Excel读取值到Oracle。 But that requires importing the data or connecting to Excel to read them. 但这需要导入数据或连接到Excel以读取它们。

I would just add a new column with a formula like: 我只想添加一个新列,其公式如下:

=A1&", "

Copy that formula down. 复制该公式。 Then copy the results into my query window for the IN list. 然后将结果复制到我的查询窗口IN列表中。 Remember to remove the last comma. 请记住删除最后一个逗号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM