21.10.2013 Views

Firebird 2.1 Language Reference Update

Firebird 2.1 Language Reference Update

Firebird 2.1 Language Reference Update

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Library: fbudf<br />

External functions (UDFs)<br />

RETURNS TIMESTAMP<br />

ENTRY_POINT 'addSecond' MODULE_NAME 'fbudf'<br />

Added in: 1.0 (Win), 1.5 (Linux)<br />

addWeek<br />

Description: Returns the first argument with number weeks added. Use negative numbers to subtract.<br />

Result type: TIMESTAMP<br />

Syntax:<br />

addweek (atimestamp, number)<br />

Declaration:<br />

DECLARE EXTERNAL FUNCTION addWeek<br />

TIMESTAMP, INT<br />

RETURNS TIMESTAMP<br />

ENTRY_POINT 'addWeek' MODULE_NAME 'fbudf'<br />

The DATEADD alternative: The internal function DATEADD, which can replace all the other<br />

add functions, doesn't support WEEK yet. This will be realised in <strong>Firebird</strong> 2.5. Meanwhile,<br />

you can use DATEADD(7*number DAY TO atimestamp) – or stick with addWeek.<br />

Library: fbudf<br />

Added in: 1.0 (Win), 1.5 (Linux)<br />

Better alternative: Internal function DATEADD<br />

addYear<br />

Description: Returns the first argument with number years added. Use negative numbers to subtract.<br />

Result type: TIMESTAMP<br />

Syntax:<br />

addyear (atimestamp, number)<br />

Declaration:<br />

DECLARE EXTERNAL FUNCTION addYear<br />

TIMESTAMP, INT<br />

RETURNS TIMESTAMP<br />

ENTRY_POINT 'addYear' MODULE_NAME 'fbudf'<br />

168

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!