SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 help in sql
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

anil2007
Starting Member

5 Posts

Posted - 01/09/2008 :  03:44:37  Show Profile  Reply with Quote
Hi all,

i am working on data warehousing and creating derived tables with sql.... I am geting error like this Each Calculated column must have an explicit name

Can you please help me on this


SELECT
OMEGA.V_ADH_CETROOT_S.ABS_MONTH,
OMEGA.V_ADH_CETROOT_S.EMPLOYEE_ID,
OMEGA.V_ADH_CETROOT_S.OWNER_CHAIR_ID,
OMEGA.V_ADH_CETROOT_S.CHAIR_NAME,
OMEGA.V_ADH_CETROOT_S.COUNTRY_MCODE,
OMEGA.V_ADH_CETROOT_S.SOURCE_TRANSACTION_CID,
OMEGA.V_ADH_CETROOT_S.ORDER_REVISION_NUMBER,
substr(OMEGA.V_ADH_CETROOT_S.REVENUE_DATE,1,10) Revenuedate,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_POSTAL_MCODE,
OMEGA.V_ADH_CETROOT_S.END_USER_CUSTOMER_NAME,
OMEGA.V_ADH_CETROOT_S.END_USER_CUSTOMER_CID,
OMEGA.V_ADH_CETROOT_S.PRODUCT_CID_07,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_CID_11,
OMEGA.V_ADH_CETROOT_S.PARTNER_NAME,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_CID_07,
OMEGA.V_ADH_CETROOT_S.ORDER_DATE,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_PURCHASE_ORDER_CID,
round(OMEGA.V_ADH_CETROOT_S.NET_AMOUNT,2),
SUM(OMEGA.V_ADH_CETROOT_S.LOCAL_NOR) AS DrawSum,
OMEGA.V_ADH_CETROOT_S.LOCAL_ORDER_TOTAL_AMT,
getlevel1chair(@variable('RootChair')) Country_name
FROM
OMEGA.V_ADH_CETROOT_S
WHERE
( OMEGA.V_ADH_CETROOT_S.BOUID=' ' )
AND OMEGA.V_ADH_CETROOT_S.ABS_MONTH BETWEEN @prompt('FromMonth',D',,,)
AND @prompt('ToMonth',D',,,)
AND OMEGA.V_ADH_CETROOT_S.ROOT_CHAIR = @ Prompt ('RootChair')
AND OMEGA.V_ADH_CETROOT_S.ORDER_REVISION_NUMBER = 'N'
AND sigma_boss_canned_security(@Prompt('secret','A',,mono,)) = 1
GROUP BY
OMEGA.V_ADH_CETROOT_S.ABS_MONTH,
OMEGA.V_ADH_CETROOT_S.EMPLOYEE_ID,
OMEGA.V_ADH_CETROOT_S.OWNER_CHAIR_ID,
OMEGA.V_ADH_CETROOT_S.CHAIR_NAME,
OMEGA.V_ADH_CETROOT_S.COUNTRY_MCODE,
OMEGA.V_ADH_CETROOT_S.SOURCE_TRANSACTION_CID,
OMEGA.V_ADH_CETROOT_S.ORDER_REVISION_NUMBER,
OMEGA.V_ADH_CETROOT_S.REVENUE_DATE,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_POSTAL_MCODE,
OMEGA.V_ADH_CETROOT_S.END_USER_CUSTOMER_NAME,
OMEGA.V_ADH_CETROOT_S.END_USER_CUSTOMER_CID,
OMEGA.V_ADH_CETROOT_S.PRODUCT_CID_07,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_CID_11,
OMEGA.V_ADH_CETROOT_S.PARTNER_NAME,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_CID_07,
OMEGA.V_ADH_CETROOT_S.ORDER_DATE,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_PURCHASE_ORDER_CID,
round(OMEGA.V_ADH_CETROOT_S.NET_AMOUNT,2),
OMEGA.V_ADH_CETROOT_S.LOCAL_ORDER_TOTAL_AMT,
getlevel1chair(@variable('RootChair'))

Thanks
anil

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 01/09/2008 :  03:52:21  Show Profile  Reply with Quote
quote:
Originally posted by anil2007

Hi all,

i am working on data warehousing and creating derived tables with sql.... I am geting error like this Each Calculated column must have an explicit name

Can you please help me on this


SELECT
OMEGA.V_ADH_CETROOT_S.ABS_MONTH,
OMEGA.V_ADH_CETROOT_S.EMPLOYEE_ID,
OMEGA.V_ADH_CETROOT_S.OWNER_CHAIR_ID,
OMEGA.V_ADH_CETROOT_S.CHAIR_NAME,
OMEGA.V_ADH_CETROOT_S.COUNTRY_MCODE,
OMEGA.V_ADH_CETROOT_S.SOURCE_TRANSACTION_CID,
OMEGA.V_ADH_CETROOT_S.ORDER_REVISION_NUMBER,
substr(OMEGA.V_ADH_CETROOT_S.REVENUE_DATE,1,10) Revenuedate,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_POSTAL_MCODE,
OMEGA.V_ADH_CETROOT_S.END_USER_CUSTOMER_NAME,
OMEGA.V_ADH_CETROOT_S.END_USER_CUSTOMER_CID,
OMEGA.V_ADH_CETROOT_S.PRODUCT_CID_07,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_CID_11,
OMEGA.V_ADH_CETROOT_S.PARTNER_NAME,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_CID_07,
OMEGA.V_ADH_CETROOT_S.ORDER_DATE,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_PURCHASE_ORDER_CID,
round(OMEGA.V_ADH_CETROOT_S.NET_AMOUNT,2),
SUM(OMEGA.V_ADH_CETROOT_S.LOCAL_NOR) AS DrawSum,
OMEGA.V_ADH_CETROOT_S.LOCAL_ORDER_TOTAL_AMT,
getlevel1chair(@variable('RootChair')) Country_name
FROM
OMEGA.V_ADH_CETROOT_S
WHERE
( OMEGA.V_ADH_CETROOT_S.BOUID=' ' )
AND OMEGA.V_ADH_CETROOT_S.ABS_MONTH BETWEEN @prompt('FromMonth',D',,,)
AND @prompt('ToMonth',D',,,)
AND OMEGA.V_ADH_CETROOT_S.ROOT_CHAIR = @ Prompt ('RootChair')
AND OMEGA.V_ADH_CETROOT_S.ORDER_REVISION_NUMBER = 'N'
AND sigma_boss_canned_security(@Prompt('secret','A',,mono,)) = 1
GROUP BY
OMEGA.V_ADH_CETROOT_S.ABS_MONTH,
OMEGA.V_ADH_CETROOT_S.EMPLOYEE_ID,
OMEGA.V_ADH_CETROOT_S.OWNER_CHAIR_ID,
OMEGA.V_ADH_CETROOT_S.CHAIR_NAME,
OMEGA.V_ADH_CETROOT_S.COUNTRY_MCODE,
OMEGA.V_ADH_CETROOT_S.SOURCE_TRANSACTION_CID,
OMEGA.V_ADH_CETROOT_S.ORDER_REVISION_NUMBER,
OMEGA.V_ADH_CETROOT_S.REVENUE_DATE,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_POSTAL_MCODE,
OMEGA.V_ADH_CETROOT_S.END_USER_CUSTOMER_NAME,
OMEGA.V_ADH_CETROOT_S.END_USER_CUSTOMER_CID,
OMEGA.V_ADH_CETROOT_S.PRODUCT_CID_07,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_CID_11,
OMEGA.V_ADH_CETROOT_S.PARTNER_NAME,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_CID_07,
OMEGA.V_ADH_CETROOT_S.ORDER_DATE,
OMEGA.V_ADH_CETROOT_S.CUSTOMER_PURCHASE_ORDER_CID,
round(OMEGA.V_ADH_CETROOT_S.NET_AMOUNT,2),
OMEGA.V_ADH_CETROOT_S.LOCAL_ORDER_TOTAL_AMT,
getlevel1chair(@variable('RootChair'))

Thanks
anil



Try giving alias to the column in blue as well. Also its a good practise to give keyword AS before alias names.
Go to Top of Page

anil2007
Starting Member

5 Posts

Posted - 01/09/2008 :  03:58:54  Show Profile  Reply with Quote
Hi visakh16

i have tryed by giveing alias i am geting same error

Thanks
anil
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 01/09/2008 :  04:06:53  Show Profile  Reply with Quote
Did you try executing functions seperately? Just to ensure, errors are not inside function like,getlevel1chair(@variable('RootChair'))
Go to Top of Page

anil2007
Starting Member

5 Posts

Posted - 01/09/2008 :  04:13:53  Show Profile  Reply with Quote
Hi visakh16
I have removed this function also but still i am geting same error


getlevel1chair(@variable('RootChair')) Country_name

Thanks

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 01/09/2008 :  04:21:03  Show Profile  Reply with Quote
Cant find anything else fishy here. But not sure what @prompt,@variable etc do here??
Go to Top of Page

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2079 Posts

Posted - 01/09/2008 :  04:27:27  Show Profile  Visit jackv's Homepage  Reply with Quote
With the suggestion Visakh16 made - did you try " AS 'MyAlias' " -- or -- "AS MyAlias" , ?

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22772 Posts

Posted - 01/09/2008 :  04:42:29  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
quote:
Originally posted by anil2007

Hi visakh16

i have tryed by giveing alias i am geting same error

Thanks
anil


Post the query you used

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000