Skip to main content
Solved

use cast (fieldname as nvarchar(max )) in sqlexecutor

  • August 8, 2019
  • 2 replies
  • 151 views

Forum|alt.badge.img+1

As I am using a union query I need to convert text fields to nvarchr (Max)

The statement works well in Studio manager but in FME the attributes are <missing> despite using AttributeExposer.

Without union clause the text fields display as expected using AttributeExposer so i feel certain it is the cast as Nvarchar(max) that is causing the problem.

 

How do I resolve this ?

Best answer by david_r

Unless you've already done so, you will have to specify the name the resulting column, e.g.

select cast(fieldname as nvarchar2(max)) as fieldname
from...

Otherwise the output column will actually be called "CAST(FIELDNAME AS NVARCHAR2(MAX))"

This is standard Oracle behavior, by the way.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • 8394 replies
  • Best Answer
  • August 8, 2019

Unless you've already done so, you will have to specify the name the resulting column, e.g.

select cast(fieldname as nvarchar2(max)) as fieldname
from...

Otherwise the output column will actually be called "CAST(FIELDNAME AS NVARCHAR2(MAX))"

This is standard Oracle behavior, by the way.


Forum|alt.badge.img+1
  • Author
  • 31 replies
  • August 13, 2019

Sorry for the delayed response , but yes thank you that was the answer it needed to know the fieldname