问题
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;
it seems that when I store this text "'@Set sizeout2=%sizeout2:bytes=%'" in file oracleForm or Plsql convert it as below:
@Set sizeout2=nullizeout2:bytes=%
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?
Please take note that my backend is 12c and frontend is 11gR2.
回答1:
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)
).
来源:https://stackoverflow.com/questions/48199635/convert-s-to-null-in-plsql