0

I have a valid PL/SQL code in the Declare section at one of code pieces at work. It looks like that

Name1 name2 := name3();

I have hard time to understand what or how this variable is defined. There are no reserved keywords in the line. I understand that Name1 is my variable name and name3() probably is a function that calculates a value and this value is being assigned in name2. I cannot understand how this fits with the expected syntax (after the variable name to have the type/length). Is it possible the name2 value to be the variable type (Number, Vatchar2 etc) and this to be defined from the function name3()? Any suggestions are appreciated.

1 Answer 1

1

Name2 is very definitely the variable type. PL/SQL variable definitions are always

variable_name  variable_type

and optionally an initialization, such as

:= some_value

Note that this is the opposite of what you'd find in C or one of its derivatives where variable definitions are typically

variable_type  variable_name1, variable_name2, etc;

Name2 might be a subtype defined earlier in the particular piece of code you're looking at or, if this is in a package body, might be defined in the package spec.

Share and enjoy.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.