0

This question is for inserting data into Clarion .TPS files using the TopSpeed ODBC driver. We are using C#.

I have an insert statement like this:

INSERT INTO MYTAB
(SOMEDATE, SOMETIME) VALUES ({d '2020-08-25'}, 1)

with SOMETIME being defined as TIME.

We get this error while trying to insert:

ERROR [S0000] [SoftVelocity Inc.][TopSpeed ODBC Driver]Invalid operand for operator: <assignment>

The vague error messages are really annoying.

What is the appropriate way to specify a time?

I am trying just an integer as that is what the documentation days a time is (100ths of seconds since midnight + 1).

Is there some definitive guide to the SQL syntax that is allowed with the softvelocity ODBC driver as it is a bit exhausting to be guessing.

Be Kind To New Users
  • 9,672
  • 13
  • 78
  • 125
  • Did you try a DateTime or a TimeSpan? A *time* is just a TimeSpan offset from midnight – Flydog57 Aug 09 '20 at 03:03
  • @Flydog57 You may have missed the Clarion tag. I will edit the question so others don't fall into the same trap. – Be Kind To New Users Aug 09 '20 at 03:06
  • No idea about this TopSpeed ODBC driver and I checked all over the internet and there is no documentation! But have you tried passing in the following time format instead: { t 'hh:mi:ss'} for example: {t '23:40:00'} ? – Jamal Aug 09 '20 at 05:42
  • Yeah, I tried that and a few other variations. We can read the field; it comes back as a integer. Just can't figure out how to write it. – Be Kind To New Users Aug 09 '20 at 14:36
  • "We get an error while inserting." - You have sufficient rep and badges to know that is an insufficient description of the problem. – Gord Thompson Aug 09 '20 at 14:59
  • 1
    @GordThompson I got the error message from the developer and added it to the post. – Be Kind To New Users Aug 09 '20 at 23:08
  • *"The vague error messages are really annoying."* - Indeed, as are dodgy ODBC drivers. *"What is the appropriate way to specify a time?"* - As documented [here](https://learn.microsoft.com/en-us/sql/odbc/reference/appendixes/date-time-and-timestamp-escape-sequences?view=sql-server-ver15), `{t '19:20:21.23'}` should work, and a reasonably robust driver would also accept the string equivalent `'19:20:21.23'`. If neither of those works then you'll need to reach out to the driver provider and get them to tell you what (if anything) *will* work. – Gord Thompson Aug 10 '20 at 00:19

0 Answers0