Ralf Hackmann
2013-02-13 09:07:20 UTC
Hallo,
I have 2 jobs to update Tables where the user give the data in an input text or csv list.
1) Input List with one row, one field must be change, where fields are in this row.
2) Input List has more than 2 rows, one field is primery index, I must update the other for every record of the list.
To 1)
This job I solved for my own with an temp table
with a.txt
1234
4578
CREATE temp table artikel (art CHAR(21)) with no log;
LOAD FROM "a.txt" INSERT INTO artikel (art);
UPDATE fyar2sta
SET bestverf = 64
WHERE artikel IN ( SELECT * FROM artikel );
to 2)
Here I don´t Know how to solve it
b.txt
1234;123;234;1
5678;456;789;3
The first row is primery key an I must update rows 2 to 4
I think I must import b.txt in a temp table with 4 rows and then update every record with a loop in a procedure.
But I don´t know How to code this.
Can anybody help me?
Greetings
Ralf
I have 2 jobs to update Tables where the user give the data in an input text or csv list.
1) Input List with one row, one field must be change, where fields are in this row.
2) Input List has more than 2 rows, one field is primery index, I must update the other for every record of the list.
To 1)
This job I solved for my own with an temp table
with a.txt
1234
4578
CREATE temp table artikel (art CHAR(21)) with no log;
LOAD FROM "a.txt" INSERT INTO artikel (art);
UPDATE fyar2sta
SET bestverf = 64
WHERE artikel IN ( SELECT * FROM artikel );
to 2)
Here I don´t Know how to solve it
b.txt
1234;123;234;1
5678;456;789;3
The first row is primery key an I must update rows 2 to 4
I think I must import b.txt in a temp table with 4 rows and then update every record with a loop in a procedure.
But I don´t know How to code this.
Can anybody help me?
Greetings
Ralf