Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create a Better SQL Statement
Message
From
02/09/2015 12:03:52
 
 
To
02/09/2015 11:48:04
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01624174
Message ID:
01624178
Views:
65
Don't do it this way at all. It's a good way (or bad way) to allow SQL Injection. Use parameters for your variables. Here's how to do it with stored procs. https://www.levelextreme.com/ViewPageArticle.aspx?ID=772

>I would like to have some help to create a more streamlined SQL statement.
>
>My current statement:
>
>
>
>String where = " Where pinbr Like " + lookupString + " And posstr(pinbr, 'DEV') < 1 And posstr(pinbr, 'DYN') < 1 And posstr(pinbr, 'ST') < 1 And posstr(pinbr, 'CDR') < 1";
>	
>"Select pinbr, cinbr, ITDSC, qtypr From amflib1.pstdtl" +;
>" Join " amflib1.itment" +;
>" On amflib1.pstdtl.cinbr = amflib1.itment.itnbr" +;
>where
>
>
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform