You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by stamilo <st...@gmail.com> on 2008/07/01 10:11:12 UTC

number sequence

hi
  i have a table , id field is a number sequence ,

   <field name="fKey" type="numeric" />

when i insert data use service

        <sequenced-id-to-env sequence-name="tablea" env-name="fKey"/> <!--
get the next sequenced ID -->

there is error report:

  Type check failed for field [Createclggb.fKey]; expected type is [Long];
actual type is [java.lang.String]

how i can use number sequence?

thx!

Re: number sequence

Posted by stamilo <st...@gmail.com>.
thx.

because the data from a old system,   change the key from int to string is a
big job  .

now i use get-long-only

:)


On Tue, Jul 1, 2008 at 4:26 PM, Jacopo Cappellato <
jacopo.cappellato@gmail.com> wrote:

> sequenced-id-to-env returns a string, not a number, that is why you are
> getting the error.
> Is there a special reason for not using a string for the pk?
>
> Jacopo
>
>
> On Jul 1, 2008, at 10:11 AM, stamilo wrote:
>
>  hi
>>  i have a table , id field is a number sequence ,
>>
>>  <field name="fKey" type="numeric" />
>>
>> when i insert data use service
>>
>>       <sequenced-id-to-env sequence-name="tablea" env-name="fKey"/> <!--
>> get the next sequenced ID -->
>>
>> there is error report:
>>
>>  Type check failed for field [Createclggb.fKey]; expected type is [Long];
>> actual type is [java.lang.String]
>>
>> how i can use number sequence?
>>
>> thx!
>>
>
>

Re: number sequence

Posted by Jacopo Cappellato <ja...@gmail.com>.
sequenced-id-to-env returns a string, not a number, that is why you  
are getting the error.
Is there a special reason for not using a string for the pk?

Jacopo

On Jul 1, 2008, at 10:11 AM, stamilo wrote:

> hi
>  i have a table , id field is a number sequence ,
>
>   <field name="fKey" type="numeric" />
>
> when i insert data use service
>
>        <sequenced-id-to-env sequence-name="tablea" env-name="fKey"/>  
> <!--
> get the next sequenced ID -->
>
> there is error report:
>
>  Type check failed for field [Createclggb.fKey]; expected type is  
> [Long];
> actual type is [java.lang.String]
>
> how i can use number sequence?
>
> thx!