|
Charles,
Whilst I obviously understand the problem of SQL injection, it is
*much*less of a problem with RPG than with e.g. C-like languages, for
many of the
same reasons that buffer overflows don't really hit RPG - because we don't
use open-ended strings with variable lengths to anything like the same level
that those other languages do.
For instance, using your example, the user has to have defined
userEnteredValue as a string of a certain length. If it's e.g. 10
characters, it's *very* hard to do much damage. Obviously if it's a long
character string, it gets more likely that bad things can happen, but that's
rare, especially ina select statement.
Another reason, of course, is that if the program is an RPG interactive
program, you can be pretty sure that it's not being accessed across the web.
With a C program (not an IBM i interactive C program, obviously, but who
writes those anyway?), there is always the risk that it can be called from
lots of different places other than those where it was designed to be called
from.
The reason I use parameters is simply because it's "good practice". Plus, I
won't get hassled on this forum :)
Look, I think Gary should use parameters instead of direct concatenation,
but that doesn't mean that his application is currently *actually* unsafe -
just that it *could* be, in ways that parameters would mitigate.
Rory
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.