0
这是我的问题。如何根据某些值以光标状态更改顺序
if ord = 'd' then
Ordby:= 'name'
else
Ordby:= 'type'.
end if;
declare cursor file is
select type,name,location, from filemstr order by ordby;
begin
for i in file
loop
end;
问题是秩序ordby不工作。它总是默认排序。有可能使用变量进行排序吗?我需要在以下条件下订购。我不想声明两次游标。
为什么downvote?这是两种有效的方法之一,另一种是通过EXECUTE IMMEDIATE – Falco
动态SQL我没有DV(以及谁做了似乎无法下定决心),但一些解释可能是有用的? –
没有ord需要是一个(游标)参数才能工作? – Sathya