似乎这应该很容易,但语法不适合我。我正在尝试更新现有的行 - 我发现的第一行是'新'。然后我想返回一个带有键和其他两个值的分隔字符串:
create or replace procedure usp_direct_print_task_deque
(
taskNa in char
,environmentCd in char
) as
begin
declare rowkey number;
select '~' || rowversion || '~' || target_document || '~' || target_printer
as delimited_data
, rowversion
from AFD1.bt_direct_print_tasks
where environment_cd = environmentCd
and task_na = taskNa
and task_status = 'new'
and rownum = 1;
update bt_direct_print_tasks
set taskStatus = 'processing'
where rowversion = rowkey;
return delimited_data;
end usp_direct_print_task_deque;
答案 0 :(得分:1)
您需要定义OUT参数变量,例如x_delimited_data
和x_rowkey
,以分别保存delimited_data
和rowkey
的值。然后将SELECT
更改为SELECT... INTO x_delimited_data, x_rowkey
。 (我假设rowkey是您选择的rowversion
)。然后将return delimited_data;
更改为return;