Oracle Error : ORA-00936: missing expression

Many of you would have faced this error while executing a SQL Query. Below are the details on this error.

ORA-00936: 
missing expression

Cause:
A required part of a clause or expression has been omitted. For example, a SELECT statement may have been entered without a list of columns or expressions or with an incomplete expression. This message is also issued in cases where a reserved word is misused, as in SELECT TABLE.

The common reasons for this error are:
  1. You tried to assign a value to a numeric variable, but the value is larger than the variable can handle.
  2. You tried to assign a non-numeric value to a numeric variable and caused a conversion error.

Action:
Check the statement syntax and specify the missing component.

Example :

SELECT STUDENT_ID,STUDENT_NAME, FROM STUDENTS_TABLE;
Oracle PLSQL

if you notice in the above SELECT statement there is extra comma after STUDENT_NAME due to which this error occured.

ORA-06502: PL/SQL: numeric or value error string

Many of you would have faced this error while coding in PL/SQL. Below are the details on this error.

ORA-06502:
PL/SQL: numeric or value error string

Cause:
An arithmetic, numeric, string, conversion, or constraint error occurred. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 999 to a variable declared NUMBER(3).

The common reasons for this error are:
  1. You tried to assign a value to a numeric variable, but the value is larger than the variable can handle.
  2. You tried to assign a non-numeric value to a numeric variable and caused a conversion error.

Action:
Change the data, how it is manipulated, or how it is declared so that values do not violate constraints.

Example :

SQL> CREATE OR REPLACE PROCEDURE ErrorExample
  2  AS
  3    v_number number(3);
  4  BEGIN
  5    v_number := 1000;
  6  END;
  7  /

Procedure created.
 SQL> execute ErrorExample();
BEGIN ErrorExample(); END;

*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at "ErrorExample", line 5
ORA-06512: at line 1

How to use Jquery Autocomplete


The following example shows the usage of autocomplete functionality in Jquery. copy this code into your html editor and save it.

Then run the html page. Once you type the letter "a" you will be seeing the options which can be selected for autocomplete.

<!doctype html>
<html lang="en">
   <head>
      <meta charset="utf-8">
      <title>jQuery Autocomplete functionality</title>
      <link href="http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet">
      <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
      <script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
      <!-- Javascript -->
      <script>
         $(function() {
            var availableLanguages = [
               "Java",
               "Visual Basic",
               "Oracle",
               "C++",
            ];
            $( "#automplete1" ).autocomplete({
               source: availableLanguages
            });
         });
      </script>
   </head>
   <body>
      <!-- HTML -->
      <div class="ui-widget">
         <p>Type input</p>
         <label for="automplete1">Programming Languages: </label>
         <input id="automplete1">
      </div>
   </body>
</html>