MicroStation PowerDraft CONNECT Edition Help

SQL Statements

The following sections contain descriptions of some of the more powerful SQL statements that are supported by the database interface.

Literal expressions used in assignments and comparisons can be of character, numeric or date format. Character strings are single quote delimited. In general, dates can be queried as follows:

  • For ODBC — SELECT * FROM <table> where <date_field> > #01/01/2000#

    The date format through ODBC depends upon the setting of the MicroStation PowerDraft configuration variable MS_DBODBCDATEFORMAT. It is set to mm/dd/yyyy by default. The variable is stored in the odbc.cfg file located in the ..\PowerDraft\config\database\.

  • For Oracle (direct connection) — SELECT* FROM <table> where <date_field> > '21-DEC-00'

    The date format in Oracle is dependent upon the NSL_DATE_FORMAT setting. You must use the following statement keyed in through the SQL Window or the SQL statement portion of VSQL to alter the format (substitute the format you require for mm/dd/yyyy):

    alter session set nls_date_format = 'mm/dd/yyyy'

It is recommended that you use VSQL to create the SQL for the query as it will assist you in properly delimiting the date field.

Note: