Insertion automatically truncates the value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Medhatithi
    New Member
    • Mar 2007
    • 33

    Insertion automatically truncates the value

    My table creation script is as follows:

    CREATE TABLE BSClient(BSClie ntUniqNum int ,
    CompanyName varchar(15));

    Now, when I am inserting a row like this:

    insert into BSClient values(121,'GEN ERAL ELECTRIC');

    Here, the company name is 19 characters long. Ideally, this should give an error (at least in Oracle, it does). But, here the string is implicitly truncated to 15 characters and the truncated string is getting inserted into the column. Is this the normal behaviour for Sybase? Are there any ways to override this behaviour?
  • Medhatithi
    New Member
    • Mar 2007
    • 33

    #2
    Hi all, found a solution after going thru the docs a bit. There is an option
    SET STRING_RTRUNCAT ION ON, which will override the default behaviour. Howevre, this is a session level statement, but it does not seem to work while inside a proc, an insertion is done

    Comment

    Working...