Select Timestamp-Literal Example

Timestamp constants may be expressed in SQL statements as a character string or embedded in a vendor string. Pervasive PSQL treats the character string representation as a string of type SQL_CHAR and the vendor string representation as a value of type SQL_TIMESTAMP. Pervasive PSQL partially supports extended SQL grammar, as outlined in this function.

The next two statements retrieve records from the Billing table where the start day and time for the log is 1996-03-28 at 17:40:49.

SELECT * FROM Billing WHERE log = '1996-03-28 17:40:49.0000000'
SELECT * FROM Billing WHERE log = {ts '1996-03-28 17:40:49.0000000'}

Pervasive PSQL supports the following time literal format: 'YYYY-MM-DD HH:MM:SS.MMMMMMM'.

Thursday, 18 April 2019 Posted in Example SQL Statements