SqlExecute and binding
Thomas Flemming
tf at ttqv.com
Tue Nov 17 05:47:03 CST 2009
> hth
Yes, thanks Bart.
Bart Pietercil schrieb:
> Hi Thomas
>
>
> every time we open a connection to the db on the server we make a call to 'cm_SetConnectionVars'. This is a procedure we wrote that looks like this:
>
> create or replace procedure cm_SetConnectionVars(in long_anID Long)
> Begin
> .......
> SET PROPERTY DateTimeFormat OF DATABASE TO 'kYMD';
> SET PROPERTY DateSeparator OF DATABASE TO '-';
> ........
> end;
>
>
>
> THe whole explanation of the do's and don'ts about datetime you can find here:
> http://valentina-db.com/dokuwiki/doku.php?id=valentina:vcomponents:vkernel:database:datetime_format
>
> hth
>
> Bart Pietercil
> CTO Cognosis NV
>
>
>
> On 17 Nov 2009, at 10:06, Thomas Flemming wrote:
>
>> ok, it seems like I must do it like this:
>>
>> Dim a(7) As Object
>> a(0) = Str(.coo.lat)
>> a(1) = Str(.coo.lon)
>> a(2) = Str(.coo.alt)
>> a(3) = .first_point
>>
>> then the double and single are inserted correctly.
>> But in which format does a date/time has to be?
>> Is there a general string-format for datetime?
>>
>> Tom
>>
>>
>> Thomas Flemming schrieb:
>>> Hi,
>>>
>>> I've some problems with bindings (with VNET):
>>>
>>> Dim a(3) as object
>>> a(0) = .coo.lat ' double
>>> a(1) = .coo.lon ' double
>>> a(2) = .coo.alt ' single
>>> a(3) = .first_point ' boolean
>>> a(4) = .coo.datetime ' date
>>>
>>> sql As String = "INSERT INTO [mytbl] (lat, lon, alt, fp, date)
>>> VALUES ( :1, :2, :3, :4, :5)"
>>> db.SqlExecute(sql, a)
>>>
>>> This works somehow, but lat, lon, alt are converted to integer.
>>> When I declare a(3) as String, then it works.
>>>
>>> Still I'm not able to insert into the date-field. If a(4) contains a date,
>>> then SqlExecute gives an exeption, something like "1,55 ")" expected"
>>>
>>> How can I insert into a table with mixed field-types?
>>>
>>> Regards,
>>> Tom
>>>
>>>
>>>
>> --
>> /****************************************
>> ** Dipl.-Ing. Thomas Flemming
>> ** Software Development
>> **
>> ** Touratech AG
>> ** Auf dem Zimmermann 7-9
>> ** D-78078 Niedereschach
>> **
>> ** mail tf at ttqv.com
>> ** fon +49 (0) 7728 9279-206
>> ** fax +49 (0) 7728 9279-29
>> **
>> ** http://www.ttqv.com
>> ** http://www.touratech.de
>> **
>> ** ... und immer dem Pfeil nach!
>> ***************************************/
>> _______________________________________________
>> Valentina mailing list
>> Valentina at lists.macserve.net
>> http://lists.macserve.net/mailman/listinfo/valentina
>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>
> __________ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version 4613 (20091116) __________
>
> E-Mail wurde geprüft mit ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
>
--
/****************************************
** Dipl.-Ing. Thomas Flemming
** Software Development
**
** Touratech AG
** Auf dem Zimmermann 7-9
** D-78078 Niedereschach
**
** mail tf at ttqv.com
** fon +49 (0) 7728 9279-206
** fax +49 (0) 7728 9279-29
**
** http://www.ttqv.com
** http://www.touratech.de
**
** ... und immer dem Pfeil nach!
***************************************/
More information about the Valentina
mailing list