Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to get the tables names that updated after a certain date

By
Tarek Mohamed Ibrahim
on 4/30/15, 8:05 AM 320 views

Hi,


I needed to get all the tables names from the database that have records added or updated after a specific date, I wrote this sql statement but it didn't work :

select * from ir_model where (SELECT count(*) FROM replace(model,'.','_') WHERE create_date>'2015-04-01')>0

Could you pls help me find why this didn't work

0

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 4/30/15, 10:10 AM

You must divide your query into two separate.  SQL doesn't support queries where the tables are not predetermined. The query planner would have a terrible time since it would not be able to estimate costs prior to execution.

The correct syntax should look something like this:

select * from ir_model where (SELECT count(*) FROM replace(model,'.','_') as xx WHERE xx.create_date>'2015-04-01')>0

because field create_date exist in ir_model, too.

Of course, and so it will not work.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/30/15, 8:05 AM
Seen: 320 times
Last updated: 4/30/15, 1:19 PM