It is supposed to build a SQL statement "where" clause that looks something like this:
AND ((c.p_model01ind IN (?, ?, ?, ?) OR c.p_model02ind IN (?, ?, ?, ?)...etc
I have the following code that I keep getting this error on: Useless use of a constant in void context at ...
I've highlighted the lines it has a problem with. What exactly does this mean and how do I get rid of the error/warning?
[code]
my @promocodes = qw/code1 code2 code3 code4 code5/;
my...
That worked! One last question and I promise I'll leave you alone. You have taught me a lot and I truly appreciate the effort.
If the user has chosen the PromoCode option, I need to check to see if the values they enter exist in any of 20 fields, each called p_model01ind, p_model02ind...
Thanks. That caught the fact that I had fat fingered a table name that wasn't being found. Good call!
I've added this to my code to dump the fetched rows into an array. When I display each row however, I am seeing something like this: ARRAY(0x110c465a0)
I've seen this before. What does this...
I resolved it myself so thanks for all your help. Is there a way to print out what the $qry variable looks like before the execute statement? I put in a print stmt but all I see is the placeholders. I want to see the AND a.p_abc IN ('A','B','C'), etc. because I'm still getting this error:
Can't...
Wow, that's an interesting way of doing this. Thanks so much for the education. I've learned a lot.
I'm getting this error:
Useless use of hash element in void context at promo1.pl line 134
on this line:
push @{ $data{ $hash_ref->{param} }, $hash_ref->{value} if ( $table{...
Here's the code you are looking for. As far as your concern about the SQL injection attack, is this a concern if this is an app that is only run within our network?
#
# Prepare a SQL statement for execution
#
my $sql = "SELECT param
, value
FROM pac.promo_params...
I have the flags set in this sample code so that I can simulate that the flags had been set prior to arriving at this section of the code so I could make sure that the correct parts of the where clause were being appended as expected.
As far as the SQL statement question, yes, that is the...
Great, I think we are on the same page now. I virtually came to the same array conclusion yesterday. I have posted my code and the output below because I still have an issue (listed below)
my $promocode_found = 1;
my $stockclass_found = 1;
my $distchannel_found = 1;
my...
Ok Ishnid, I was following you right up until your last reply then I lost you. These are the flags that I have set based on what the user has selected. I lost you on the %flags hash comment.
$promocode_found
$stockclass_found
$distchannel_found
$dlrsuppcode_found
$altdlrsuppcode_found...
After reading more about the CGI module, it became apparent that I've perhaps mislead you. The form I'm referring to is an Access form. They users enter their data into Access, press a button which then enters the data into an Oracle table, which is where I grab it from. It looks to me like the...
This is what I'm using to test this and it's not working correctly. I am getting a syntax error message on this line "$qry .= $table( $_ );"
my $param_name = "promo_code";
$myquery = get_items_for_cat1($param_name);
print $myquery;
sub get_items_for_cat1
{
$param_name = shift;
my...
Perhaps I should not have used promo_code in both of my examples. The only part that is the same every time I run the query would be this:
$qry = "SELECT a.loc
, a.item
, a.p_abc
FROM stsc.sku a
, stsc.loc b
, stsc.item c
WHERE...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.