You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@hop.apache.org by MH...@LStelcom.com on 2024/12/17 12:34:09 UTC

How to create data with a seq_next val

Hello Apache Hop Users,

I’m trying to Create data via a ‘Table Output’ transform.

One of the field shall contain a sequence value. The next db sequence value can be generated like this
nextval('db."myfield_seq"')

Do you know how to pass this to the ’table output’ transform?

(I have  also tried to read first all new sequences but could not combine a ‘table input’ with an ‘excel input’)

Thank you in advance for your help



Re: How to create data with a seq_next val

Posted by Bart Maertens <ba...@apache.org>.
glad you got that sorted out!

On Tue, Dec 17, 2024 at 2:07 PM <MH...@lstelcom.com> wrote:

> Thank you Bart,
>
>
>
> I’ve just found that I could actually also use the ‘Add Sequence’
> transform
>
>
>
> Silly Me !
>
>
>
> Thanks for the help
>
>
>
>
>
> *From:* Bart Maertens <ba...@apache.org>
> *Sent:* Tuesday, 17 December 2024 13:46
> *To:* users@hop.apache.org
> *Subject:* Re: How to create data with a seq_next val
>
>
>
> Hi MHeyd,
>
>
>
> What database engine do you use?
>
> For a supported database, you could try the "Use DB to generate the
> sequence" option in the Add sequence transform [1].
>
> Another option could be to use an option similar to an auto increment,
> where your table's primary key uses that sequence to create the next value,
> but a lot depends on your use case and requirements there.
>
>
>
> [1]
> https://hop.apache.org//manual/latest/pipeline/transforms/addsequence.html
> <https://hop.apache.org/manual/latest/pipeline/transforms/addsequence.html>
>
>
>
> Regards,
>
> Bart
>
>
>
>
>
> On Tue, Dec 17, 2024 at 1:39 PM <MH...@lstelcom.com> wrote:
>
> Hello Apache Hop Users,
>
>
>
> I’m trying to Create data via a ‘Table Output’ transform.
>
>
>
> One of the field shall contain a sequence value. The next db sequence
> value can be generated like this
>
> nextval('db."myfield_seq"')
>
>
>
> Do you know how to pass this to the ’table output’ transform?
>
>
>
> (I have  also tried to read first all new sequences but could not combine
> a ‘table input’ with an ‘excel input’)
>
>
>
> Thank you in advance for your help
>
>
>
>
>
>

Re: RE: How to create data with a seq_next val

Posted by po...@gmx.com.
What's the sense to manually increment row ID?



You can use SQL Script as well.



INSERT INTO my_table (id, name) VALUES (nextval('db."myfield_seq"'), ?);





**Sent:**  Tuesday, December 17, 2024 at 2:07 PM  
**From:**  MHeyd@LStelcom.com  
**To:**  users@hop.apache.org  
**Subject:**  RE: How to create data with a seq_next val

Thank you Bart,



I've just found that I could actually also use the 'Add Sequence' transform



Silly Me !



Thanks for the help







**From:** Bart Maertens <ba...@apache.org>  
**Sent:** Tuesday, 17 December 2024 13:46  
**To:** users@hop.apache.org  
**Subject:** Re: How to create data with a seq_next val



Hi MHeyd,



What database engine do you use?

For a supported database, you could try the "Use DB to generate the sequence"
option in the Add sequence transform [1].

Another option could be to use an option similar to an auto increment, where
your table's primary key uses that sequence to create the next value, but a
lot depends on your use case and requirements there.



[1]
[https://hop.apache.org//manual/latest/pipeline/transforms/addsequence.html](https://hop.apache.org/manual/latest/pipeline/transforms/addsequence.html)



Regards,

Bart





On Tue, Dec 17, 2024 at 1:39 PM
<[MHeyd@lstelcom.com](mailto:MHeyd@lstelcom.com)> wrote:

> Hello Apache Hop Users,
>
>  
>
> I'm trying to Create data via a 'Table Output' transform.
>
>  
>
> One of the field shall contain a sequence value. The next db sequence value
> can be generated like this
>
> nextval('db."myfield_seq"')
>
>  
>
> Do you know how to pass this to the 'table output' transform?
>
>  
>
> (I have  also tried to read first all new sequences but could not combine a
> 'table input' with an 'excel input')
>
>  
>
> Thank you in advance for your help
>
>  
>
>  






RE: How to create data with a seq_next val

Posted by MH...@LStelcom.com.
Thank you Bart,

I’ve just found that I could actually also use the ‘Add Sequence’ transform

Silly Me !

Thanks for the help


From: Bart Maertens <ba...@apache.org>
Sent: Tuesday, 17 December 2024 13:46
To: users@hop.apache.org
Subject: Re: How to create data with a seq_next val

Hi MHeyd,

What database engine do you use?
For a supported database, you could try the "Use DB to generate the sequence" option in the Add sequence transform [1].
Another option could be to use an option similar to an auto increment, where your table's primary key uses that sequence to create the next value, but a lot depends on your use case and requirements there.

[1] https://hop.apache.org//manual/latest/pipeline/transforms/addsequence.html<https://hop.apache.org/manual/latest/pipeline/transforms/addsequence.html>

Regards,
Bart


On Tue, Dec 17, 2024 at 1:39 PM <MH...@lstelcom.com>> wrote:
Hello Apache Hop Users,

I’m trying to Create data via a ‘Table Output’ transform.

One of the field shall contain a sequence value. The next db sequence value can be generated like this
nextval('db."myfield_seq"')

Do you know how to pass this to the ’table output’ transform?

(I have  also tried to read first all new sequences but could not combine a ‘table input’ with an ‘excel input’)

Thank you in advance for your help



Re: How to create data with a seq_next val

Posted by Bart Maertens <ba...@apache.org>.
Hi MHeyd,

What database engine do you use?
For a supported database, you could try the "Use DB to generate the
sequence" option in the Add sequence transform [1].
Another option could be to use an option similar to an auto increment,
where your table's primary key uses that sequence to create the next value,
but a lot depends on your use case and requirements there.

[1]
https://hop.apache.org//manual/latest/pipeline/transforms/addsequence.html

Regards,
Bart


On Tue, Dec 17, 2024 at 1:39 PM <MH...@lstelcom.com> wrote:

> Hello Apache Hop Users,
>
>
>
> I’m trying to Create data via a ‘Table Output’ transform.
>
>
>
> One of the field shall contain a sequence value. The next db sequence
> value can be generated like this
>
> nextval('db."myfield_seq"')
>
>
>
> Do you know how to pass this to the ’table output’ transform?
>
>
>
> (I have  also tried to read first all new sequences but could not combine
> a ‘table input’ with an ‘excel input’)
>
>
>
> Thank you in advance for your help
>
>
>
>
>