Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sqlplus - Ouput format

Posted on 2014-03-21
7
Medium Priority
?
142 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 2000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
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.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Suggested Courses

963 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