Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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!

Thanks

Ashley

Update: Resolved. made a mistake :)

Comment on Require assistance with a query
Download Code
Re: Require assistance with a query
by hippo (Curate) 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1058171]
Approved by hdb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2014-12-21 12:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls