Please help me with this Query
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Please help me with this Query Expand / Collapse
Author
Message
Posted 7/26/2008 12:49:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/1/2008 8:33:51 AM
Posts: 2, Visits: 11
could anyone help me
whats wrong with this query in teradata

why query is not working though sub query seperately is working perfectly


SELECT * FROM (SELECT 'prod_rplic_test.'|| tablename FROM prod_rplic_test.ETL_VALIDATION_M7_Table_List WHERE counter=1)


Thanks
Post #12254
Posted 7/26/2008 10:54:02 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: Yesterday @ 2:48:50 PM
Posts: 24, Visits: 80
Umm... try this!

SELECT 'prod_rplic_test.'|| tablename FROM prod_rplic_test.ETL_VALIDATION_M7_Table_List WHERE counter=1;

The additional subquery is not required as a SELECT * will simply return everything from your subquery anyway!

Alternativley if you need to add restrictions:

SELECT
*
FROM (
SELECT
'prod_rplic_test.'|| tablename
FROM prod_rplic_test.ETL_VALIDATION_M7_Table_List
WHERE counter=1
) a (colA)
--ADD ADDITIONAL WHERE CONDITIONS/JOINS HERE
;
Post #12257
Posted 7/27/2008 7:20:57 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/27/2008 6:28:51 AM
Posts: 2, Visits: 1
I think.......
bcoz u didn't specify alias to the subquery.
Post #12262
Posted 7/28/2008 12:02:00 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/1/2008 8:33:51 AM
Posts: 2, Visits: 11
[quote]could anyone help me

whats wrong with this query in teradata


why query is not working though sub query seperately is working perfectly

SELECT count(*) FROM
(SELECT 'prod_rplic_test.'|| tablename FROM prod_rplic_test.ETL_VALIDATION_M7_Table_List WHERE counter=1)


My idea behind this is, I have tabulated all database tables in table prod_rplic_test.ETL_VALIDATION_M7_Table_List

now I want to have record count on each table
so first with where counter=1, i am pointing to first table
and next using some loop i can point out next tables

So, if my query above works, that will be really wonderful

Any great gurus Help plzzz


Thanks
Rams








Post #12312
Posted 7/29/2008 9:53:15 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 11/23/2008 11:25:35 PM
Posts: 76, Visits: 148
can you give the error code?

-SN

Post #12338
Posted 7/29/2008 10:43:35 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/5/2008 10:50:05 AM
Posts: 7, Visits: 25
3707 syntax error some')' is missing
but i tried all possible options, still not working

Post #12339
Posted 7/30/2008 5:01:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/25/2008 7:28:58 AM
Posts: 2, Visits: 9
Hi ,

Try this.

SELECT temp.tabname FROM
(SELECT 'prod_rplic_test.'|| tablename as tabname FROM prod_rplic_test.ETL_VALIDATION_M7_Table_List WHERE counter=1) as temp

Regards,
Arun
Post #12357
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 10:35pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.078. 8 queries. Compression Disabled.