Error when Inserting record into Big Query table when datatype is alreday defined

337 views Asked by At

I have created a Table in Big Query and defined the relevant datatype as we wanted it . But while inserting record in Big Query table using Insert statement. I gives me error Value has type STRING which cannot be inserted into column EmployeeID, which has type INT64 at [36:4]

Though when i have already defined EmployeeID as Inetger Datattype

Can someone help here Create table Thanks Insert into

Inserting record in to Big Query table when datatype is already defined

2

There are 2 answers

0
Shafiq Javaid On

If you enclose your integers in quotes, you are effectively converting them to a STRING. Try again but remove your quotes from the values that are supposed to be Integers.

0
bilalgazge On

The pictures you have provided are not very helpful with regards to your query. But I suppose the error you are facing is due to you are inserting string value into INT datatype column. Try once removing the quotes from the insert query for the EmployeeID column. e.g. instead of '100598' write only 100598 (considering that is the integer column where you are trying to insert)