Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2010

    Unhappy Unanswered: Problem with Prepared Statement

    Hi All,

    I am facing some problem while using Prepared statement to execute one SQL query which invovles TO_TIMESTAMP() function embeded in it.
    Please find the details of the SQLException. The SQL statement "SELECT OBJECT_KEY,OBJECT_GROUP,OBJECT_TYPE,OBJECT_TYPE_NA ME,OBJECT_DATA,CREATION_STAMP,LAST_UPDATE_STAMP,EX PIRY_STAMP FROM XI_AF_ISP_DB_PERS WHERE OBJECT_GROUP = ? AND EXPIRY_STAMP < TO_TIMESTAMP('2010-02-25 20:32:28.227', 'YYYY-MM-DD HH24:MISXFF')" contains the syntax error[s]: SQL syntax error: the token "(" was not expected here

    at n(
    at n(
    at e(
    at repareStatement(
    at repareStatement(
    at rseStatement(
    at reStatement(

    It is really very very urgent.

    I am running out of ideas. Can any one help me in solving this problem.


  2. #2
    Join Date
    Sep 2001
    Chicago, Illinois, USA
    I am not near a SQL Server to test this, and I am not all that familiar with all of the statements/functions/stored procedures of SQL Server, but the TO_TIMESTAMP sure looks like Oracle syntax to me.

    Did you post this thread in the wrong forum?

    If not, and if SQL Server does not have the TO_TIMESTAMP syntax, then the problem is that you cannot use Oracle syntax in SQL Server.

    In SQL Server the CAST or CONVERT syntax would serve the same function.

    Maverick Software Design

    (847) 864-3600 x2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts