QC does not check for what's inside the templates. And you will have to write your own code using QC OTA. Also you can't just use a SQL query with OTA APIs (because it would need recursion), you will need code also as a template can itself have templates and so on...
If you have a test case in QC say test1 and internally it has 3 steps
1. Open A application
2. Call Login template/test (A template call)
3. Close A application
Then when you export the test1 as a excel from QC you will get the second step a Call <Login> (something like that) but not the steps inside the Login template/test. So to achive that you would need to write code. QC does not go any level further when exporting the test as excel, word etc...
Login to QC project, and then go to Help (menu) -> Documentation Library
Download the below 2 documents from that page
Mercury Quality Center Database Reference
Mercury Quality Center Open Test Architecture API Reference
[ QUOTE ]
Does it take much time?
[/ QUOTE ]
Depends on you , how fast you can grasp the Object model. If you know the objects that you need to work with and also then excel COM apis then it should not take more than 7-8 hrs of development + testing effort.