Error while inserting into sybase database

Posted on 2011-04-28
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]
Question by:gaugeta
    LVL 39

    Accepted Solution


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

    do not give '' whereever int
    LVL 2

    Expert Comment

    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 ...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    At the beginning of the year, the IT world was taken hostage by the shareholders of LogMeIn. Their free product, which had been free for ten years, all of the sudden became a "pay" product. Now, I am the first person who will say that software maker…
    This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now