title: What are the boundary values of x and y in DECIMAL(x, y) in MySQL datatype declaration?
body: <p>I have got the following UDF</p>
  
  <pre><code>drop function if exists getCurrency$$
  
  create function getCurrency(dt datetime, x decimal(19,4), y decimal(19, 4)) 
  returns decimal(10,4) reads sql data
  begin
       declare currencyval decimal(10,4);
  
       /* Some conditions */
       select case when dt = "2000-12-31" then 0 else round((x/y), 4) into currencyval;
  
       return currencyval;
  end$$
  </code></pre>
  
  <p>Sometimes this UDF throws Data truncation error. 
  I can resolve the issue but the before even that I want some information regarding the Decimal data type and the significance of 10, 4 in the parameters.</p>
  
  <p>It would be good if you give some examples with the boundary conditions.</p>