Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Copy XML file, write new attributes and move the old files.

by chacham (Prior)
on Jan 26, 2015 at 14:47 UTC ( [id://1114529]=note: print w/replies, xml ) Need Help??


in reply to Copy XML file, write new attributes and move the old files.

A couple comments on the SQL. One, is that syntax valid? I don't know mysql, but "SELECT IF NOT EXISTS" is not valid SQL. EXISTS() returns a binary value and thus must be used in a WHERE clause or CASE expression. SELECT ... WHERE EXISTS() is the standard method. If that is an IF statement instead, the SELECT would appear later: IF EXISTS() THEN SELECT ... ELSE INSERT....

Two, the query is using variables to put create a dynamic SQL statement. Dynamic SQL is generally considered insecure. But, it can be easily avoided via placeholders and passing the values in the execute() statement.

  • Comment on Re: Copy XML file, write new attributes and move the old files.

Replies are listed 'Best First'.
Re^2: Copy XML file, write new attributes and move the old files.
by Nevamonk (Novice) on Jan 27, 2015 at 08:58 UTC

    not really what the question was about, i mainly posted the entire code to not confuse anyone, cq give all the information possible, the SQL would be debugged next.

    but then again, this is very helpful information, so thanks alot for taking the time to help a newbie out. i will look into it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1114529]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-24 22:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found