<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7883247768244567958</id><updated>2011-07-31T00:06:59.696-07:00</updated><category term='embedded'/><category term='Store Procedures'/><category term='DateTime'/><category term='Firebird'/><category term='MySQL'/><category term='Workaround'/><category term='Oracle'/><category term='Index'/><title type='text'>Free Database: The Relational Databases Blog</title><subtitle type='html'>MySQL, Oracle, Firebird, SQL Server, SQL CE, VistaDB</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://free-database.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883247768244567958/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://free-database.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>DotNetFacts</name><uri>http://www.blogger.com/profile/10845230539682811461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_m9VtXqkOxi8/Sv3pY5m1imI/AAAAAAAAAJY/iPx-Fmvp1ag/S220/Dot-Net-Logo-Small.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7883247768244567958.post-2202628901110273757</id><published>2010-06-20T10:42:00.000-07:00</published><updated>2010-06-20T11:00:21.267-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Workaround'/><category scheme='http://www.blogger.com/atom/ns#' term='Store Procedures'/><title type='text'>Workaround: Using LIMIT parameters in MySQL stored procedures</title><content type='html'>&lt;div style="float: left; margin: 3px 3px 3px 3px;"&gt;
&lt;table width="100%"&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-7646043077243506";
google_ad_host = "pub-1599271086004685";
/* TXT_300x250 */
google_ad_slot = "5746121619";
google_ad_width = 300;
google_ad_height = 250;
//--&gt;
&lt;/script&gt;
&lt;script 
src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;It seems that MySQL doesn't accept direct parameter assignment for the LIMIT clause. For example the stored procedure parameters or the local defined variables will generate syntax error if are used directly in the LIMIT clause inside a Store Procedure: &lt;strong&gt;SELECT...LIMIT @limit;&lt;/strong&gt;&lt;/p&gt;

&lt;br/&gt;&lt;br/&gt;

&lt;h3&gt;MySQL Store Procedure LIMIT Workaround&lt;/h3&gt;

&lt;p&gt;A possible worksround for this MySQL LIMIT issue is to use the LIMIT containing query like this:&lt;/p&gt;

&lt;strong&gt;
SET @v_limit = v_store_proc_parameter;&lt;br/&gt;
SET @v_query = 'SELECT ... FROM ... WHERE ... LIMIT ?`;&lt;br/&gt;&lt;br/&gt;

PREPARE v_query from @v_query;&lt;br/&gt;
EXECUTE v_query USING @v_limit;
&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7883247768244567958-2202628901110273757?l=free-database.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://free-database.blogspot.com/feeds/2202628901110273757/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://free-database.blogspot.com/2010/06/workaround-using-limit-parameters-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883247768244567958/posts/default/2202628901110273757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883247768244567958/posts/default/2202628901110273757'/><link rel='alternate' type='text/html' href='http://free-database.blogspot.com/2010/06/workaround-using-limit-parameters-in.html' title='Workaround: Using LIMIT parameters in MySQL stored procedures'/><author><name>DotNetFacts</name><uri>http://www.blogger.com/profile/10845230539682811461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_m9VtXqkOxi8/Sv3pY5m1imI/AAAAAAAAAJY/iPx-Fmvp1ag/S220/Dot-Net-Logo-Small.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883247768244567958.post-8343953506044801605</id><published>2009-10-13T03:59:00.000-07:00</published><updated>2009-10-13T07:59:26.448-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='embedded'/><category scheme='http://www.blogger.com/atom/ns#' term='Firebird'/><category scheme='http://www.blogger.com/atom/ns#' term='Index'/><title type='text'>Firebird Index key size calculator</title><content type='html'>&lt;div style="float: left; margin: 3px 3px 3px 3px;"&gt;
&lt;table width="100%"&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-7646043077243506";
google_ad_host = "pub-1599271086004685";
/* TXT_300x250 */
google_ad_slot = "5746121619";
google_ad_width = 300;
google_ad_height = 250;
//--&gt;
&lt;/script&gt;
&lt;script 
src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;Maximum index key size is &lt;strong&gt;252 bytes&lt;/strong&gt; (for &lt;a href="http://dotnetfacts.blogspot.com/search/label/Firebird"&gt;Firebird&lt;/a&gt; &lt;= 1.5) or 1/4 of page size (&lt;a href="http://dotnetfacts.blogspot.com/search/label/Firebird"&gt;Firebird&lt;/a&gt; 2). So trying to create a composite index using multiple columns might end with a: 

&lt;br/&gt;&lt;br/&gt;

&lt;strong&gt;"key size too big for index ..."&lt;/strong&gt; 

&lt;br/&gt;&lt;br/&gt;

or

&lt;br/&gt;&lt;br/&gt; 

&lt;strong&gt;"key size exceeds implementation restriction for index..."&lt;/strong&gt; errors.

&lt;br/&gt;&lt;br/&gt;

Here is a tool that can help you to determine the real size of your index: &lt;a href="http://www.volny.cz/iprenosil/interbase/ip_ib_indexcalculator.htm"&gt;Index key size calculator&lt;/a&gt;. Here is a backup link (&lt;a href="http://www.firebirdfaq.org/ip_ib_indexcalculator.htm"&gt;Firebird index key size calculator&lt;/a&gt;)

&lt;br/&gt;&lt;br/&gt;

&lt;strong&gt;TIP:&lt;/strong&gt; Please be sure your application can access the &lt;strong&gt;"firebird.msg"&lt;/strong&gt; file in order to be able to get the specific error message. Otherwise you will get a generic exception message.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7883247768244567958-8343953506044801605?l=free-database.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://free-database.blogspot.com/feeds/8343953506044801605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://free-database.blogspot.com/2009/10/firebird-index-key-size-calculator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883247768244567958/posts/default/8343953506044801605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883247768244567958/posts/default/8343953506044801605'/><link rel='alternate' type='text/html' href='http://free-database.blogspot.com/2009/10/firebird-index-key-size-calculator.html' title='Firebird Index key size calculator'/><author><name>DotNetFacts</name><uri>http://www.blogger.com/profile/10845230539682811461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_m9VtXqkOxi8/Sv3pY5m1imI/AAAAAAAAAJY/iPx-Fmvp1ag/S220/Dot-Net-Logo-Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883247768244567958.post-8681536390724187459</id><published>2009-09-13T01:07:00.000-07:00</published><updated>2009-09-13T01:14:21.872-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='embedded'/><category scheme='http://www.blogger.com/atom/ns#' term='Firebird'/><title type='text'>Create Firebird database from script file by code</title><content type='html'>&lt;div style="float: left; margin: 3px 3px 3px 3px;"&gt;
&lt;table width="100%"&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-7646043077243506";
google_ad_host = "pub-1599271086004685";
/* TXT_300x250 */
google_ad_slot = "5746121619";
google_ad_width = 300;
google_ad_height = 250;
//--&gt;
&lt;/script&gt;
&lt;script 
src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;It seems the &lt;a href="http://free-database.blogspot.com/2009/05/embedded-firebird-database.html"&gt;Firebird embedded&lt;/a&gt; engine is not able to create a database by executing a full file script as one statement. If this is what you are trying to achieve, here is a workaround (&lt;strong&gt;.NET/C#/ActiveRecord&lt;/strong&gt;): &lt;a href="http://dotnetfacts.blogspot.com/2009/09/create-firebird-database-from-script.html"&gt;Create a Firebird database from script file with ActiveRecord&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7883247768244567958-8681536390724187459?l=free-database.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://free-database.blogspot.com/feeds/8681536390724187459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://free-database.blogspot.com/2009/09/create-firebird-database-from-script.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883247768244567958/posts/default/8681536390724187459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883247768244567958/posts/default/8681536390724187459'/><link rel='alternate' type='text/html' href='http://free-database.blogspot.com/2009/09/create-firebird-database-from-script.html' title='Create Firebird database from script file by code'/><author><name>DotNetFacts</name><uri>http://www.blogger.com/profile/10845230539682811461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_m9VtXqkOxi8/Sv3pY5m1imI/AAAAAAAAAJY/iPx-Fmvp1ag/S220/Dot-Net-Logo-Small.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883247768244567958.post-1573100204716078589</id><published>2009-05-07T13:33:00.000-07:00</published><updated>2009-05-08T01:17:52.661-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DateTime'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Oracle date functions</title><content type='html'>&lt;div style="float: left; margin: 3px 3px 3px 3px;"&gt;
&lt;table width="100%"&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-7646043077243506";
google_ad_host = "pub-1599271086004685";
/* TXT_300x250 */
google_ad_slot = "5746121619";
google_ad_width = 300;
google_ad_height = 250;
//--&gt;
&lt;/script&gt;
&lt;script 
src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;Here is a list of the Oracle Date functions. I had enough problems with the Oracle dates in the past, so I created this list, maybe someone will find it useful.&lt;/p&gt;

&lt;h3&gt;Oracle SYSDATE function&lt;/h3&gt;

&lt;p&gt;Returns the current date and time set for the operating system on which the database resides.&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;SYSDATE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div    style="   background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT SYSDATE FROM dual;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;


&lt;h3&gt;Oracle CURRENT_DATE function&lt;/h3&gt;

&lt;p&gt;Returns the current date in the session time zone, in a value in the Gregorian calendar of datatype DATE.&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;CURRENT_DATE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div    style="   background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT CURRENT_DATE FROM dual;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;


&lt;h3&gt;Oracle "+" and "-" (plus/minus) date operators&lt;/h3&gt;

&lt;p&gt;Add or substract a number of days from a date.&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;{date} + {integer}
&lt;br/&gt;
{date} - {integer}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div    style="   background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT SYSDATE + 1 FROM dual;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;div    style="   background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT SYSDATE - 1 FROM dual;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;


&lt;h3&gt;Oracle ADD_MONTHS function&lt;/h3&gt;

&lt;p&gt;Function to add a number of months to a date. This could be rounded to below if the resulting month has fewer days than the month this function is applied to.&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;ADD_MONTHS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div    style="   background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT add_months(SYSDATE, 2) FROM dual;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;


&lt;h3&gt;Oracle DUMP function&lt;/h3&gt;

&lt;p&gt;Returns a VARCHAR2 value containing the datatype code, length in bytes, and internal representation of a value.&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;DUMP({value} [,{return_format}[,{start_position}[,{length}]]]){value}{return_format}{start_position}{length}{value}{return_format}{start_position}{length}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div    style="   background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT add_months(SYSDATE, 2) FROM dual;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;

&lt;h3&gt;Oracle GREATEST function&lt;/h3&gt;

&lt;p&gt;With the greatest function you can select the date/time that is the highest in a range of date/times.&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;GREATEST&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div    style="   background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT GREATEST(SYSDATE-7, SYSDATE-9, SYSDATE+2)FROM t;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;

&lt;h3&gt;Oracle INTERVAL function&lt;/h3&gt;

&lt;p&gt;Interval to adjust date-time.&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;INTERVAL '{integer}' {unit}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div    style="   background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT TO_CHAR(SYSDATE + INTERVAL '10' MINUTE, 'HH:MI:SS') FROM dual;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;

&lt;h3&gt;Oracle LEAST function&lt;/h3&gt;

&lt;p&gt;With the least function you can select the earliest date/time in a range of date/times.&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;LEAST({date}, {date}, {date}, ...)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div    style="   background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT LEAST(datecol1, datecol2, datecol3) FROM t;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;


&lt;h3&gt;Oracle LAST_DAY function&lt;/h3&gt;

&lt;p&gt;Returns the last_day of a month based on the month the passed date is in.&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;LAST_DAY({date})&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div    style="   background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT LAST_DAY(CURRENT_DATE) FROM t;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;

&lt;h3&gt;Oracle LEAST function&lt;/h3&gt;

&lt;p&gt;With the least function you can select the earliest date/time in a range of date/times.&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;LEAST({date}, {date}, {date}, ...)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div    style="   background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT LEAST(datecol1, datecol2, datecol3) FROM t;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;

&lt;h3&gt;Oracle MONTHS_BETWEEN function&lt;/h3&gt;

&lt;p&gt;Returns the number of months between two dates. The number is not rounded.&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MONTHS_BETWEEN({latest_date}, {earliest_date})&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div    style="   background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT MONTHS_BETWEEN(SYSDATE+365, SYSDATE-365) FROM dual;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;

&lt;h3&gt;Oracle NEXT_DAY function&lt;/h3&gt;

&lt;p&gt;Date of next specified date following a date NEXT_DAY(, ) Options are SUN, MON, TUE, WED, THU, FRI, and SAT. This can be dependend on NLS_SETTINGS!&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;NEXT_DAY({date}, {day of the week})&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div style="background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT NEXT_DAY(SYSDATE, 'FRI') FROM dual;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;

&lt;h3&gt;Oracle ROUND function&lt;/h3&gt;

&lt;p&gt;Returns date rounded to the unit specified by the format model. If you omit the format, the date is rounded to the nearest day.&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;ROUND({date_value}, {format})&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div style="background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT ROUND(TO_DATE('27-OCT-00'),'YEAR') NEW_YEAR FROM dual;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;

&lt;h3&gt;Oracle TRUNC function&lt;/h3&gt;

&lt;p&gt;Convert a date to the date without time (0:00h).&lt;/p&gt;

&lt;table cellpadding="5" cellspacing="5"&gt;
&lt;tbody&gt;&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;TRUNC({date_time})&lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="white"&gt;
&lt;td&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;div style="background: whitesmoke;font-family:Courier New;font-size:10pt;color:black;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color:#a31515;"&gt;SELECT TRUNC(SYSDATE);&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7883247768244567958-1573100204716078589?l=free-database.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://free-database.blogspot.com/feeds/1573100204716078589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://free-database.blogspot.com/2009/05/oracle-date-functions.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883247768244567958/posts/default/1573100204716078589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883247768244567958/posts/default/1573100204716078589'/><link rel='alternate' type='text/html' href='http://free-database.blogspot.com/2009/05/oracle-date-functions.html' title='Oracle date functions'/><author><name>DotNetFacts</name><uri>http://www.blogger.com/profile/10845230539682811461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_m9VtXqkOxi8/Sv3pY5m1imI/AAAAAAAAAJY/iPx-Fmvp1ag/S220/Dot-Net-Logo-Small.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883247768244567958.post-2192751608565923970</id><published>2009-05-01T09:07:00.000-07:00</published><updated>2009-05-03T04:19:11.471-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='embedded'/><category scheme='http://www.blogger.com/atom/ns#' term='Firebird'/><title type='text'>Embedded Firebird database overview</title><content type='html'>&lt;div style="float: left; margin: 3px 3px 3px 3px;"&gt;
&lt;table width="100%"&gt;
&lt;tr&gt;
&lt;td align="middle"&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-7646043077243506";
google_ad_host = "pub-1599271086004685";
/* TXT_300x250 */
google_ad_slot = "5746121619";
google_ad_width = 300;
google_ad_height = 250;
//--&gt;
&lt;/script&gt;
&lt;script 
src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;
&lt;/script&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;I was looking for a &lt;strong&gt;small and powerful database&lt;/strong&gt; in order to fulfil the requirements of my last project. Because the database will be running locally I took the decision to use an &lt;strong&gt;embedded database&lt;/strong&gt;. After a few searches over the Internet and some embedded database comparison reviews, I found &lt;strong&gt;Firebird&lt;/strong&gt; which is actually a powerful but unknown (yet) relational database system. Here are some great features of the &lt;a href="http://www.firebirdsql.org/"&gt;Firebird&lt;/a&gt; embedded database version:&lt;/p&gt;

&lt;h3&gt;Runtime size&lt;/h3&gt;

&lt;p&gt;The size of the runtime is &lt;strong&gt;2 MB&lt;/strong&gt; in the minimal configuration. There are &lt;strong&gt;only two files required&lt;/strong&gt; (an embedded Firebird runtime DLL and an ADO.NET provider assembly). Even with all the other supporting files it doesn't get over &lt;strong&gt;3 MB&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The facts of having such a small footprint of the runtime makes me even more happy about using the &lt;strong&gt;Firebird&lt;/strong&gt; as an embedded database.&lt;/p&gt;

&lt;h3&gt;XCOPY deployment&lt;/h3&gt;

&lt;p&gt;Both the runtime and database file can be &lt;strong&gt;deployed by simple copying&lt;/strong&gt;, no separate installer or component registration is required.&lt;/p&gt;

&lt;p&gt;Could it be more simple than this?&lt;/p&gt;

&lt;h3&gt;Custom filename extensions&lt;/h3&gt;

&lt;p&gt;The database file (it's just a single file) &lt;strong&gt;can have any name and extension&lt;/strong&gt; and can be located at any place on your hard drive. You can associate the extension with your application.  This allows you to use &lt;strong&gt;Firebird&lt;/strong&gt; database as an intelligent storage format.&lt;/p&gt;

&lt;p&gt;This is also a feature I lake to have, because my users will create databases on-the-fly but I want to track them by categories using different file extensions. Great!&lt;/p&gt;

&lt;h3&gt;Migration&lt;/h3&gt;

&lt;p&gt;When migrating the database to a standalone &lt;strong&gt;Firebird&lt;/strong&gt; server just copy the database file and change a connection string on your client. The migration to a standalone &lt;strong&gt;Firebird&lt;/strong&gt; server couldn't be easier.&lt;/p&gt;

&lt;h3&gt;Open-source&lt;/h3&gt;

&lt;p&gt;The license is open-source but commercial friendly. You can bundle &lt;strong&gt;embedded Firebird with your application&lt;/strong&gt; without making your code available.&lt;/p&gt;

&lt;p&gt;If you want to know how to user GUIDs with Firebird and &lt;a href="http://www.castleproject.org/activerecord/index.html"&gt;ActiveRecord&lt;/a&gt;, read this article: &lt;a href="http://dotnetfacts.blogspot.com/2009/04/activerecord-firebird-and-guid-primary.html?showComment=1240945500000#c8668367968937603916"&gt;ActiveRecord, Firebird and Guid Primary Keys&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7883247768244567958-2192751608565923970?l=free-database.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://free-database.blogspot.com/feeds/2192751608565923970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://free-database.blogspot.com/2009/05/embedded-firebird-database.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883247768244567958/posts/default/2192751608565923970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883247768244567958/posts/default/2192751608565923970'/><link rel='alternate' type='text/html' href='http://free-database.blogspot.com/2009/05/embedded-firebird-database.html' title='Embedded Firebird database overview'/><author><name>DotNetFacts</name><uri>http://www.blogger.com/profile/10845230539682811461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/_m9VtXqkOxi8/Sv3pY5m1imI/AAAAAAAAAJY/iPx-Fmvp1ag/S220/Dot-Net-Logo-Small.jpg'/></author><thr:total>3</thr:total></entry></feed>
