MySQL Forums
Forum List  »  Newbie

Re: Using AI
Posted by: Phillip Ward
Date: June 03, 2024 05:21AM

Quote

... is the following AI generated code secure?

Define "secure".

It's not bad, by any means.

Most importantly, it uses Parameters to pass values into the SQL, instead of building up a string that just happens to contain something meaningful to your DBMS.

It has assumed that jobnumber is a string Data Type rather than a numeric one, but that might be right and it's probably the safest choice.

Presumably jobnumber is [uniquely] indexed on that table, so it will perform well.

Quote

I most likely would not have used this ...

Just curious, but what would you have used instead?

You are quite right to "distrust" generated code, but then you really should take the same attitude to anything that you find on The Web, even if it's put together by a "Real Person". Never cut-and-paste. Always take the time to understand what it's doing and then take just the bits that you actually need or interpret it so that it meets your needs.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
June 01, 2024 08:53AM
Re: Using AI
June 03, 2024 05:21AM
June 03, 2024 06:30AM
June 03, 2024 07:24AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.