Link to home
Start Free TrialLog in
Avatar of riskyricky1972
riskyricky1972

asked on

sql asp 500pts

WhereString =   "SubString(Stock_Master.Bond_No,6,len(Stock_Master.Bond_No)) ='" & bondno & "' ORDER BY Stock_Master.Bond_No asc"  
I have partial of sql statement, and above sql code makes my query really slow. Is anyway I can use some other codes to make it faster?
500pts                                        
Avatar of dportas
dportas

Is this for Oracle or SQL Server or something else? It's always wise to state the product and version.

Try using a LIKE expression in place of = and SUBSTRING.

Your code looks dangerously vulnerable to SQL injection. There will be a proper way to do parameterisation in your host language of choice and you really ought to be using it.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial