• Index
  •  » Talend Open Studio for Data Integration » Installation
  •  » Oracle Sequence

#1 2006-10-19 19:58:26

nferay
Member
Company: Habitat 76 Rouen France
Registered: 2006-09-25
Posts: 62
Website

Oracle Sequence

Hi, I'll do it in French to have a chance to get myself understood :-))

I'd like to use an Oracle sequence. Therefore, I require at Oracle insert time that a syntax is produced such as:

Code:

insert into <mytable> SEQ_CTRLSCHED.nextval, 'val2, 'val3' .....

SEQ_CTRLSCHED is my sequence.

My issue is that if I use a tmap (this is the way I tried it first), talend tDBOutput generates the following syntax :

Code:

insert into <mytable> 'SEQ_CTRLSCHED.nextval', 'val2, 'val3' .....

So, my question is how could I inject some sql into the insert without it being interpreted as string (hence enclosed in between '')

This would allow me to fully use all DB engine's functionalities  in particular the data type management mechanisms
(sysdate, to_date, to_char, nvl and so on...)

Last edited by nferay (2006-10-19 19:59:38)

Offline

#2 2006-10-20 09:01:55

plegall
Member
Registered: 2006-09-19
Posts: 1586
Website

Re: Oracle Sequence

With the 1.0.0 release, the only solution I can see, is to replace the tDbOutput with a tDBSQLRow which allows you to write manually a query to execute at each iteration.

Offline

#3 2007-01-26 15:01:10

Lourenço
Member
Registered: 2007-01-18
Posts: 13

Re: Oracle Sequence

Thank you nferay for redirecting me to this post.
In my job I also have a tMap and used the tDBSQLRow and the query is :

"Insert into test (num, dbcode, supplierfullname) values ($tDBSQLRow_1[0], $tDBSQLRow_1[1], $tDBSQLRow_1[2])"


The expressions in the output of the tMap are :

"seqTest.nextval"  for colum num
"'$row1[DBcode]'" for column dbcode
"'$row1[Supplierfullname]'" for column supplierfullname

However, I don't uderstand why I need to enclose the expressions between single quotes (ok they are varchar fields). But when you do an insert with tDBOutput component the you don't have to put the single quotes!

My next question is what if my data in supplierfullname contains a single quote , for example : QUAI D'ORSAY
How di I transform QUAI D'ORSAY to QUAI D''ORSAY

Offline

#4 2007-04-10 01:47:36

noonchild
New member
Registered: 2007-03-21
Posts: 5

Re: Oracle Sequence

Lourenço wrote:

Thank you nferay for redirecting me to this post.
In my job I also have a tMap and used the tDBSQLRow and the query is :

"Insert into test (num, dbcode, supplierfullname) values ($tDBSQLRow_1[0], $tDBSQLRow_1[1], $tDBSQLRow_1[2])"


The expressions in the output of the tMap are :

"seqTest.nextval"  for colum num
"'$row1[DBcode]'" for column dbcode
"'$row1[Supplierfullname]'" for column supplierfullname

However, I don't uderstand why I need to enclose the expressions between single quotes (ok they are varchar fields). But when you do an insert with tDBOutput component the you don't have to put the single quotes!

My next question is what if my data in supplierfullname contains a single quote , for example : QUAI D'ORSAY
How di I transform QUAI D'ORSAY to QUAI D''ORSAY

CAN YOU SHOW ME A SCREENSHOT OF THE TMAP COMPONENT HERE?

I am having a similar problem and I don't understand the solution.

thanks!

Offline

#5 2007-08-17 00:03:34

jjoseph
New member
Registered: 2007-08-16
Posts: 5

Re: Oracle Sequence

nferay wrote:

Bonjour je vais faire en français pour avoir une chance de me faire comprendre :-))

Je souhaite utiliser une sequence oracle. Il faut donc au niveau de l'insert oracle générer une syntaxe du type

insert into <mytable> SEQ_CTRLSCHED.nextval, 'val2, 'val3' .....

SEQ_CTRLSCHED est ma sequence.

Le problème, si je passe par un tmap (c'est comme cela que j'ai essayé) c'est que talend génère au niveau du TDBoutput

insert into <mytable> 'SEQ_CTRLSCHED.nextval', 'val2, 'val3' .....

Le problème est donc comment injecter du sql dans le insert sans que cela soit interpreté comme une string (donc entouré de '')

cela permettrait facilement d'utiliser toutes les fonctionalités du moteur de base de données et notamment les gestions des types de données
sysdate, to_date, to_char, nvl etc ...

Can somebody pleae translate this ??

Offline

#6 2007-08-17 09:37:49

esabot
Talend team
Registered: 2006-09-19
Posts: 327

Re: Oracle Sequence

nferay wrote:

Hi, I'll do it in French to have a chance to get myself understood :-))

I'd like to use an Oracle sequence. Therefore, I require at Oracle insert time that a syntax is produced such as:

Code:

insert into <mytable> SEQ_CTRLSCHED.nextval, 'val2, 'val3' .....

SEQ_CTRLSCHED is my sequence.

My issue is that if I use a tmap (this is the way I tried it first), talend tDBOutput generates the following syntax :

Code:

insert into <mytable> 'SEQ_CTRLSCHED.nextval', 'val2, 'val3' .....

So, my question is how could I inject some sql into the insert without it being interpreted as string (hence surrounded by '')

This would allow me to fully use all DB engine's functionalities  in particular the data type management mechanisms
(sysdate, to_date, to_char, nvl and so on...)

There you go...

Elisa


Talend - Integration at any scale!

Offline

#7 2008-04-15 22:49:40

andres
Guest

Re: Oracle Sequence

Es posible hacer esto utizando la opcion "Advanced Settings", Aditional Columns.

PRobado con Oracle 10g y Talend 2.4.0

Tal como se muestra en las imagenes
[img]http://img259.imageshack.us/my.php?image=sinttulo1sp1.png[/img]
[img]http://img169.imageshack.us/my.php?image=sinttulo3db3.png[/img]
[img]http://img294.imageshack.us/img294/1404/sinttulo4jo4.png[/img]

#8 2008-04-15 22:51:10

andres
Guest

Re: Oracle Sequence

andres wrote:

Es posible hacer esto utizando la opcion "Advanced Settings", Aditional Columns.

PRobado con Oracle 10g y Talend 2.4.0

Tal como se muestra en las imagenes
http://img259.imageshack.us/img259/5830 … lo1sp1.png
http://img169.imageshack.us/img169/5416 … lo3db3.png
http://img294.imageshack.us/img294/1404 … lo4jo4.png

#9 2008-12-21 17:46:48

Joab Sun
Guest

Re: Oracle Sequence

This is my solution:

1)Add a additional column in the advance setting of the tOracleOutput component;
2)input the column name of your oracle db in "Name";
3)input a sql(e.g. seq.nextval) in "SQL expression";
4)select "Replace" option in "Position";
5)select destination column of the schema of the tOracleOutput component in "Reference column"

Note: keep blank in destination column metioned in step 5 when set mapping in tMap component.

#10 2010-04-30 13:30:46

Gracia_Efl
Member
Registered: 2010-04-05
Posts: 23

Re: Oracle Sequence

Joab Sun wrote:

This is my solution:

1)Add a additional column in the advance setting of the tOracleOutput component;
2)input the column name of your oracle db in "Name";
3)input a sql(e.g. seq.nextval) in "SQL expression";
4)select "Replace" option in "Position";
5)select destination column of the schema of the tOracleOutput component in "Reference column"

Note: keep blank in destination column metioned in step 5 when set mapping in tMap component.

Hello all,

I've follow this 5 steps, but it doesn't work. Are there any especifications about the scenary where you can use the additional columns?.


Thanks in advance,

Gracia.

Offline

#11 2013-02-26 06:36:06

Bibinjohn1
Guest

Re: Oracle Sequence

How can i use Oracle sequence generator in my Talend Job when my out is a file?
i dont want to use Nemeric.sequence() as it reset the values to minvalue for each run.
could you please help me?

#12 2013-02-26 07:06:31

shong
Talend team
Registered: 2007-08-29
Posts: 10310
Website

Re: Oracle Sequence

Bibinjohn1 wrote:

How can i use Oracle sequence generator in my Talend Job when my out is a file?
i dont want to use Nemeric.sequence() as it reset the values to minvalue for each run.
could you please help me?

You can't use the Oracle sequence if you don't use the Oracle component in a job. For your request, you can store the last value in a file or db at the end of job, and read the last value from the file or db at the beginning of job and put it to a global variable, the last value will be the start value of Nemeric.sequence().

Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Installation
  •  » Oracle Sequence

Board footer

Powered by FluxBB