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

  • Home
  • SEARCH
  • 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 7718399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:09:30+00:00 2026-06-01T03:09:30+00:00

See the excerpt below taken from a PL/SQL tutorial. The part I have an

  • 0

See the excerpt below taken from a PL/SQL tutorial. The part I have an issue with is line 3, where it says salary is of length 6. I don’t understand what that means. In the last line of this excerpt, it declares a variable “of length 10” which is then initialized to “HR Dept” which is certainly not 10 characters. What is meant by length?


DECLARE

salary  number (6);

* “salary” is a variable of datatype number and of length 6.

When a variable is specified as NOT NULL, you must initialize the variable when it is declared.

For example: The below example declares two variables, one of which is a not null.

DECLARE

salary number(4);

dept varchar2(10) NOT NULL := “HR Dept”;

Another example:

DECLARE 



var_salary number(6); 

 var_emp_id number(6) = 1116; 

1116 is not 6 digits. I’m at a loss.

  • 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-01T03:09:32+00:00Added an answer on June 1, 2026 at 3:09 am

    Maximum length. You’d discover this if you tried to store eleven characters into dept or if you started making a cool million each year at whatever your job is.

    It’s no different from when you create tables:

    create table users (
        id     integer,
        name   varchar(20)
    );
    

    In that case, 20 is the maximum length of the name. It doesn’t mean every row has to have a 20-character name.

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

Sidebar

Related Questions

In the below, where does b come from? I don't see it being passed
This code(below) suppose to add information to ToolTips which are taken from database(and the
possibly a simple question, but I couldn't find definitive answer (see below for excerpt
SEE BOTTOM OF THIS POST FOR UPDATE ON THIS PLEASE. I have the below
See code below, for some reason it only works when I put a breakpoint
I wonder whether someone could help me please, From a tutorial I found online
I've got a very simple java program (J.java, see below) on my application server
I have been playing about with LINQ-SQL, trying to get re-usable chunks of expressions
I'm using SQL Server 2008. I have a table with over 3 million records,
I have issue with IE 8 padding setting. If you look at my web

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.