Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Inserting into time-field
Mon, Aug 21 2006 8:06 PMPermanent Link

John
I am getting the following error :

DBISAM Engine Error # 11949 SQL parsing error - Expected NULL, Time expression but instead
found ? in INSERT SQL statement

This is my query :

   q.SQL.Text := 'INSERT INTO Log ([Time-start]) VALUES (:start)';
   q.Prepare;
   q.ParamByName('start').Astime := strtotime('12:00:00');
   q.ExecSQL;

Any ideas why this is happening ?
Tue, Aug 22 2006 12:53 AMPermanent Link

"Johnnie Norsworthy"
"John" <eydunl@post.olivant.fo> wrote in message
news:245370DE-72D0-471A-B884-9E688BFD991F@news.elevatesoft.com...
>I am getting the following error :
>
> DBISAM Engine Error # 11949 SQL parsing error - Expected NULL, Time
> expression but instead
> found ? in INSERT SQL statement
>
> This is my query :
>
>    q.SQL.Text := 'INSERT INTO Log ([Time-start]) VALUES (:start)';
>    q.Prepare;
>    q.ParamByName('start').Astime := strtotime('12:00:00');
>    q.ExecSQL;

Is "-" allowed in a  field name: "Time-start"?

Tue, Aug 22 2006 1:04 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

John,

<< This is my query :

   q.SQL.Text := 'INSERT INTO Log ([Time-start]) VALUES (:start)';
   q.Prepare;
   q.ParamByName('start').Astime := strtotime('12:00:00');
   q.ExecSQL;

Any ideas why this is happening ? >>

Using AsTime should set the data type of the parameter appropriately.  Try
this and see if it corrects it:

   q.SQL.Text := 'INSERT INTO Log ([Time-start]) VALUES (:start)';
   q.ParamByName('start').DataType:=ftTime;
   q.Prepare;
   q.ParamByName('start').Astime := strtotime('12:00:00');
   q.ExecSQL;

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Aug 22 2006 4:19 PMPermanent Link

John
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:

John,

<< This is my query :

   q.SQL.Text := 'INSERT INTO Log ([Time-start]) VALUES (:start)';
   q.Prepare;
   q.ParamByName('start').Astime := strtotime('12:00:00');
   q.ExecSQL;

Any ideas why this is happening ? >>

Using AsTime should set the data type of the parameter appropriately.  Try
this and see if it corrects it:

   q.SQL.Text := 'INSERT INTO Log ([Time-start]) VALUES (:start)';
   q.ParamByName('start').DataType:=ftTime;
   q.Prepare;
   q.ParamByName('start').Astime := strtotime('12:00:00');
   q.ExecSQL;

--
Tim Young
Elevate Software
www.elevatesoft.com


Thank you for your suggestions. I tried both suggestions - but neither fixed the problem. I am still getting the same error message.
---
John
Wed, Aug 23 2006 3:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

John,

<< Thank you for your suggestions. I tried both suggestions - but neither
fixed the problem. I am still getting the same error message. >>

Could you send me an example of this with the table
(timyoung@elevatesoft.com) ?  It would help immensely if I could run it here
in the debugger.


--
Tim Young
Elevate Software
www.elevatesoft.com

Image