【发布时间】:2025-12-07 03:40:01
【问题描述】:
我是一名测试人员,我必须运行大量选择查询来过滤掉我正在测试的信息。
有没有办法制作全局变量并使用它而不是粘贴相同的值?
示例代码:
Select l.prod_package,m.* from avtt7m0 m, avtt7l0 l
where l.cust_id='52317162090004'
and l.ar_id=m.ar_id and m.lc_st_code='ACT';
Select m.* from avtt7m0 m, avtt7l0 l
where l.cust_id='52317162090004'
and l.ar_id=m.ar_id and m.lc_st_code='ACT';
Select * From AKTTD90
where cust_id in ('52317162090004');
Select * From Kndt7m0
where cust_id in ('52317162090004');
【问题讨论】:
-
您可以使用 t-sql 变量并预先设置它。如果您发布您正在使用的代码而不是图片,我将向您展示如何使用它
-
您使用的是哪个 dbms。 (答案可能是特定于产品的。)
-
我正在使用 SQL 开发人员。这里是代码: 选择 l.prod_package,m.* from avtt7m0 m, avtt7l0 l where l.cust_id='52317162090004' and l.ar_id=m.ar_id and m.lc_st_code='ACT';选择 m.* from avtt7m0 m, avtt7l0 l 其中 l.cust_id='52317162090004' and l.ar_id=m.ar_id and m.lc_st_code='ACT'; Select * From AKTTD90 where cust_id in ('52317162090004'); Select * From Kndt7m0 where cust_id in ('52317162090004');
-
我把它贴在你的问题中怎么样。那里并不太难
标签: sql oracle oracle-sqldeveloper dynamic-queries