How do I add date with timestamp? I am getting an error while inserting row

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bansari
    New Member
    • Jul 2010
    • 20

    #1

    How do I add date with timestamp? I am getting an error while inserting row

    ERROR: value too long for type character varying(8)

    ********** Error **********

    ERROR: value too long for type character varying(8)
    SQL state: 22001

    I used following script to add a Row:

    INSERT INTO tbluser(
    userid, username, password, name, birthdate, sscper, fees,
    lastaccessedtim e)
    VALUES (1, 'elitecore','el ite', 'Elitecore', '2003-1-1',88.1,700.50,
    DEFAULT);



    I created my table with this create script:

    CREATE TABLE tbluser
    (
    userid integer,
    username character varying(8),
    "password" character varying(8),
    "name" character varying(60),
    birthdate date,
    sscper numeric,
    fees numeric,
    lastaccessedtim e timestamp without time zone
    )
    WITH (
    OIDS=FALSE
    );



    Kidly help as early as possible:
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    The value 'elitecore' is nine characters length and it is too much for varchar(8) that you defined in table.

    Comment

    • Jyoti Ballabh
      Banned
      New Member
      • Jul 2010
      • 115

      #3
      the variable length is more than what you have defined

      Comment

      Working...