I've tried second approach. Sql is generated as expected and query 
executed, but resultset are not typed as expected.
I.e. LocalDateTime types are java.sql.TimeStamp and so on....

Any ideas?

Do you think ExecuteListener approach would run into same issue? If you 
think not i could try it.

Tks



Il giorno giovedì 2 giugno 2016 15:27:23 UTC+2, Lukas Eder ha scritto:
>
> Hi Denis,
>
> Interesting, I just had to look this up in the SQL Server manuals:
> https://msdn.microsoft.com/en-us/library/ms177400.aspx
>
> It appears that SQL Server has reused the common table expression syntax 
> (WITH) for an entirely different use-case. This means, you cannot use 
> jOOQ's with clause in this case, as jOOQ's with expects a Select as 
> argument.
>
> The only options that I can see right now are:
>
> - Use an ExecuteListener to inject the additional SQL string in 
> ExecuteListener.renderEnd()
> - Prepend the additional SQL manually and execute the whole thing as 
> "plain SQL"
>
> For example:
>
> DSL.using(configuration).fetch("with xmlnamespaces (...) {0}", select);
>
> Does that help?
> Best Regards,
> Lukas
>
> 2016-06-02 14:41 GMT+02:00 Denis Miorandi <[email protected] 
> <javascript:>>:
>
>> consider this query. 
>>
>> --WARNING! ERRORS ENCOUNTERED DURING SQL PARSING! 
>> WITH XMLNAMESPACES (DEFAULT 'http://www.xxxx.com/api/yyyy') 
>>
>> SELECT  a
>>      ,b
>>      ,SOME XML 's fields from RR.TT
>>  
>> from TABLE
>>   cross apply xml.nodes(' / MYROOT ') [RR]([TT])'
>>
>>
>> I need just to add this literal string before select, but I don't know how 
>> to achieve this.
>>
>>
>> WITH XMLNAMESPACES (DEFAULT 'http://www.xxxx.com/api/yyyy') 
>>
>>
>> I know just how to add literal with DSL.VAL('') but how about before query?
>>
>>
>>
>> Tks
>>
>>
>> Denis
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to