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 8957487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:00:05+00:00 2026-06-15T15:00:05+00:00

This is how I am delcaring the local variables: team_counter number (38) := 0;

  • 0

This is how I am delcaring the local variables:

   team_counter number (38) := 0;
   username varchar2(50) := '';

This is how I am trying to use/see their value after using some select into statement:

    dbms_output.put_line(team_counter||'.'||username);
    if  team_counter< 30 AND username  <>'' then
    begin
        dbms_output.put_line('yuhj');
    end;
    end if;

The second output is not being printed!
The first output is being printed as ‘1.tuser’ which I was expecting.

  • 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-06-15T15:00:07+00:00Added an answer on June 15, 2026 at 3:00 pm

    This is because you’re trying to compare a string with a 0 length string using an inequality operator.

    Oracle assumes that 0 length strings are equivalent to NULL and will not evaluate comparisons that don’t use the NULL specific conditional. To quote:

    Oracle Database currently treats a character value with a length of
    zero as null. However, this may not continue to be true in future
    releases, and Oracle recommends that you do not treat empty strings
    the same as nulls.

    Simply put this means that your IF statement should be:

    if team_counter < 30 and username is not null then
       ...
    

    As an additional note there’s no need for the begin ... end around the dbms_output.put_line. As you’re not catching any exceptions explicitly related to this call or declaring additional variables etc there’s no real need.

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

Sidebar

Related Questions

In Applescript, if you declare a handler using with labeled parameters, local variables get
Synopsis How do you declare variables in a namespace while using the use statement?
Hi I am trying to use fortran structure like this type some u !
Clearly, declaring a local variable as const , prevents runtime modification. Const instance variables
If I am using a try/catch/finally block where and how should I initialize variables?
Do Java ThreadLocal variables produce thread-local values if they are used as instance variables
From this article . Another use for declaring a variable as register and const
I joined this new project and found a different way of declaring local vars
Possible Duplicate: Why would one mark local variables and method parameters as “final” in
I had some discussion related to the use of properties and instance variables at

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.