number sequence

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

number sequence

stamilo
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!
Reply | Threaded
Open this post in threaded view
|

Re: number sequence

Jacopo Cappellato-3
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!

Reply | Threaded
Open this post in threaded view
|

Re: number sequence

stamilo
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 <
[hidden email]> 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!
>>
>
>