Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cannot convert TimeStamp to TimeStamp

127 views
Skip to first unread message

sirB

unread,
Aug 12, 2003, 3:53:36 PM8/12/03
to
Hi All,

Just upgraded to asa 8.0.2 1299 from a pre 8.0.2 version. We
have a stored procedure that inserts a row into a table with
a timestamp. The value being inserted into the timestamp is
now(*). We get the error cannot insert timestamp into
timestamp.

Any ideas?

Thanks,

Brandon

sirB

unread,
Aug 12, 2003, 3:55:38 PM8/12/03
to
Should be v8.0.2 4299.

thanks

brandon

sirB

unread,
Aug 12, 2003, 5:10:09 PM8/12/03
to
Further investigation seems to indicate that the problem is
in the ole odb driver that comes with ASA. We created other
tables and stored procedures that the now(*) works. But
calling a stored procedure from the application that
contains a now(*) works. Calling a stored procedure with a
timestamp as parameter seems to be the problem.

Here is the section of the log that lists the error:

08/12 15:25:51.863 ** REQUEST conn: 805916408 STMT_PREPARE
"CALL uspImportActivity#Save( ?, ?, ?, ?, ?, ?, ?, ? )"
08/12 15:25:51.863 ** DONE conn: 805916408 STMT_PREPARE
Stmt=132562
08/12 15:25:51.863 ** REQUEST conn: 805916408
STMT_DESCRIBE_OUTPUT Stmt
=-1
08/12 15:25:51.863 ** DONE conn: 805916408
STMT_DESCRIBE_OUTPUT
08/12 15:25:51.863 ** REQUEST conn: 805916408
STMT_DESCRIBE_INPUT Stmt
=-1
08/12 15:25:51.863 ** DONE conn: 805916408
STMT_DESCRIBE_INPUT
08/12 15:25:51.864 ** REQUEST conn: 805916408 STMT_EXECUTE
Stmt=132562
08/12 15:25:51.864 ** HOSTVAR conn: 805916408 0 varchar
'0657'
08/12 15:25:51.864 ** HOSTVAR conn: 805916408 1 int '1479'
08/12 15:25:51.864 ** HOSTVAR conn: 805916408 2 timestamp
'2003-08-12
15:24:15.728922'
08/12 15:25:51.864 ** HOSTVAR conn: 805916408 3 tinyint '1'
08/12 15:25:51.864 ** HOSTVAR conn: 805916408 4 varchar
'Import of
Location'
08/12 15:25:51.864 ** HOSTVAR conn: 805916408 5 timestamp
'2003-08-12
15:25:51.742704'
08/12 15:25:51.864 ** HOSTVAR conn: 805916408 6 varchar
'SMART'
08/12 15:25:51.864 ** HOSTVAR conn: 805916408 7 int '0'
08/12 15:25:51.865 ** ERROR conn: 805916408 code: -157
"Cannot convert
timestamp to a timestamp"

Breck Carter [TeamSybase]

unread,
Aug 13, 2003, 2:54:04 PM8/13/03
to
Indeed, 'semantic checking at runtime' seems to be the order of the
day in ASA 9 GA, and probably all earlier releases.

This works OK...

CREATE TABLE x ( y integer default 'asdf' );

...but this...

INSERT x VALUES ( DEFAULT );

...raises 'Cannot convert asdf to a int' at runtime.

Breck

On 13 Aug 2003 10:11:55 -0700, "Anne Murray"
<nospam_...@sybase.com> wrote:

>Dear SirB;
>
>I have been conversing with someone else about this problem and I suspect
>that the issue is in the table creation ( why it wasn't picked up prior to
>8.0.2.4299 I'm not sure )
>
>The table was created with the following column :
>
> columnA timestamp not null default 'timestamp'
>
>So if I did and insert into the table using the default for this column, the
>default is actually the string 'timestamp' because of the quotes, thus the
>error is a bit confusing due to the actual contents of the string, and I
>think what its trying to say is cannot convert the string 'timestamp' into
>datatype timestamp.
>
>I believe if you remove the quotes, from not null 'timestamp', then you
>should be able to insert into this table successfully.
> Possibly, the fact that ASA lets you set string as a default value for a
>timestamp column could be a bug however I'm not 100% sure.
>
>Sincerely;
>Anne Murray

bca...@risingroad.com
Mobile and Distributed Enterprise Database Applications
http://www.risingroad.com

Anne Murray

unread,
Aug 13, 2003, 1:11:55 PM8/13/03
to
Dear SirB;

I have been conversing with someone else about this problem and I suspect
that the issue is in the table creation ( why it wasn't picked up prior to
8.0.2.4299 I'm not sure )

The table was created with the following column :

columnA timestamp not null default 'timestamp'

So if I did and insert into the table using the default for this column, the
default is actually the string 'timestamp' because of the quotes, thus the
error is a bit confusing due to the actual contents of the string, and I
think what its trying to say is cannot convert the string 'timestamp' into
datatype timestamp.

I believe if you remove the quotes, from not null 'timestamp', then you
should be able to insert into this table successfully.
Possibly, the fact that ASA lets you set string as a default value for a
timestamp column could be a bug however I'm not 100% sure.

Sincerely;
Anne Murray
--
Whitepapers, TechDocs, bug fixes are all available through the
iAnywhere Developer Community at http://www.ianywhere.com/developer

<sirB> wrote in message news:3f3957ca.5c...@sybase.com...

0 new messages