Unix Technical Forum

Konvertieren von Zahlen in Update-Statement - Oracle 9i, Rel. 2

This is a discussion on Konvertieren von Zahlen in Update-Statement - Oracle 9i, Rel. 2 within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hallo, ich habe in Oracle 9i einen Wert in einer Spalte (VARCHAR2), der so aussieht: " 1", d.h. blank, ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 12:19 PM
Thomas Mauderer
 
Posts: n/a
Default Konvertieren von Zahlen in Update-Statement - Oracle 9i, Rel. 2

Hallo,

ich habe in Oracle 9i einen Wert in einer Spalte (VARCHAR2), der so
aussieht: " 1", d.h. blank, blank, Zahl oder so " 23", d.h. blank, Zahl,
Zahl etc.

Nun möchte ich mit einem Update-Statement erreichen, dass aus der " 1" bzw.
" 23" eine "001" bzw. "023" wird.

Wie mache ich das?

Gruss

Thomas


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 12:19 PM
Maxim Demenko
 
Posts: n/a
Default Re: Konvertieren von Zahlen in Update-Statement - Oracle 9i, Rel.2

Thomas Mauderer schrieb:
> Hallo,
>
> ich habe in Oracle 9i einen Wert in einer Spalte (VARCHAR2), der so
> aussieht: " 1", d.h. blank, blank, Zahl oder so " 23", d.h. blank, Zahl,
> Zahl etc.
>
> Nun möchte ich mit einem Update-Statement erreichen, dass aus der " 1" bzw.
> " 23" eine "001" bzw. "023" wird.
>
> Wie mache ich das?
>
> Gruss
>
> Thomas
>
>


SQL> with t as (
2 select ' 1' zahl from dual union all
3 select ' 23' from dual
4 )
5 select replace(zahl,' ','0') from t;

REP
---
001
023


Best regards

Maxim
(es ist üblich bei dieser newsgroup die Fragen in English zu stellen)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com