473,386 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to exchange a string in oracle sql?

i have string like 'XYZ ZYX'.
I Want to display like 'ZYX XYZ'.
Aug 25 '11 #1
4 2055
Hi Kishore,

You can use below query. I have tested in sql server.


Expand|Select|Wrap|Line Numbers
  1. DECLARE @FullName        VARCHAR(100)
  2. SET @FullName = 'XYZ ZYX'
  3.  
  4. SELECT SUBSTRING(@FullName,5,7)+
  5.        SUBSTRING(@FullName,1,3)
  6.  
Please mark as reply if it suits you.

Thanks,
Snehasis
Aug 25 '11 #2
str='xyz zyx'
select substr(str,5,7)||substr(str,1,3) as str from dual;

Regards
kishore ku Roul
Aug 26 '11 #3
rski
700 Expert 512MB
Or something like that
Expand|Select|Wrap|Line Numbers
  1. declare
  2. vi varchar2(10);
  3. vo varchar2(10);
  4. begin
  5. vi:='XYZ ZYX';
  6. select regexp_replace(vi,'([^ ]+) ([^ ]+)','\2 \1') into vo from dual
  7. end;
  8.  
Sep 5 '11 #4
IT'S SIMPLY BY USING TRANSLATE FUNCTION
SELECT 'XYZ ZYX',TRANSLATE('XYZ ZYX','XZ','ZX') FROM DUAL
--Only Display purpose
Sep 7 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jorge_Beteta | last post by:
Hello, I work for an attorney staff, so basically the whole day they are sending themselves a lot and a lot of papers (Word docs or Excell sheets). We are going to propose them the use of a...
63
by: Nick Palmer | last post by:
Hi all, Is there a DB2 equivilant to Oracle's DB Link functionality ? I have two DB2 databases and I need to get access to the tables in one from the other. In Oracle I would just create a DB...
1
by: Andrew Arace | last post by:
I scoured the groups for some hands on code to perform the menial task of exporting table data from an Access 2000 database to Oracle database (in this case, it was oracle 8i but i'm assuming this...
2
by: Adam Norris | last post by:
Simply put, does anyone know a way that I can call a C# library's exposed methods from Oracle PL/SQL? I am currently working on a data transport between disconnected networks. One network is...
2
by: George Durzi | last post by:
We recently upgraded to Exchange2K3/W2K3 from Exchange2K/W2K, and some of my c# code that I used to access users' contacts using WebDAV has stopped working. I'm getting a 401 unauthorized error....
0
by: Vassilev, Lubomir G. | last post by:
ok, this is what's going on. i have this VB.NET <http://www.experts-exchange.com/Databases/PostgreSQL/Q_21177281.html> application with Oracle...
0
by: Tim Sapp | last post by:
Guys, I am working on a new web site for our company and have started to move my code from VB.Net to C#. I have ran into a snag that I can't seem to figure out. I am trying to create an...
4
by: rosco | last post by:
I have a multi threading application where multiple threads can read and write to the property. I try to avoid the lock statement on properties that hold none business critical data. I could...
0
by: arjen1984 | last post by:
I am now working on C# with WebDAV on Exchange now to get appointments. When I work local on the domain where the server is, i can get the appointments no problem. When I work outside of it, i get an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.