7 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
Tabelle_X where Bedingung1 = '...' and Bedingung2 = '...'
Tabelle_X where Bedingung1 = '...' and Bedingung2 = '...'
Tabelle_X where Bedingung1 = '...'
Tabelle_Y where Bedingung1 = '...' and Bedingung2 = '...'
Tabelle_Y where Bedingung1 = '...'
Tabelle_Z where Bedingung1 = '...' and Bedingung2 = '...'
.
.
.
1
2
3
4
5
6
7
Tabelle_A : Feld1 Feld2 Feld3
.
.
.
Tabelle_X : Feld1 Feld2 Feld3
Tabelle_Y : Feld1 Feld2
Tabelle_Z : Feld1 Feld2 Feld3
1
2
3
4
5
6
select Feld1,Feld2,Feld3 from Tabelle_X where Bedingung1 = '...' and Bedingung2 = '...'
select Feld1,Feld2,Feld3 from Tabelle_X where Bedingung1 = '...' and Bedingung2 = '...'
select Feld1,Feld2,Feld3 from Tabelle_X where Bedingung1 = '...'
select Feld1,Feld2 from Tabelle_Y where Bedingung1 = '...' and Bedingung2 = '...'
select Feld1,Feld2 from Tabelle_Y where Bedingung1 = '...'
select Feld1,Feld2,Feld3 from Tabelle_Z where Bedingung1 = '...' and Bedingung2 = '...'
1
2
3
4
foreach(@all_things_from_array_1){
$statement = "SELECT ".$hash{(split(/\s/,$_))[0]}." ".$_;
print $statement;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my @array1 = (
"Tabelle_X where Bedingung1 = '...' and Bedingung2 = '...'",
"Tabelle_X where Bedingung1 = '...' and Bedingung2 = '...'",
"Tabelle_X where Bedingung1 = '...'",
"Tabelle_Y where Bedingung1 = '...' and Bedingung2 = '...'",
"Tabelle_Y where Bedingung1 = '...'",
"Tabelle_Z where Bedingung1 = '...' and Bedingung2 = '...'",
);
my @array2 = (
"Tabelle_X : Feld1 Feld2 Feld3",
"Tabelle_Y : Feld1 Feld2",
"Tabelle_Z : Feld1 Feld2 Feld3",
);
print Dumper \@array1;
print Dumper \@array2;
my @array3;
my $i1 = 0;
my $i2 = 0;
while ($i1 < scalar @array1 and $i2 < scalar @array2) {
my ($tab1, $where) = split / /, $array1[$i1], 2;
my ($tab2, $fields) = split / : /, $array2[$i2], 2;
#print "i1=$i1, i2=$i2, tab1=$tab2, tab2=$tab2, where=$where, fields=$fields\n";
if ($tab1 eq $tab2) {
push @array3, "select $fields from $tab1 $where";
++$i1;
}
else {
++$i2;
}
}
print Dumper \@array3;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$VAR1 = [
'Tabelle_X where Bedingung1 = \'...\' and Bedingung2 = \'...\'',
'Tabelle_X where Bedingung1 = \'...\' and Bedingung2 = \'...\'',
'Tabelle_X where Bedingung1 = \'...\'',
'Tabelle_Y where Bedingung1 = \'...\' and Bedingung2 = \'...\'',
'Tabelle_Y where Bedingung1 = \'...\'',
'Tabelle_Z where Bedingung1 = \'...\' and Bedingung2 = \'...\''
];
$VAR1 = [
'Tabelle_X : Feld1 Feld2 Feld3',
'Tabelle_Y : Feld1 Feld2',
'Tabelle_Z : Feld1 Feld2 Feld3'
];
$VAR1 = [
'select Feld1 Feld2 Feld3 from Tabelle_X where Bedingung1 = \'...\' and Bedingung2 = \'...\'',
'select Feld1 Feld2 Feld3 from Tabelle_X where Bedingung1 = \'...\' and Bedingung2 = \'...\'',
'select Feld1 Feld2 Feld3 from Tabelle_X where Bedingung1 = \'...\'',
'select Feld1 Feld2 from Tabelle_Y where Bedingung1 = \'...\' and Bedingung2 = \'...\'',
'select Feld1 Feld2 from Tabelle_Y where Bedingung1 = \'...\'',
'select Feld1 Feld2 Feld3 from Tabelle_Z where Bedingung1 = \'...\' and Bedingung2 = \'...\''
];
7 Einträge, 1 Seite |