Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Return value of tz_offset

Re: Return value of tz_offset

From: sybrandb <sybrandb_at_gmail.com>
Date: 14 Sep 2006 04:26:24 -0700
Message-ID: <1158233184.776834.217940@i3g2000cwc.googlegroups.com>

Björn Wächter wrote:
> sybrandb wrote:
> > Björn Wächter wrote:
> >> I'm facing a problem if I try to append a string to the
> >> return value of tz_offset like this:
> >>
> >> select 'start' || tz_offset('+02:00') || 'end' test from dual
> >>
> >> TEST
> >> ---------------
> >> start+02:00
> >>
> >>
> >> But if I do this:
> >>
> >> select 'start' || substr(tz_offset('+02:00'),1,6) || 'end' test from dual
> >>
> >> TEST
> >> --------------
> >> start+02:00end
> >>
> >> it works fine.
> >>
> >>
> >> Any Ideas?
> >>
> >>
> >> Björn
> >
> > What is the outcome of
> > select dump(tz_offset('+02:00'))
> > from dual
> > /
> >
> > This should provide a hex dump of the result, so you can identify any
> > spurious trailing characters.
> >

>
>

> The result is:
>

> select dump(tz_offset('+02:00')) from dual
>
>

> DUMP(TZ_OFFSET('+02:00'))
>

> -----------------------------------
> Typ=1 Len=7: 43,48,50,58,48,48,0
>
>

> The string is 0 terminated.
> I think that's the problem. Can this be operating system
> dependent?
>
>

> Björn

Or (hope not, because that would qualify it as a bug), as string variables are \0 terminated in C, you simply get the raw contents of the string variable back.
And as \0 is treated as NULL...
Time for a service request, I guess.

-- 
Sybrand Bakker
Senior Oracle DBA
Received on Thu Sep 14 2006 - 06:26:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US