11.07.2015 Views

SQL Reference Volume 1 - Ibm

SQL Reference Volume 1 - Ibm

SQL Reference Volume 1 - Ibm

SHOW MORE
SHOW LESS
  • No tags were found...

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

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

CURRENT TIMECURRENT TIMEThe CURRENT TIME (or CURRENT_TIME) special register specifies a time that isbased on a reading of the time-of-day clock when the <strong>SQL</strong> statement is executed atthe application server. If this special register is used more than once within a single<strong>SQL</strong> statement, or used with CURRENT DATE or CURRENT TIMESTAMP withina single statement, all values are based on a single clock reading.When used in an <strong>SQL</strong> statement inside a routine, CURRENT TIME is not inheritedfrom the invoking statement.In a federated system, CURRENT TIME can be used in a query intended for datasources. When the query is processed, the time returned will be obtained from theCURRENT TIME register at the federated server, not from the data sources.Example: Using the CL_SCHED table, select all the classes (CLASS_CODE) thatstart (STARTING) later today. Today’s classes have a value of 3 in the DAY column.SELECT CLASS_CODE FROM CL_SCHEDWHERE STARTING > CURRENT TIME AND DAY = 3150 <strong>SQL</strong> <strong>Reference</strong> <strong>Volume</strong> 1

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

Saved successfully!

Ooh no, something went wrong!