【发布时间】:2015-07-28 12:05:30
【问题描述】:
我的循环给了我两倍的结果。因为我只想要一次。我该怎么办?
for i in 1..length(newStudentNumber) loop
character := SUBSTR(newStudentNumber, i, 1);
newStudentNumber := newStudentNumber || case character
when 'A' then '16'
when 'B' then '17'
when 'C' then '18'
when 'D' then '19'
when 'E' then '20'
when 'F' then '21'
when 'G' then '22'
when 'H' then '23'
when 'I' then '24'
when 'J' then '25'
when 'K' then '26'
when 'L' then '27'
when 'M' then '28'
when 'N' then '29'
when 'O' then '30'
when 'P' then '31'
when 'Q' then '32'
when 'R' then '33'
when 'S' then '34'
when 'T' then '35'
when 'U' then '36'
when 'V' then '37'
when 'W' then '38'
when 'X' then '39'
when 'Y' then '40'
when 'Z' then '41'
else character
end;
end loop;
dbms_output.put_line(newStudentNumber);
希望我对这个问题不要太含糊
提前致谢
【问题讨论】:
-
函数中有 9 次调用 dbms_output,匿名块中有 1 次调用。您显示了十个值。有什么问题?
-
我得到的结果是这样的:TUENL1234567893536202927123456789 而我只想要:3536202927123456789。因为 TUENL1234567893 是另一个部分的重复(我认为或我建议)。我只想要一次遮阳篷。还是我觉得 TUENL1234567893536202927123456789 是一个结果很有趣?我希望你知道我想说什么。欢呼
-
我不想创建垃圾邮件。我过滤了一些输出和结果。我的问题在于循环。不知何故,当它执行时,我得到双重结果(另一个结果相同)
标签: string oracle11g output dbms-output