But HQL is not SQL. Are you looking for CreateSQLQuery()?

/Oskar


Den fre 30 nov. 2018 kl 15:29 skrev Gökhan Abatay <[email protected]>:

> Hi I need to pass sequence to hql but it gives me error?
>
> sequenceNextValSql taken from dialect and it's value for oracle =
> MY_SCHEMA.SEQUENCE_NAME.nextval
>
>                 string sequenceNextValSql =
> ISession.GetSelectSequenceNextValString(BaseEntityMap.DefaultSequenceName);
>                 var query = ISession.CreateQuery(
>                 $@"INSERT INTO {typeof(EodJobRunLog)}(Guid, EodDate,
> EodJobDef, ErrorCode, ProcessCount,
>                 StartDateTime, Stat)
>                 SELECT ({sequenceNextValSql}) as Guid E.EodDate,
> E.EodJobDef, E.ErrorCode, E.ProcessCount,
>                 E.StartDateTime, E.Stat from {typeof(EodJobRunLog)} AS E");
>
>
> Invalid path: 'MY_SCHEMA.SEQUENCE_NAME.nextval' [INSERT INTO
>
>
> I know if i use sequence generator in my mapping everything works as
> expected, but i need to use with this way.
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/nhusers.
> For more options, visit https://groups.google.com/d/optout.
>

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

Reply via email to