109 users online (1 members and 108 guests)  

  Results 1 to 2 of 2


  1. Perl Interpretation Error    Forum: CGI Perl Forum
    Replies: 0
  2. Perl module error - ??    Forum: CGI Perl Forum
    Replies: 0
  3. Perl script error..    Forum: CGI Perl Forum
    Replies: 1
  4. error in perl with javascript    Forum: CGI Perl Forum
    Replies: 1
  5. where is perl error log?    Forum: CGI Perl Forum
    Replies: 3
  1. #1
    heals1ic's Avatar
    New User

    Join Date
    May 2006

    perl sql concat error

    I am trying to execute a mysql query-
    $sql = "SELECT S.supplier, S.sup_img, C.prodid, D.product, D.catid, C.minprice
        FROM  suppliers S 
        INNER JOIN (SELECT B.supplierid, A.prodid, A.minprice 
        FROM sup_prices B 
        INNER JOIN (SELECT X.prodid, MIN(X.price_each) minprice
        FROM sup_prices X
        INNER JOIN (SELECT PP.prodid, PP.product
        FROM products PP
        INNER JOIN prefs PR 
        ON PP.catid = PR.catid
        AND PP.prodid = PR.pref
        WHERE userid = $urow->{userid}) Y 
        ON X.prodid = Y.prodid
        GROUP BY X.prodid) A 
        ON B.prodid = A.prodid 
        AND B.price_each = A.minprice) C 
        ON S.supplierid = C.supplierid 
        INNER JOIN products D 
        ON C.prodid = D.prodid 
        ORDER BY D.catid";
    $result = $dbh->prepare($sql)
    I keep getting a concatination error-
    "Use of uninitialized value in concatenation (.) or string"
    Is there a problem with this sql for DBI?

  2. #2
    bckumari's Avatar
    New User

    Join Date
    Jun 2006

    Re: perl sql concat error

    You have written your query within the double quotes. Instead of doube quotes use qq// operator.
    For ex
    $sql = qq|select .....|;

Tags for this Thread