Posts

Showing posts from April, 2009

Optimizing SQL Queries

From simple expressions to string expressions or even in joins there are some simple yet effective things you can do to make you SQL Queries run a bit faster. Simple Expression Example: A good rule of thumb when using where/and to query for values put the most restrictive ones first. SELECT * FROM Students WHERE sex = ‘female’ AND grade = ‘A’ The above query would run faster if you checked for the A first because less students will have an Another words SELECT * FROM Students WHERE grade = ‘A’ AND sex = ‘female’ Another Example: SELECT COUNT(*) FROM Students Might not be as fast if student_ID is the primary key SELECT COUNT(student_ID) FROM Students For Strings minimize using % or _ in LIKE statements another words don’t use LIKE ‘%Tom%’ if LIKE ‘Tom%’ is all you really need. Carefully chosen indexes speed up SQL queries without slowing updates too much. Almost all tables can benefit from an index, and experience has shown that the "ideal index" is almost never the primary ke...

Creat a ColdFusion collection with the cfcollection tag

On occasion a developer may not have access to ColdFusion Administrator, for example, if you use a virtual hosting company. If you want your ColdFusion application to be able to create, delete, and maintain a collection you will need to use the cfcollection tag. The following will show you how to create a collection index it then index it to include a MS Access database this code works great for use with a serch function for your shopping cart site. You will need to create an Access database with a table named Products and you will need the following fields ItemID, ProductID, ProductName, BriefDescription, Details.   To create a simple collection form page: Create a ColdFusion page with the following content: [html] [head] [title]Collection Creation Input Form[/title] [/head] [body] [h2]Specify a collection[/h2] [form action="collection_action.cfm" method="POST"] [!--- The following can be changed to your needs ---]   [p]Collecti...

Calling a flex Remote Object with Actionscript

Our .AS file   package model {       import mx.rpc.remoting.RemoteObject;       import mx.core.Application;       public dynamic class ResultsRO extends RemoteObject       {                 private var _appUrl:String;             private var domainUrl:String;             private var app:Application = Application.application as Application;             public function ResultsRO (destination:String= null )             {                   super (destination);  ...

Nice Flex export to Excel ActionScript file

THE ACTION SCRIPT // ActionScript file       import mx.controls.Alert;       import mx.core.UIComponent;       import mx.core.Container;       import mx.events.ItemClickEvent;       import mx.utils.ObjectProxy;       import flash.errors.*;       import flash.events.*;       import flash.external.*;                  import flash.net.URLLoader;       import flash.net.URLVariables;       import flash.net.URLRequest;       import mx.controls.DataGrid;                 //The location of the excel export file       ...