dbms_output.put_line [message #224024] |
Mon, 12 March 2007 12:34  |
lamnguyen14
Messages: 119 Registered: March 2007 Location: Virginia
|
Senior Member |
|
|
Hi all.
I would like to seek help on how to display my output in a specific position
dbms_output.put_line(code);
I would like to displace the output of the (code) in
character 8 & 9.
Thank you very much.
|
|
|
|
|
Re: dbms_output.put_line [message #224047 is a reply to message #224040] |
Mon, 12 March 2007 13:47   |
lamnguyen14
Messages: 119 Registered: March 2007 Location: Virginia
|
Senior Member |
|
|
Thanks much for your reply. But because from the character 1-7 I have an output called c_ty.
Here the example of my output
Norton78 (It should be Norton 78)
Salem79 ( Salem 79)
galax80 ( Galax 80)
Could you please tell me how to do and thank you very much for helping me.
|
|
|
|
|
Re: dbms_output.put_line [message #224070 is a reply to message #224047] |
Mon, 12 March 2007 18:16   |
William Robertson
Messages: 1643 Registered: August 2003 Location: London, UK
|
Senior Member |
|
|
lamnguyen14 wrote on Mon, 12 March 2007 18:47 | Here the example of my output
|
I suspect that isn't quite how you posted it. You can use [code] tags to post preformatted text.
|
|
|
|
|
Re: dbms_output.put_line [message #224213 is a reply to message #224207] |
Tue, 13 March 2007 07:12   |
lamnguyen14
Messages: 119 Registered: March 2007 Location: Virginia
|
Senior Member |
|
|
Please, let me know more about NORTON78. I don't know anything about NORTON78. I'm a very newbie in Oracle. Thanks much.
However, I tried as you told me, and get the error message like this:
SQL> DBMS_OUTPU.PUT_LINE( SUBSTR('TEXT',1,6)||SUBSTR('TEXT',7));
SP2-0734: unknown command beginning "DBMS_OUTPU..." - rest of line ignored.
|
|
|
|
|
Re: dbms_output.put_line [message #224227 is a reply to message #224213] |
Tue, 13 March 2007 07:55   |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
lamnguyen14 wrote on Tue, 13 March 2007 08:12 | Please, let me know more about NORTON78. I don't know anything about NORTON78. I'm a very newbie in Oracle. Thanks much.
|
Duh! That's the string YOU provided us.
|
|
|
|
Re: dbms_output.put_line [message #224235 is a reply to message #224214] |
Tue, 13 March 2007 08:16   |
lamnguyen14
Messages: 119 Registered: March 2007 Location: Virginia
|
Senior Member |
|
|
Hi all
I'm not hiding my information but I just don't know how to explain myself. I'm so sorry for that.
Here is my table:
P CITY P C
- ------ - -
N Norton 7 8
S Salem 7 9
E Galax 8 0
W Brito 8 1
**********************
Here is my code:
declare
cursor c1 is select * from cities;
my_city varchar2(7);
my_code varchar2(2);
begin
for v_rec in c1 loop
my_city := v_rec.pre||v_rec.city;
my_code := v_rec.precode||v_rec.code;
dbms_output.put_line(my_city||my_code);
end loop;
end;
*********************
Here is my output:
SQL> @ c:/dbms.sql
NNorton78
SSalem79
EGalax80
WBrito81
PL/SQL procedure successfully completed.
*******
However, I want all my_code is display in the position 8 & 9
NNorton78 (It's ok)
SSalem79 (It should be SSalem 79)
EGalax80 (It should be EGalax 80)
WBrito81 (It should be WBrito 81)
Please help. Thanks much.
[Mod-Edit: added code tags]
[Updated on: Tue, 13 March 2007 08:19] by Moderator Report message to a moderator
|
|
|
|
|
|
|
Re: dbms_output.put_line [message #224247 is a reply to message #224243] |
Tue, 13 March 2007 09:04   |
lamnguyen14
Messages: 119 Registered: March 2007 Location: Virginia
|
Senior Member |
|
|
I would like to say thank you to all of you for helping my with my output and the info. I'm so new in this field. I don't know anything. I would appreciate that.
|
|
|
|
|