Home > database >  About use DBMS_OUTPUT in PLSQL. PUT_LINE print a line breaks a demerit
About use DBMS_OUTPUT in PLSQL. PUT_LINE print a line breaks a demerit

Time:10-25

Use DBMS_OUTPUT in PLSQL. PUT_LINE loop to print out the results, successfully the output, but found the result regularly every 56 'guild house broken into two lines,

But if just using SQL query results directly, can display properly, what reason be excuse me, how to solve?

General code format is like this, including me in another way, using a cursor is also the same problem,

Declare
V_var varchar2 (20) :='a condition;
The begin
For I (select a, b in the from the table where c=v_var) loop
Dbms_output. Put_line (i.a | | ', '| | i.b)
End loop;
end;

CodePudding user response:

Whether the field contains carriage return or line breaks

CodePudding user response:

How is broken into two lines, the result of your data where it came from, what kind of

Cut up some figure,

The dump function can see the actual content of the field

CodePudding user response:

reference 1st floor yaiger response:
whether field contains the carriage return or line breaks

This is a little inspiration to me, but I tried the replace carriage return or line feed, or a carriage return and line feed, also try a space in the past, it's the same as a result, is there any method can only check this field contains special characters?

CodePudding user response:

refer to the second floor selling fruit net reply:
how to split into two lines, the result of your data where it came from, what kind of

Cut up some figure,

Dump function can see fields the actual content of the

Because is the company's data, so not too convenient screenshots, data came from the company's databade and use SQL query normal no problem, just PLSQL will appear this kind of circumstance, for example queries a field, the field data in each row is 7 digits, such as line to 56, 7654321, was supposed to be the result into 765432, the next line is separate 1,

CodePudding user response:

Whether a varchar, the date, the same number of fields

CodePudding user response:

It is strange, the date and the number is impossible to have this kind of character, or pass the data validation
Can you provide some sample?

CodePudding user response:

This problem is a little strange, such as static great god answers

CodePudding user response:

Can't see the things, also can't locate your problem

CodePudding user response:

Give you a suggestion and output the results into an ASCII file, and then on a Unix or Linux environment open to see if there is illegal characters

CodePudding user response:

You check the first 55 again if there is a carriage return line B field

CodePudding user response:

This 100% is a tool of the problem, I also met before, haven't to take on the later

CodePudding user response:

Estimation is a carriage return, newline, from which is the breaking operation location data, and then check whether there is a carriage return in the SQL window, if it is to use pl/SQL develop, point... Go in,

CodePudding user response:

11 references sxq129601 response:
this 100% is a tool of the problem, I also met before, he was not to take on the

I feel you said is the closest, is indeed a tool problem, should be set up for every 50 lines such as paging, this problem only appear in use DBMS to print the results, if it is directly derived data no problem.

CodePudding user response:

First of all, you this code that allows a problem, because dbms_output. Put_line (i.a | | ', '| | i.b) behind little semicolons,
I don't have your business table, replaced by an alternative temporary data, the code is as follows:

Declare
V_var varchar2 (20) :='a condition;
The begin
For I (in the select LEVEL a and LEVEL b from DUAL CONNECT BY LEVEL & lt;=1000) loop
Dbms_output. Put_line (i.a | | ', '| | i.b);
End loop;
end;

According to your description, the problem of serious doubts is your data,
  • Related