Solved

Sqlplus - Ouput format

Posted on 2014-03-21
7
130 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

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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 …
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

773 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