当前位置:网站首页>PLSQL variable assignment
PLSQL variable assignment
2022-06-22 18:58:00 【CSDN Q & A】
Pass to a variable 10001,10002 This style is used to query , But at present, it will report an error , Please advise !
-- Data preparation
create table wareinfo(WareID number(5),WareName varchar(50));
insert into wareinfo values(10001,'A goods ');
insert into wareinfo values(10002,'B goods ');
select * from wareinfo;
-- Query statement
declare var_WareID varchar2(100) ;
var_WareName varchar2(100);
var_WareCursor sys_refcursor;
begin
var_WareID:='10001,10002';
open var_WareCursor for
--select wareinfo.WareName from wareinfo where WareID in (10001,10002) ;
select wareinfo.WareName from wareinfo where WareID in (var_WareID) ; -- Get the equivalent statement of the previous sentence through variables , But at present, it will report an error , Please advise !
fetch var_WareCursor into var_WareName;
while var_WareCursor%found loop-- Traversal cursor
dbms_output.put_line(var_WareName);
fetch var_WareCursor into var_WareName;
end loop;
end;
边栏推荐
- 2022年G2电站锅炉司炉题库及在线模拟考试
- Binary tree practice the second bullet
- Array implementation of circular linked list
- 牛客网:合并区间
- How does flynk MySQL CDC guarantee the server_ Is the ID globally unique?
- 阿里云过户找不到账号安全组ID问题
- Zero basic programming / reverse learning / over detection (Frida practice)
- Killed by the script, and "resurrected" by camping
- Grafana 9 is officially released, which is easier to use and more cool!
- 问下 cdc 2.2.1监控sqlServer是不支持监控多库的吗?
猜你喜欢

新东方转型双语直播带货给项目管理人的一场课

国产手机干翻苹果?原来是靠百元机和猛降价实现的

在循环中动态改变标签元素的样式

知乎热问:一个程序员的水平能差到什么程度?

如何持续突破性能表现? | DX研发模式
![[win11] right click fix to modify the registry but not create a new one](/img/5c/1ce29da6f1325f9f6c84984ae0c2e5.png)
[win11] right click fix to modify the registry but not create a new one

Linked list 4- 21 merge two ordered linked lists

wpa_supplicant的状态机迁移

Activity跳转到Fragment的方法(Intent)

Some preliminary explorations of avoiding obstacles and finding paths by rays in unity
随机推荐
静态链表(一)
排序---
Array implementation of circular linked list
Network intelligent operation and maintenance helps improve operation and maintenance efficiency
2022年R2移动式压力容器充装试题模拟考试平台操作
[win11] right click fix to modify the registry but not create a new one
【owt】owt-client-native-p2p-e2e-test vs2017 构建
The Fourth Youth Life Science Forum | first round notice
Grafana 9 正式发布,更易用,更酷炫了!
各位大佬,第一次使用flink mysql cdc, 现在程序启动 没报错 新增数据没有打印出来
中国移动手机用户缓慢增长,但努力争取高利润的5G套餐用户
What is the experience of writing a best seller
DBMS in Oracle_ output. put_ Example of line usage
Nuxt - 超详细环境搭建及创建项目整体流程(create-nuxt-app)
Cookie加密3+RPC解法
ADAU1452开发系统界面与代码数据之间的关系
Conda——基础配置命令总结
plsql变量赋值问题
预训练语言模型,bert,RoFormer-Sim又称SimBERTv2
线程池:ThreadPoolExcutor源码阅读