jollyroger
Technical User
Hello there, thanks to anyone who helps me here. Here is my bit of the program:
print LOG "Starting the Parameter checks and changes\n";
$i = 1;
while ( $i lt 9 ) {
print LOG "The rolling variable is $i\n";
if ( ${SQLPAR}$i =~ TODAY ) {
${SQLPAR}$i = $dateora;
print LOG "SQLPAR$i: ${SQLPAR}$i\n";
} elsif ( $SQLPAR$i =~ FIRST ) {
$SQLPAR$i = $FIRST_DATE;
print LOG "SQLPAR$i: $SQLPAR$i\n";
} elsif ( $SQLPAR$i =~ LAST ) {
$SQLPAR$i = $LAST_DATE;
print LOG "SQLPAR$i: $SQLPAR$i\n";
$i++;
} else {
print LOG "No Date Values\n";
}
}
OK, currently I have the Variables $SQLPAR1, $SQLPAR2 etc up to 8. I however need to check values against these variable such that if $SQLPAR4 =~ FIRST then it will assume the first date of the month, cool. But how to I write this in short form, so that if I need to increase my list of variable I can simply change the 9 to a 12.
Also this will not work, I think because I don't know how to enter the variable $SQLPAR$i so that the system recognises that I am saying $SQLPAR1 etc.
I hope you understand this from my program etc
Best regards
Ben
print LOG "Starting the Parameter checks and changes\n";
$i = 1;
while ( $i lt 9 ) {
print LOG "The rolling variable is $i\n";
if ( ${SQLPAR}$i =~ TODAY ) {
${SQLPAR}$i = $dateora;
print LOG "SQLPAR$i: ${SQLPAR}$i\n";
} elsif ( $SQLPAR$i =~ FIRST ) {
$SQLPAR$i = $FIRST_DATE;
print LOG "SQLPAR$i: $SQLPAR$i\n";
} elsif ( $SQLPAR$i =~ LAST ) {
$SQLPAR$i = $LAST_DATE;
print LOG "SQLPAR$i: $SQLPAR$i\n";
$i++;
} else {
print LOG "No Date Values\n";
}
}
OK, currently I have the Variables $SQLPAR1, $SQLPAR2 etc up to 8. I however need to check values against these variable such that if $SQLPAR4 =~ FIRST then it will assume the first date of the month, cool. But how to I write this in short form, so that if I need to increase my list of variable I can simply change the 9 to a 12.
Also this will not work, I think because I don't know how to enter the variable $SQLPAR$i so that the system recognises that I am saying $SQLPAR1 etc.
I hope you understand this from my program etc
Best regards
Ben