getting UDFCALLNAME error

Database
N/A

getting UDFCALLNAME error

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
2 REPLIES
Enthusiast

Re: getting UDFCALLNAME error

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')

Re: getting UDFCALLNAME error

    select count(*) mycnt from (select * from rd_hif_stg.testing );