How to change the default value and to alter a column in sql

0 votes

I got an error while setting up a new default value and to alter a column's data type:

ERROR 1064 (42000): You have an error in your SQL syntax;

What can be the solution can anyone suggest?

Jun 21, 2019 in Big Data Hadoop by Daisy
326 views

1 answer to this question.

0 votes

Hi,

You can try this:

ALTER TABLE foobar_data CHANGE COLUMN col col VARCHAR(255) NOT NULL DEFAULT '{}';

It should work.

answered Jun 24, 2019 by Gitika
• 65,850 points

Related Questions In Big Data Hadoop

0 votes
1 answer

How to Modify the Maximum Number of Versions for a Column Family in Hbase?

Hey, The example uses HBase Shell to keep ...READ MORE

answered May 31, 2019 in Big Data Hadoop by Gitika
• 65,850 points
1,734 views
0 votes
1 answer

How to get the column name printed in a file along with the output in Hive?

Hi @Neethu, Regarding your query, I would suggest ...READ MORE

answered Jul 2, 2020 in Big Data Hadoop by Gitika
• 65,850 points
459 views
0 votes
1 answer

How to change the default replication factor in Hadoop?

Hi@akhtar, You can change the default replication factor from the ...READ MORE

answered Oct 3, 2020 in Big Data Hadoop by MD
• 95,360 points
511 views
0 votes
1 answer
0 votes
1 answer

What is an index in SQL?

An index is used to speed up ...READ MORE

answered Feb 3 in Database by Vaani
• 7,020 points
39 views
0 votes
1 answer

Ordering by the order of values in a SQL IN() clause

Use MySQL's FIELD() function: SELECT name, description, ... FROM ... WHERE id ...READ MORE

answered Feb 4 in Database by Neha
• 8,560 points
340 views
0 votes
1 answer
0 votes
2 answers

How to change the location of a table in hive?

Changing location requires 2 steps: 1.) Change location ...READ MORE

answered Feb 12, 2020 in Big Data Hadoop by Saksham Sehrawet
5,130 views
0 votes
1 answer

How to Change the maximum number of cells of a column family?

Hey, Given below is the syntax to change ...READ MORE

answered May 24, 2019 in Big Data Hadoop by Gitika
• 65,850 points
776 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP