Link to home
Start Free TrialLog in
Avatar of joaotelles
joaotellesFlag for United States of America

asked on

Sqlplus - Ouput format

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
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
are these fields formatted as char?

if so try this:

select
 dpsn.dpsn_IMSI||";"||dpsn.dpsn_destinationaddress||";"|| term.UEMTE_IMEI
from
Avatar of jayakrishnabh
jayakrishnabh

select dpsn.dpsn_IMSI + ';' + dpsn.dpsn_destinationaddress + ';' + term.UEMTE_IMEI
from
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.
Avatar of joaotelles

ASKER

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
select
 dpsn.dpsn_IMSI || ';' ||dpsn.dpsn_destinationaddress || ';' ||to_char( term.UEMTE_IMEI)
from
Tks.