在plsql中将%S转换为null [英] convert %S to null in plsql

查看:153
本文介绍了在plsql中将%S转换为null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将oracle形式6i迁移到11g后,我发现一个问题.我以某种形式生成Windows批处理命令.命令的一部分如下:

I observe a problem after migrating my oracle form 6i to 11g. In a form I am generating windows batch command. part of the command is as below:

declare
    lv_content5c varchar2(300);
begin
    lv_content5c:=  '@Set sizeout2=%sizeout2:bytes=%';
    CLIENT_TEXT_IO.PUTF(out_file,lv_content5c);
    CLIENT_TEXT_IO.PUTF(out_file, CHR(10));     
    CLIENT_TEXT_IO.FCLOSE(out_file);
    client_host('cmd /c  start '|| lv_filename);
end;

似乎当我将文本'@Set sizeout2 =%sizeout2:bytes =%'"存储在文件oracleForm或Plsql中时,转换如下:

it seems that when I store this text "'@Set sizeout2=%sizeout2:bytes=%'" in file oracleForm or Plsql convert it as below:

@设置sizeout2 = nullizeout2:bytes =%

@Set sizeout2=nullizeout2:bytes=%

因为可以观察到%s在输出文件中转换为null.您介意向我提出问题是什么,您是否曾经遇到过类似的问题?

as it can be observe %s converted to null in output file. would you mind advising me what is the issue and have you ever face similar issue?

请注意,我的后端是12c,前端是11gR2.

Please take note that my backend is 12c and frontend is 11gR2.

推荐答案

PUTF将第一个字符串参数作为格式规范,随后的字符串作为内容.另外,您需要适当的行终止符. PUT_LINE(out_file,lv_content5c)也是如此;并删除以下行(带有CHR(10)的行).

PUTF takes the first string argument to be a format specification, with subsequent strings being the content. Also, you need a proper line terminator. So do PUT_LINE(out_file,lv_content5c); and delete the following line (the one with CHR(10)).

这篇关于在plsql中将%S转换为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆