I try to avoid needing platform-specific sql during the app's initial
construction.  May be too late or impossible for you to go down that
road.

Using CF to produce things like the date value from your example instead
of using the db's native functions eliminates the need to worry about
db-specific functions.  As a rule I just do without db functions and set
values outside of cfquery.

This may mean compromising performance, but generally, for my own needs,
this has been extremely rare.  For the exceptions where it can't be done
(for example, using a sequence for an insert on Oracle) its pretty easy
to write a bit of conditional sql

<cfquery
datasource="#request.myDSN#">
INSERT INTO myfile
  (<cfif not Compare(myCachedQuery.DB,"2")>ID,</cfif>
  Blah)
VALUES
  (<cfif not Compare(myCachedQuery.DB,"2")>seq_myfile.nextval,</cfif>
  <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value=#form.Blah#>)
</cfquery>

In cases where there's no way around doing fully custom sql I'll put the
conditional sql inside of a case statement; but for me it's a rare need.

--------------------------------------------
Matt Robertson       [EMAIL PROTECTED]
MSB Designs, Inc.  http://mysecretbase.com
--------------------------------------------


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to