I have a table that looks like this:
and using this code:
I get the following output:
Here's my question. I'm very new to Perl and using hashes so please bear with me. In this case, is the ParamlrGrp the Key:Value pair or is it the ParamlrGrp and Value:AMOS that is the Key:Value pair?
What I need to be able to do is to fetch all this data and then grab all the DlrGrp records and run off and query additional tables using this data, but I don't know how to refer to these records. How do I do that?
I need to run a query later like "select * from loc where dlrgrp in ('AMOS','BALTIMORKW','BAY AREA', etc.)
Code:
PLNRCODE PARAM VALUE PROCESSFLAG
M01 DlrGrp AMOS N
M01 DlrGrp BALTIMORKW N
M01 DlrGrp BAY AREA N
M01 DlrGrp CAROLINAKW N
M01 DlrGrp C-B KW N
M01 Abc A N
M01 Abc B N
M01 Abc C N
M01 Abc E N
M01 StkClass 010 N
M01 StkClass 010A N
M01 TargetAmount 15000 N
and using this code:
Code:
### Prepare a SQL statement for execution
my $sql = qq{ select param, value from pac.promo_params where plnrcode = ? and processflag = 'N' };
my $sth = $dbh->prepare( $sql );
### Execute the statement in the database
$sth->execute($planner);
my $hash_ref;
### Fetch rows into a hash reference with lowercase field names
while ($hash_ref = $sth->fetchrow_hashref('NAME_lc')) {
print "Param: $hash_ref->{param} Value: $hash_ref->{value}\n";
}
I get the following output:
Code:
Param: DlrGrp Value: AMOS
Param: DlrGrp Value: BALTIMORKW
Param: DlrGrp Value: BAY AREA
Param: DlrGrp Value: CAROLINAKW
Param: DlrGrp Value: C-B KW
Param: Abc Value: A
Param: Abc Value: B
Param: Abc Value: C
Param: Abc Value: E
Param: StkClass Value: 010
Param: StkClass Value: 010A
Param: TargetAmount Value: 15000
Here's my question. I'm very new to Perl and using hashes so please bear with me. In this case, is the ParamlrGrp the Key:Value pair or is it the ParamlrGrp and Value:AMOS that is the Key:Value pair?
What I need to be able to do is to fetch all this data and then grab all the DlrGrp records and run off and query additional tables using this data, but I don't know how to refer to these records. How do I do that?
I need to run a query later like "select * from loc where dlrgrp in ('AMOS','BALTIMORKW','BAY AREA', etc.)