Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: ssmith001
  • Order by date
  1. ssmith001

    Useless use of a constant in void context error

    Thanks for the explanation. That makes sense and I don't think I would have ever understood why. Thanks again.
  2. ssmith001

    Useless use of a constant in void context error

    Thanks Kevin. That worked perfectly.
  3. ssmith001

    Useless use of a constant in void context error

    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
  4. ssmith001

    Useless use of a constant in void context error

    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...
  5. ssmith001

    Dynamic Where Clause using DBI

    If there is anyone out there that can help with this last part I would greatly appreciate your help.
  6. ssmith001

    Dynamic Where Clause using DBI

    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...
  7. ssmith001

    Dynamic Where Clause using DBI

    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...
  8. ssmith001

    Dynamic Where Clause using DBI

    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...
  9. ssmith001

    Dynamic Where Clause using DBI

    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{...
  10. ssmith001

    Dynamic Where Clause using DBI

    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...
  11. ssmith001

    Dynamic Where Clause using DBI

    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...
  12. ssmith001

    Dynamic Where Clause using DBI

    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...
  13. ssmith001

    Dynamic Where Clause using DBI

    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...
  14. ssmith001

    Dynamic Where Clause using DBI

    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...
  15. ssmith001

    Dynamic Where Clause using DBI

    I meant "undefined
  16. ssmith001

    Dynamic Where Clause using DBI

    I'm closer. Now I get this: defined subroutine &main::param called at Untitled1 line 24.
  17. ssmith001

    Dynamic Where Clause using DBI

    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...
  18. ssmith001

    Dynamic Where Clause using DBI

    I'm not sure I follow how this is supposed to work. Can you explain?
  19. ssmith001

    Dynamic Where Clause using DBI

    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...
  20. ssmith001

    Dynamic Where Clause using DBI

    Sorry, forgot to mention that they must choose at least one. Thanks, I'll play around with your suggestion for a while.

Part and Inventory Search

Back
Top