|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 10/31/2007 6:43:43 PM
Posts: 1,
Visits: 3
|
|
Hi All,
I am trying to create a XML output by running a Teradata SQL . For this I need to have multiple Union sets in the query so that the order is maintained.
I need to have a lot of commented XML code in quotes just used as dummy select in my query. But down the blocks where the data fetch is required I am facing an issue.
I am trying to convert a numeric value fetched from the Database using the Cast function.
Eg:
Select XMLText from(
Select 1 XML Order , XMLText from (select cast(' ' as Varchar(3000)) XMLText ;) a
Union ALL
Select 2 XMLORder, cast (sum(units) as Varchar(30) XMLText
It throws an error 3617: FORMAT 'YYYY-MM-DD' does not match the datatype.
Please Help.
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 6/25/2008 7:26:06 AM
Posts: 474,
Visits: 202
|
|
I don't know about your case, but for any Set operations the first select determines the datatype and format of that column.
You should check if there's a Date column in your first select and cast it to Varchar.
Dieter
|
|
|
|