ERROR 1146 (42S02): Table 'ois.metadata' doesn't exist

2012-03-14 Thread Adarsh Sharma

Dear All,

Is there any way to recover data or only schema of corrupted innodb 
tables.My 4 innodb tables are coorupted in a  database.


mysql> show tables;
+-+
| Tables_in_ois   |
+-+
| acos|
| aros|
| aros_acos   |
| categories  |
| groups  |
| metadata|
| page_content|
| projects|
| results |
| users   |
| website_internalurl |
+-+
12 rows in set (0.00 sec)

mysql> show create table metadata;
ERROR 1146 (42S02): Table 'ois.metadata' doesn't exist

I backup my all remaining tables as I not able to backup corruted tables.

Thanks in advance


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Free tickets to MySQL conference

2012-03-14 Thread Baron Schwartz
If you want to go to this year's MySQL conference like all the cool
kids, now's your chance. Percona is giving away free tickets (and free
books)!  Details here:
http://www.mysqlperformanceblog.com/2012/03/14/win-free-mysql-conference-tickets/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Trying to update existing prices and sizes in products table

2012-03-14 Thread Claudio Nanni
Matthew, Baron,

I am actually a bit confused,* what has the SELECT to do with the UPDATE?*

SELECT ProductSku, COUNT(ProductSku) _import_products FROM
_import_products GROUP BY ProductSku;

I think the problem is simply that you are using two relations (tables)
that are effectively the same and you have to specify an alias for each of
them to let the optimizer understand the SET to which of the two refers to.

*Moreover*, how can this UPDATE know about the table  _import_products ???
if it is not mentioned in the JOIN?

You can fix the first problem adding the aliases:

UPDATE ps4_products ps4_A INNER JOIN ps4_products ps4_B
ON (*_import_products*.ProductSku = ps4_products.ProductSKU)
SET ps4_A.ProductPrice = _import_products.ProductPrice;
SET ps4_As.ProductWeight = _import_products.ProductWeight;
SET ps4_A.ProductWidth = _import_products.ProductWidth;
SET ps4_A.ProductHeight = _import_products.ProductHeight;
SET ps4_A.ProductLength = _import_products.ProductLength;

then you will have the error: "Unknown _import_products"

@Baron:  how can an alias be carried over between two different SQL
statements??

Cheers!

Claudio


2012/3/14 Baron Schwartz 

> Matthew,
>
> The mistake seems to be in believing that the alias from the SELECT
> carries over and is used in the UPDATE. You need to add an alias to
> the UPDATE. You are referring to _import_products in the UPDATE, but
> you never define it as an alias.
>
> On Tue, Mar 13, 2012 at 10:30 PM, Matthew Stuart 
> wrote:
> > Hi all, I have a table of products (ps_4products), and a table of
> up-to-date prices and sizes (_import_products). I am trying to replace old
> content in the table ps4_products with up-to-date content in the
> _import_products table, but I am getting errors.
> >
> > I am trying to ask the DB to match on ProductSKU and then replace the
> relevant info but I am getting this error:
> >
> > Not unique table/alias: 'ps4_products'
> >
> > I have no idea what it means though. Please advise.
> >
> > Here's my query:
> >
> > SELECT ProductSku, COUNT(ProductSku) _import_products FROM
> _import_products
> > GROUP BY ProductSku;
> >
> > UPDATE ps4_products
> > INNER JOIN ps4_products ON (_import_products.ProductSku =
> ps4_products.ProductSKU)
> > SET ps4_products.ProductPrice = _import_products.ProductPrice;
> > SET ps4_products.ProductWeight = _import_products.ProductWeight;
> > SET ps4_products.ProductWidth = _import_products.ProductWidth;
> > SET ps4_products.ProductHeight = _import_products.ProductHeight;
> > SET ps4_products.ProductLength = _import_products.ProductLength;
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:http://lists.mysql.com/mysql
> >
>
>
>
> --
> Baron Schwartz
> Percona Inc 
> Consulting, Training, Support & Services for MySQL
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/mysql
>
>


-- 
Claudio


Re: Trying to update existing prices and sizes in products table

2012-03-14 Thread Baron Schwartz
Matthew,

The mistake seems to be in believing that the alias from the SELECT
carries over and is used in the UPDATE. You need to add an alias to
the UPDATE. You are referring to _import_products in the UPDATE, but
you never define it as an alias.

On Tue, Mar 13, 2012 at 10:30 PM, Matthew Stuart  wrote:
> Hi all, I have a table of products (ps_4products), and a table of up-to-date 
> prices and sizes (_import_products). I am trying to replace old content in 
> the table ps4_products with up-to-date content in the _import_products table, 
> but I am getting errors.
>
> I am trying to ask the DB to match on ProductSKU and then replace the 
> relevant info but I am getting this error:
>
> Not unique table/alias: 'ps4_products'
>
> I have no idea what it means though. Please advise.
>
> Here's my query:
>
> SELECT ProductSku, COUNT(ProductSku) _import_products FROM _import_products
> GROUP BY ProductSku;
>
> UPDATE ps4_products
> INNER JOIN ps4_products ON (_import_products.ProductSku = 
> ps4_products.ProductSKU)
> SET ps4_products.ProductPrice = _import_products.ProductPrice;
> SET ps4_products.ProductWeight = _import_products.ProductWeight;
> SET ps4_products.ProductWidth = _import_products.ProductWidth;
> SET ps4_products.ProductHeight = _import_products.ProductHeight;
> SET ps4_products.ProductLength = _import_products.ProductLength;
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql
>



-- 
Baron Schwartz
Percona Inc 
Consulting, Training, Support & Services for MySQL

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql