Questions tagged [alter]

'alter' is a SQL keyword used to change or modify the table structure or the records in a table.

835 questions
-2
votes
1 answer

Rename SQLite table not working

I am using the following code (in B4A) to delete an old CUSTOMERS table and then rename a new version of it. However, I always end up with a blank (new) CUSTOMERS table. If I don't do the rename the CUSTOMERS_NEW table is perfectly ok with the…
-2
votes
1 answer

MySQL Alter Column causes Error 1205 and error 2046

I'm using MySQL Workbench and trying to alter a column name. The column is part of many foreign keys. I'm thinking that's what's causing the error. I'm trying to rename strCustomerCode to strCustomerCodeNEW Code: ALTER TABLE…
John Skolits
  • 13
  • 1
  • 5
-2
votes
1 answer

ALTER TABLE mysql error

I have create .sql file have a code like this: ALTER TABLE `tb_1` ADD `ex1` TINYINT( 1 ) NOT NULL DEFAULT '0' ALTER TABLE `tb_2` ADD `ex2` tinyint(1) NOT NULL DEFAULT '1' ALTER TABLE `tb_3` ADD `ex2` varchar(35) NOT NULL and I always get error when…
user2203703
  • 1,955
  • 4
  • 22
  • 36
-2
votes
1 answer

Mysql add default value for all date field

I must to change default value for all date field in my database. Do you know how to do that fast. Thanks
Flex60460
  • 933
  • 2
  • 18
  • 49
-3
votes
1 answer

Changing the sequence value of a PostgreSQL Sequence

How can I resequence the value start of a Sequence in PostgreSQL?
Anthony
  • 3
  • 1
-4
votes
1 answer

Re-numbering a non-unique column in a SQL Server table

I'm trying to renumber a column named Count, in a SQL Server 2019 table. The layout is like…
joshAU
  • 39
  • 8
-4
votes
1 answer

Android ALTER SQL databese - unable to open/read Desktop PC

After using ALTER TABLE to add column to table I was unable to open the db under Windows using many SQLite editors or browsers. Seems the problem is with the SQLite ver. that they support. Is there tool that can open db that was modified with ALTER…
John BG
  • 346
  • 3
  • 10
-5
votes
1 answer

Python Write Line with two operations

I have this working code: S095 = 'S095' E095 = 'E095' DocLan = 'c:\DocLan.asc' tempDocLan = open( DocLan, 'r+' ) for line in fileinput.input( DocLan ): if fileinput.lineno() > 1: LanNr = find_nth(line, "S095", 1), " - ", …
-6
votes
1 answer

pls correct my mistake

alter table medicine rename price to purchase_price ;
Nina
  • 1
1 2 3
55
56