|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 11/17/2009 6:21:50 PM
Posts: 1,
Visits: 21
|
|
The following query is getting an syntax error as 'expected something like a name or unicode delimited identifier or UDFCALLNAME between ')' and where keyword.
SELECT 111 "id",item,atr1,rprt_format,'Submitted' "status"FROM (
SELECT pkglineitem,atr1,rprt_format FROM TAble1 as a , (
SELECT 'Detail' Rprt_format from Sys_Calendar.Calendar where 1=1 UNION ALL
SELECT 'Monthly' rprt_format from Sys_Calendar.Calendar where 1=1 UNION ALL
SELECT 'Quarterly' rprt_format from Sys_Calendar.Calendar where 1=1 UNION ALL
SELECT 'Summary' rprt_format from Sys_Calendar.Calendar where 1=1 )
WHERE a.userid = 'MikMetz' AND a.moduleId = 'RPT' AND a.pkgname = 'User ID reports')
The result set should look like this:
id item atr1 rprt_format status
111 R01 NONE Detail Submitted
111 R01 NONE Monthly Submitted
111 R01 NONE Quarterly Submitted
111 R01 NONE Summary Submitted
111 R02 NONE Detail Submitted
111 R02 NONE Monthly Submitted
111 R02 NONE Quarterly Submitted
111 R02 NONE Summary Submitted
111 R03 NONE Detail Submitted
111 R03 NONE Monthly Submitted
111 R03 NONE Quarterly Submitted
111 R03 NONE Summary Submitted
I am converting this from Oracle to Teradata. Please help me if the query is wrong.
Thanks and Regards,
TDHelp
Thanks and Regards
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: Yesterday @ 12:42:08 AM
Posts: 74,
Visits: 32
|
|
Hi,
Please try this.
SELECT 111 "id",item,atr1,rprt_format,'Submitted' "status"FROM (
SELECT pkglineitem,atr1,rprt_format FROM TAble1 as a , (
SELECT 'Detail' Rprt_format from Sys_Calendar.Calendar where 1=1 UNION ALL
SELECT 'Monthly' rprt_format from Sys_Calendar.Calendar where 1=1 UNION ALL
SELECT 'Quarterly' rprt_format from Sys_Calendar.Calendar where 1=1 UNION ALL
SELECT 'Summary' rprt_format from Sys_Calendar.Calendar where 1=1 ) AS B
ON 1=1
WHERE a.userid = 'MikMetz' AND a.moduleId = 'RPT' AND a.pkgname = 'User ID reports')
Strive to success. Arun.
|
|
|
|