Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Require assistance with a query

by Ashley Jordan (Novice)
on Oct 14, 2013 at 11:23 UTC ( #1058171=perlquestion: print w/replies, xml ) Need Help??
Ashley Jordan has asked for the wisdom of the Perl Monks concerning the following question:

Hi Guys,

i am currently trying to make a script which will update a table based on the results of 2/3 selects previously executed in the script?</p?

I am relatively new to this and believe the SET would be best for this,

can you advise on the below?

This is the part i am looking at,

my $NULL = NULL; set @query1 := (SELECT (field,) FROM table WHERE table='NULL' \G); SELECT @query1 set @query2 := (SELECT (field2) FROM table2 WHERE field2='NULL' \G); SELECT @query2 IF (@query1) = $NULL { set @query3 := (SELECT (field3) FROM table3 WHERE field3=(@query2) + AND field4 LIKE 'test'); set query 5 := (UPDATE table5 SET field5=(@query3) WHERE field6=(@quer +y2);

I would pretty much like to update a field in table A only if that field in the table = A, what i will be updating it to is the content within a field in Table B ( that field must also contain the word test within another field in Table B)

I hope this is clear what i would like to achieve, if not please let me know!



Update: Resolved. made a mistake :)

Replies are listed 'Best First'.
Re: Require assistance with a query
by hippo (Abbot) on Oct 14, 2013 at 11:33 UTC

    Doesn't look much like the Perl I use. Are you sure you are in the right place? ;-)

      At least query (in title) was on point.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1058171]
Approved by hdb
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (None)
    As of 2017-07-27 03:04 GMT
    Find Nodes?
      Voting Booth?
      I came, I saw, I ...

      Results (402 votes). Check out past polls.