Previous Topic: Write SQL for BusinessObjects Reports

Next Topic: Attribute Aliases

PDM Functions

To assist in working with specialized CA SDM features and data types, the ODBC driver extends SQL to support a number of additional query functions. All driver-supported functions begin with the string "Pdm", and are known as PDM functions as described in the following table:

PDM Functions

Description

PdmAddDays([date,] count)

When used with one argument, adds the number of days in its argument to today's date and returns the result. When used with two arguments, adds the number of days in its second argument to the value of the date column specified in its first argument and returns the result. This function may be used anywhere in the query

PdmAddMonths([date,] count)

When used with one argument, adds the number of months in its argument to today's date and returns the result. When used with two arguments, adds the number of months in its second argument to the value of the date column specified in it first argument and returns the result. The single argument form can be used anywhere in the query. The two-argument form can be used only in the selection list

PdmDay([date])

When used with no arguments, returns the current day as an integer. When used with one argument, returns the day associated with the value of the date column specified in its argument. The zero argument form can be used anywhere in the query. The one-argument form can be used only in the selection list.

PdmDownTime( slaName, workshift, startDate, endDate )

Calculates the downtime between two dates under the specified SLA and workshift. This function can be used only in the selection list.

PdmMonth([date])

When used with no arguments, returns the current month as an integer from 1 to 12. When used with one argument, returns the month associated with the value of the date column specified in its argument. The zero argument form can be used anywhere in the query. The one-argument form can be used only in the selection list.

PdmMonthName([date])

When used with no arguments, returns the localized name of the current month ("January", "February", and so on). When used with one argument, returns the localized name of the value of the date column specified in its argument. The zero argument form can be used anywhere in the query. The one-argument form can be used only in the selection list.

PdmDay([date])

When used with no arguments, returns the current day as an integer. When used with one argument, returns the day associated with the value of the date column specified in its argument. The zero argument form can be used anywhere in the query. The one-argument form can be used only in the selection list.

PdmSeconds(date)

Returns the value of the date column specified in its argument in its raw form as the number of seconds from midnight January 1, 1970. This function can be used only in the selection list. The argument is required.

PdmString(column)

Returns the string equivalent of value of the column specified in its argument. This function can be used with UUID, date, or string columns. It can be used only in the selection list.

PdmToday()

PdmToday() [timeAdj [, day [, month [, year]]]] )

Evaluates to today's date (in seconds from 1/1/1970), adjusted according to the arguments:

 

timeAdj:

-1—adjust time to beginning of day (0:00:00);

+1—adjust time to end of day (23:59:59)

 

day:

negative—adjust date by number of days specified

positive—set day to absolute value specified (or to last day of month, whichever is less)

 

month:

negative—adjust date by number of months specified

positive—set month to absolute value specified (or to December (12), whichever is less)

 

year:

negative—adjust date by number of years specified

positive—set year to absolute value specified

 

Adjustments are applied in the order year, month, day. A zero or omitted argument is ignored.

PdmYear([date])

When used with no arguments, returns the current year as a four-digit integer. When used with one argument, returns the year associated with the value of the date column specified in its argument. The zero argument form can be used anywhere in the query. The one-argument form can be used only in the selection list.