Questions tagged [mysql4]

34 questions
124
votes
9 answers

Using ALTER to drop a column if it exists in MySQL

How can ALTER be used to drop a column in a MySQL table if that column exists? I know I can use ALTER TABLE my_table DROP COLUMN my_column, but that will throw an error if my_column does not exist. Is there alternative syntax for dropping the…
jcodeninja
  • 2,155
  • 4
  • 17
  • 14
4
votes
4 answers

Summing a comma separated column in MySQL 4 (not 5)

I'm writing a query that selects data from one table into another, one of the columns that needs to be moved is a DECIMAL column. For reasons beyond my control, the source column can sometimes be a comma separated list of numbers. Is there an…
Parris Varney
  • 11,320
  • 12
  • 47
  • 76
4
votes
2 answers

Need MySQL 4 to ignore ALTER TABLE errors

I have a MySQL script which is executed automatically under certain conditions. That script executes an ALTER TABLE command, because that column is needed in the database, but it may or may not have it... Is it possible to make MySQL 4 execute the…
Tom
  • 6,991
  • 13
  • 60
  • 78
4
votes
2 answers

Drop constraints only if it exists in mysql server 5.0

i want to know how to drop a constraint only if it exists. is there any single line statement present in mysql server which will allow me to do this. i have tried the following command but unable to get the desire output alter table airlines drop…
Haraprasad
3
votes
2 answers

MySQL And C applications

When building a application that accesses a MySQL database on linux using C/C++ i have to dynamically link into the mysql client library. Is there a way in which i can statically link the application so that the mysql client libraries are no longer…
jcodeninja
  • 2,155
  • 4
  • 17
  • 14
3
votes
1 answer

MySQL sectioned ordering

I have a data set like this: boolean name value 0 Text10 20 1 Text1 8 0 Text4 46 1 Text9 84 1 Text5 66 0 Text2 35 0 Text9 2 1 Text6 55 Ordering by the boolean column will split the…
vmassuchetto
  • 1,529
  • 1
  • 20
  • 44
2
votes
3 answers

MySQL: select distinct names for each date?

Say I want to select rows with a date range or date_feild > 2009-06-01 && date_field < 2009-07-01. and I want to select the first_name_field and last_name_field but I only want the same name (F+L) to show up once per date. So the same name can show…
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
2
votes
4 answers

updating primary key of master and child tables for large tables

I have a fairly huge database with a master table with a single column GUID (custom GUID like algorithm) as primary key and 8 child tables that have foreign key relationships with this GUID column. All the tables have approximately 3-8 million…
shyam
  • 9,134
  • 4
  • 29
  • 44
2
votes
2 answers

C MySQL client library behaviour

I have a client application that connects to the MySQL database 4 server using stock libraries on SuSE SLES 9. However, at times when processing a particular reset set from the server, iterating throw the results does not allow me to process all…
jcodeninja
  • 2,155
  • 4
  • 17
  • 14
2
votes
1 answer

Type mismatch in classic ASP after upgrade to MySQL 5

When upgrading a site for customer to a new server with MySQL 5 instead of MySQL 4, I ran into the usual bunch of problems when migrating the database, some of which simply make mysql complain about the SQL dump (those were the easiest to fix) while…
marlar
  • 3,858
  • 6
  • 37
  • 60
1
vote
1 answer

Is it possible to have a mysql table refer to a table in a foreign database?

Is it possible to use a mysql table transparently though the table is an alias for a table in a foreign database?
prinzdezibel
  • 11,029
  • 17
  • 55
  • 62
1
vote
2 answers

PHP: keep track of requests by user and by product brand?

I have a MySQL table that has price requests in it, it has date, first, last, and product_id fields. The product brand can be found from the product table from the product_id. Given a date range, they want to know the total number of requests, by…
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
1
vote
1 answer

Fastest way to join mysql 4.0 data from multiple tables?

I have 3 mysql 4.0 tables: all have fields ID(int), type(int) and another field, value which is either varchar(255), tinyint or int. I need to write them all out and I end up getting three DataTables, looping over them, and creating rows into a…
Spikolynn
  • 4,067
  • 2
  • 37
  • 44
1
vote
4 answers

Is tabular data?

From a standpoint of using XHTML 1.0 Strict as DOCTYPE -- would the input tag in XHTML be considered tabular data? And if not, could someone please give me some good advise on valid XHTML (Strict 1.0) code that I could use in combination with MySQL…
Nisto
  • 13
  • 3
1
vote
1 answer

ERROR 2027 (HY000): Malformed packet - during login

C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql -u root -p Enter password: ERROR 2027 (HY000): Malformed packet I have 2 MySQL DBs version on my server 4.0 and 5.7. My apps can connect to both MySQL DBs without problem but when I try to login to…
Darren
  • 11
  • 1
  • 4
1
2 3