Hi Lukas,

In the exception stack trace I see "*[cn] set [cn].[already_exists] = ? 
where 1 = 0*" .
I dont know why there is a condition "where 1=0" interpretation here.
Totally confusing.

Thank you.
~Shyam




On Tuesday, February 4, 2014 9:14:15 PM UTC+5:30, Sha wrote:
>
> Hi Lukas,
>   As you suggested I changed my jars to 3.2.3 version.
> Now error " Parameter #8 has not set " has got resolved.
>
> But i landed in a strange situation.
>
> Below is the complete query me executing 
>
> int count = ctx.update(cn).set(cn.field("already_exists"), 1)
>   .where( (cn.field("ID")).in(* ctx.select(cn.field("ID")).from(cn)*
> *  .join(hp)*
> *  .on( hp.PLANE_ID.eq(cn.field("PLANE_ID")) )*
> *  .join(cd)*
> *  .on( ( cn.field("HC1_LEAF_ID").eq(cd.HC1_LEAF_ID) ).and( 
> ((cd.HC3_LEAF_ID).nullif(0)).eq(cn.field("HC3_ITEM_ID"))  ) )*
> * 
>  
> .where((hp.NAME).eq("BASE_MAT~~ALL~~SRC_PLNT").and(cd.PLANE_TYPE.eq("DETAIL"))).fetch()*
>   ) 
> ).execute();
>
> When I executed the inner query i.e. in blue it is being executed 
> successfully.
> But when i put it in upper query i.e.
>
> int count = ctx.update(cn).set(cn.field("already_exists"), 1)
>   .where( (cn.field("ID")).in(   ) ).execute();
>
> *It is giving error "Incorrect syntax near '('."*
> How many times I cross verify I don't find anything missing here.
> It would have been great help if it is displayed a proper log in which 
> line number or character the error occurred.
> Any clue where am I going wrong ?
>
> Below is the entire error stack trace.
>
> Exception in thread "main" org.jooq.exception.DataAccessException: SQL 
> [update (select [cd].[HC1_LEAF_ID], [cd].[HC2_LEAF_ID], [cd].[HC3_LEAF_ID], 
> [cd].[PLANE_ID], ? [already_exists], row_number() over (order by 
> [cd].[HC1_LEAF_ID] asc) [ID] from [dbo].[CATALOG_DETAIL] [cd] where 
> [cd].[IS_PHANTOM] = ?) [cn] set [cn].[already_exists] = ? where 1 = 0]; 
> Incorrect syntax near '('.
> at org.jooq.impl.Utils.translate(Utils.java:1223)
> at 
> org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:495)
> at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:313)
> at 
> org.jooq.impl.AbstractDelegatingQuery.execute(AbstractDelegatingQuery.java:140)
> at 
> org.jooq.samples.SampleTemp_phantom_add_detail_Old.main(SampleTemp_phantom_add_detail_Old.java:386)
> Caused by: java.sql.SQLException: Incorrect syntax near '('.
>
>
> Thank you.
> ~Shyam
>
> On Tuesday, February 4, 2014 2:17:11 AM UTC+5:30, Sha wrote:
>>
>> Sure I will try and update you.
>>
>> Thank you Lukas,
>> ~Shyam
>>
>> On Monday, February 3, 2014 8:10:50 PM UTC+5:30, Lukas Eder wrote:
>>>
>>> Hi Shyam,
>>>
>>> I think you have run into this bug here:
>>> https://github.com/jOOQ/jOOQ/issues/2982
>>>
>>> It has recently been fixed for jOOQ 3.2.3. Could you try upgrading to 
>>> the latest version?
>>>
>>> Cheers
>>> Lukas
>>>
>>>
>>> 2014-02-03 Sha <[email protected]>:
>>>
>>>> Hi Lukas,
>>>>    Here is a piece of code where me trying to update a field value (as 
>>>> shown below) but me is getting error."Parameter #8 has not been set."
>>>> How to check the Parameter number here.
>>>> I think i set all fields but still why am I getting this error ?
>>>> What is the right way to set the Parameters? especially here.
>>>>
>>>> *Code snippet :*
>>>>
>>>> int count = ctx.update(cn).set(cn.field("already_exists"), 1)
>>>>   .where(  cn.field("ID").in(ctx.select(cn.field("ID")).from(cn)
>>>>   .join(hp)
>>>>   .on( hp.PLANE_ID.eq(cn.field("PLANE_ID")) )
>>>>   .join(cd)
>>>>   .on( ( cn.field("HC1_LEAF_ID").eq(cd.HC1_LEAF_ID).and( 
>>>> (cd.HC3_LEAF_ID).nullif(0).eq(cn.field("HC3_ITEM_ID")) ) ))
>>>>   .where( (hp.NAME.eq("BASE")).and(cd.PLANE_TYPE.eq("DETAIL")) 
>>>> ))).execute();
>>>>
>>>> *Error :*
>>>>
>>>> Exception in thread "main" org.jooq.exception.DataAccessException: SQL 
>>>> [update (select [cd].[HC1_LEAF_ID], [cd].[HC2_LEAF_ID], 
>>>> [cd].[HC3_LEAF_ID], 
>>>> [cd].[PLANE_ID], ? [already_exists], row_number() over (order by 
>>>> [cd].[HC1_LEAF_ID] asc) [ID] from [dbo].[CATALOG_DETAIL] [cd] where 
>>>> [cd].[IS_PHANTOM] = ?) [cn] set [cn].[already_exists] = ? where [cn].[ID] 
>>>> in (select [cn].[ID] from (select [cd].[HC1_LEAF_ID], [cd].[HC2_LEAF_ID], 
>>>> [cd].[HC3_LEAF_ID], [cd].[PLANE_ID], ? [already_exists], row_number() over 
>>>> (order by [cd].[HC1_LEAF_ID] asc) [ID] from [dbo].[CATALOG_DETAIL] [cd] 
>>>> where [cd].[IS_PHANTOM] = ?) [cn] join [dbo].[HIERARCHY_PLANE] [hp] on 
>>>> [hp].[PLANE_ID] = [cn].[PLANE_ID] join [dbo].[CATALOG_DETAIL] [cd] on 
>>>> ([cn].[HC1_LEAF_ID] = [cd].[HC1_LEAF_ID] and nullif([cd].[HC3_LEAF_ID], ?) 
>>>> = ?) where ([hp].[NAME] = ? and [cd].[PLANE_TYPE] = ?))]; Parameter #8 
>>>> has not been set.
>>>>  at org.jooq.impl.Utils.translate(Utils.java:1211)
>>>> at 
>>>> org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:495)
>>>>  at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:313)
>>>> at 
>>>> org.jooq.impl.AbstractDelegatingQuery.execute(AbstractDelegatingQuery.java:140)
>>>>  at 
>>>> org.jooq.samples.SampleTemp_phantom_add_detail_Old.main(SampleTemp_phantom_add_detail_Old.java:383)
>>>> Caused by: java.sql.SQLException: Parameter #8 has not been set.
>>>>
>>>>
>>>> Thank you.'
>>>> ~Shyam
>>>>
>>>> -- 
>>>> 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/groups/opt_out.
>>>>
>>>
>>>

-- 
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/groups/opt_out.

Reply via email to