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 in Big Data Hadoop by Daisy
19 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 by Gitika
• 25,340 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 in Big Data Hadoop by Gitika
• 25,340 points
37 views
0 votes
1 answer

How to print the content of a file in console present in HDFS?

Yes, you can use hdfs dfs command ...READ MORE

answered Apr 19, 2018 in Big Data Hadoop by Shubham
• 13,290 points
494 views
0 votes
1 answer

How to change the replication factor of specific directory in Hadoop?

Yes, you can change the replication factor ...READ MORE

answered May 10, 2018 in Big Data Hadoop by Shubham
• 13,290 points
220 views
0 votes
1 answer
0 votes
1 answer

Want a command to be executed in Salt only if a directory is empty

You should consider using this inside your ...READ MORE

answered Jun 12, 2018 in DevOps Tools by Damon Salvatore
• 5,510 points
38 views
0 votes
1 answer

Creating A New MySQL User In Amazon RDS Environment

AWS RDS security groups documentation (a common ...READ MORE

answered Jul 18, 2018 in AWS by Priyaj
• 56,520 points
146 views
0 votes
1 answer

How to change the location of a table in hive?

Hey, Basically When we create a table in hive, ...READ MORE

answered May 14 in Big Data Hadoop by Gitika
• 25,340 points
142 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 in Big Data Hadoop by Gitika
• 25,340 points
20 views