Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5972783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:42:26+00:00 2026-05-22T20:42:26+00:00

i currently try to execute the following query on an Oracle DB select tzname

  • 0

i currently try to execute the following query on an Oracle DB

select tzname || ' (UTC'|| tz_offset(tzname) || ')' from v$timezone_names

It not seems to be very complicated. Just the name of the timzone and the UTC offset in braces. But when i execute the query with PL/SQL Developer on windows it always eats up the last brace.

So I went to sqlplus and executed it there and now i get my last brace but also an additional whitespace before the last brace as an extra goody.

I’ve tried it with nested to_char() and trim() but nothing changes. I also tried it on different DBs but it’s always the same.

Does anybody know if there is a problem with tz_offset and string concatenation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:42:27+00:00Added an answer on May 22, 2026 at 8:42 pm

    Issuing the following query:

    select dump(tz_offset(tzname)) from v$timezone_names;
    

    You get results like these:

    Typ=1 Len=7: 43,48,49,58,48,48,0
    Typ=1 Len=7: 43,48,49,58,48,48,0
    Typ=1 Len=7: 43,48,49,58,48,48,0
    Typ=1 Len=7: 43,48,49,58,48,48,0
    Typ=1 Len=7: 43,48,49,58,48,48,0
    Typ=1 Len=7: 43,48,49,58,48,48,0
    ...
    

    This shows that tz_offset() returns null-terminated strings (maybe a bug). So for your query, Oracle is returning

    "Africa/Algiers (UTC+01:00\0)" // Note \0 -> null character
    "Africa/Cairo (UTC+03:00\0)" // Note \0 -> null character
    ...
    

    Having that in mind, I guess that PL/SQL Developer interprets \0 as end-of-string (maybe another bug, SQL strings are not null-terminated) and so it does not bother writing the rest of the string, so you lose the trailing brace. SQL*PLus chooses instead to print a whitespace instead of that null and then proceeds with the rest of the string, printing the closing brace.

    As a workaround, you can replace tz_offset(...) with replace(tz_offset(...), chr(0)). This will delete nulls from whatever tz_offset(...) returns.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following query called searchit SELECT 2 AS sourceID, BLOG_COMMENTS.bID, BLOG_TOPICS.Topic_Title, BLOG_TOPICS.LFD,
I have the following query: var MyQuery = from e in ContractContext.Equipments.Include(Manufacturers) where e.Customers.ID
I have the following code: $bind = new COM(LDAP://CN=GroupName,OU=Groups,OU=Division,DC=company,DC=local); When I execute it from
I'm currently (I try to) designing a RESTful API for a social network. But
I currently have MVS2008 and I want to try the 2010 version hoping that
I'm currently working with PHPUnit to try and develop tests alongside what I'm writing,
I currently have issues in Webkit(Safari and Chrome) were I try to load dynamically
I am currently using code similar to this: try { // IE ONLY var
I am currently looking at the unload event of a window to try to
I am currently using two catch blocks after a try block. The first catches

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.