Solved

Sqlplus - Ouput format

Posted on 2014-03-21
7
133 Views
Last Modified: 2014-04-01
Hi,

I have this query that is ginving me the output below:

select
 dpsn.dpsn_IMSI,
dpsn.dpsn_destinationaddress,
 term.UEMTE_IMEI
from
.

Output:                                                                                                                                                                                                              
089724051000073161 5519991436384         86848600439455
.
.


And what I was looking for was for all lines in the output:
089724051000073161;5519991436384;86848600439455
.

==

Is this something I could do by altering the query?

Tks,
Joao
0
Comment
Question by:joaotelles
7 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39945243
You can use the concatenation operator ||:

select
 dpsn.dpsn_IMSI || ';' ||
dpsn.dpsn_destinationaddress || ';' ||
 term.UEMTE_IMEI
from

Open in new window

0
 
LVL 6

Expert Comment

by:wshark83
ID: 39945248
are these fields formatted as char?

if so try this:

select
 dpsn.dpsn_IMSI||";"||dpsn.dpsn_destinationaddress||";"|| term.UEMTE_IMEI
from
0
 
LVL 5

Expert Comment

by:jayakrishnabh
ID: 39945285
select dpsn.dpsn_IMSI + ';' + dpsn.dpsn_destinationaddress + ';' + term.UEMTE_IMEI
from
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 32

Expert Comment

by:awking00
ID: 39945673
If the fields are varchar2, kaufmed's solution should work fine. If they are char, you need to add a trim function to remove any spaces. If they are numeric, you need to add a to_char function. Also, the plus sign ('+') is not an Oracle concatenation operator, but is used with SQL Server and some other dbms.
0
 

Author Comment

by:joaotelles
ID: 39946214
dpsn.dpsn_IMSI,   -------> VARCHAR2
dpsn.dpsn_destinationaddress,   ------->VARCHAR2
 term.UEMTE_IMEI   -------> NUMBER (38)

How should it look like?

select
 dpsn.dpsn_IMSI || ';' ||
dpsn.dpsn_destinationaddress || ';' ||
 term.UEMTE_IMEI
from
0
 
LVL 32

Expert Comment

by:awking00
ID: 39946229
select
 dpsn.dpsn_IMSI || ';' ||dpsn.dpsn_destinationaddress || ';' ||to_char( term.UEMTE_IMEI)
from
0
 

Author Closing Comment

by:joaotelles
ID: 39969949
Tks.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question