Error while inserting into sybase database

Hi experts...
I am working with sybase ase and while inserting values into the sampTable  table i am getting the following error..
Please help...

Error Code: 257
SQL State: 42000
SQL: insert into  sampTable values ('99999','888881','6','ASDF','2011-04-28 07:48:01.249','SYSTEM','Y' )
Exception: com.sybase.jdbc2.jdbc.SybSQLException: Implicit conversion from datatype 'VARCHAR' to 'INT' is not allowed.  Use the CONVERT function to run this query.

The datatype of the table sampTable is:[int,int,,int,varchar,date,varchar,varchar]
gaugetaAsked:
Who is Participating?
 
Pratima PharandeCommented:
try

insert into  sampTable values (99999,888881,6,'ASDF','2011-04-28 07:48:01.249','SYSTEM','Y' )

do not give '' whereever int
0
 
abbas_najafizadehCommented:
it's not recommended you use INSERT command without column list:
please use this syntax:
INSERT INTO table_name (colname1, colname2 , ....) values (val1,val2, ...);

instead of:
INSERT INTO table_name values (val1,val2, ...);

your used syntax is error prone, and might your values insert into table in another column names that has an invalid data-type ...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.