Forum Discussion

piyushj1765's avatar
piyushj1765
Copper Contributor
Jul 05, 2024

POSTGRE SQL

Hi I am getting this error 

ERROR: invalid input syntax for type integer: "Bangalore" CONTEXT: COPY ball, line 2, column inning: "Bangalore" SQL state: 22P02

 

 

How can I fix this????

My code-

 

CREATE TABLE Matches (
id INT,
city int,
date DATE,
player_of_match VARCHAR,
venue VARCHAR,
neutral_venue int,
team1 VARCHAR,
team2 VARCHAR,
toss_winner VARCHAR,
toss_decision VARCHAR,
winner VARCHAR,
result VARCHAR,
result_margin INT,
eliminator VARCHAR,
method VARCHAR,
umpire1 VARCHAR,
umpire2 VARCHAR
);

  • olafhelper's avatar
    olafhelper
    Bronze Contributor

    piyushj1765 

    1. PostGresSQL isn't a Microsoft product, you better should post to a more related forum.

    2. The error message doesn't match to your SQL statement

    3. If you want to create columns of data type VARCHAR, then you have to define a length, like VARCHAR(50) for a column with max. length = 50 characters.

Resources