We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Error while inserting into sybase database

gaugeta
gaugeta asked
on
Medium Priority
1,328 Views
Last Modified: 2012-05-11
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]
Comment
Watch Question

CERTIFIED EXPERT
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
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 ...
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.