Solved

Sqlplus - Ouput format

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

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 31

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 31

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

'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 …
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now