Home » SQL & PL/SQL » SQL & PL/SQL » Insert a space in the middle of a six characther string (Oracle 11g)
Insert a space in the middle of a six characther string [message #656773] Tue, 18 October 2016 10:01 Go to next message
halifaxns
Messages: 7
Registered: June 2013
Junior Member
Hi there,

How can an I run an update statement to insert a space in the middle of a six-character string..

i.e. Postal Code column is P5K2X9, it should be P5K 2X9

Thank you very much in advance.
Cheers,

E
Re: Insert a space in the middle of a six characther string [message #656774 is a reply to message #656773] Tue, 18 October 2016 10:03 Go to previous messageGo to next message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
substr(str, 1, 3)||' '||substr(str, 4, 3)
Re: Insert a space in the middle of a six characther string [message #656776 is a reply to message #656774] Tue, 18 October 2016 11:09 Go to previous message
halifaxns
Messages: 7
Registered: June 2013
Junior Member
That's brilliant.. worked great..Thanks

[Updated on: Tue, 18 October 2016 11:10]

Report message to a moderator

Previous Topic: Help required for getting create index DDL on partitioned table.
Next Topic: PL/SQL Function fails without an exception
Goto Forum:
  


Current Time: Fri Apr 19 07:34:59 CDT 2024