You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
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:
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 :
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

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
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
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

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
Offline
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]
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
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.

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
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?
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
Offline
Pages: 1