2 Answers - Sort by: Date | Rating
DECODE compares expr to each search value one by one. If expr is equal to a search, then Oracle Database returns the corresponding result. If no match is found, then Oracle returns default. If default is omitted, then Oracle returns null.
The arguments can be any of the numeric types (NUMBER, BINARY_FLOAT, or BINARY_DOUBLE) or character types.
The search, result, and default values can be derived from expressions. Oracle Database uses short-circuit evaluation. That is, the database evaluates each search value only before comparing it to expr, rather than evaluating all search values before comparing any of them with expr. Consequently, Oracle never evaluates a search if a previous search is equal to expr.
Oracle automatically converts expr and each search value to the datatype of the first search value before comparing. Oracle automatically converts the return value to the same datatype as the first result. If the first result has the datatype CHAR or if the first result is null, then Oracle converts the return value to the datatype VARCHAR2.
In a DECODE function, Oracle considers two nulls to be equivalent. If expr is null, then Oracle returns the result of the first search that is also null.
The maximum number of components in the DECODE function, including expr, searches, results, and default, is 255.
The arguments can be any of the numeric types (NUMBER, BINARY_FLOAT, or BINARY_DOUBLE) or character types.
If expr and search are character data, then Oracle compares them using nonpadded comparison semantics. expr, search, and result can be any of the datatypes CHAR, VARCHAR2, NCHAR, or NVARCHAR2. The string returned is of VARCHAR2 datatype and is in the same character set as the first result parameter.
If the first search-result pair are numeric, then Oracle compares all search-result expressions and the first expr
to determine the argument with the highest numeric precedence,
implicitly converts the remaining arguments to that datatype, and
returns that datatype.
The search, result, and default values can be derived from expressions. Oracle Database uses short-circuit evaluation. That is, the database evaluates each search value only before comparing it to expr, rather than evaluating all search values before comparing any of them with expr. Consequently, Oracle never evaluates a search if a previous search is equal to expr.
Oracle automatically converts expr and each search value to the datatype of the first search value before comparing. Oracle automatically converts the return value to the same datatype as the first result. If the first result has the datatype CHAR or if the first result is null, then Oracle converts the return value to the datatype VARCHAR2.
In a DECODE function, Oracle considers two nulls to be equivalent. If expr is null, then Oracle returns the result of the first search that is also null.
The maximum number of components in the DECODE function, including expr, searches, results, and default, is 255.
1
0
Do you mean decode the vechicle id number [vin] Decoding the vin usually will tell you when and what plant, and or country the vechicle was built. It will also tell color codes engine codes, and any special equipment
0
0
Guest
answered 9 months ago
- How Do I Remove A Back Seat From A 1973 Dodge Charger SE?
- Where Did The Name Allard Come From?
- How To Adjust The Hood Latch On A 1961 Ford? The Hood Will Pop Up Going Down The Road
- Where Do I Go To Set My Personal Identification Number?
- I Dont Have Any Power To My Head Lights But I Have Power To Everything Else. Does Anyone Have A Easy To Read Wiring Diagram For A 1970 International Truck?
- Is There A Brake Drum That I Can Use On My Early Volkswagen So That I Can Use My Camaro Wheels?
- Who Builds The Best Batmobile Replicas?
- How Much Is My 1978 Trans Am Worth?
- How Do I Fix Lifters On A 4.6 Cougar Motor?
- How Do You Obtain A National Provider Identification Number For Individuals?
- How Can I Establish A Personal Identification Number?
- What Is The Firing Oder For A 1949 Ford Deluxe Coupe?
- What My Engine Identification Number Is?
- If The Vin Number On My 76 Impala Is Corroded On The Dash And Door, Where Else Could I Find The Vin Number? Someone Told Me The Engine Block, Is This True?
- Where Is The Vin Number Located On A Ford Motor Block From The 1960's?
- Does Anyone Know Where To Get The Vacuum Line Diagrams For A 78 Chevy Nova? Please Send Reply Here
- How Do I Check A 10 Digit Vin For A 1959 Corvette?
- How Many Chevy Camaro Are Registered In Dallas?Ft. Worth?
- How Do I Find Out What Motor My 1969 Camaro Contained If I Do Not Have The Original Protecto Plate? GM Wants $50 For Packet Of Information, But I Don't Know If It Contains What I Need. Please Help!
- How Do I Wire The Ignition Switch On A 66 Ford Mustang?
- I Have 1969 Camaro & Need To Know The Numbers On The Original Protecto Plate (to Find Out What Motor Was In It Originally). Where Do I Go To Find This Information?
- What Is Value Of 1977 Buick Special?
- I Have A 1969 396 SS Chevelle And The # On The Block Is 553778 Does This Mean It Is Not The Motor That Came In The Car?
- How Do I Find Out If A 1969 Pontiac Is Real Or A Clone? Vin #242379p313599
- Where To Find The VIN Number On The Frame Of A 1961 Chevrolet C10 Pickup?

New Comment - Comments are editable for 5 min.