Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating function, that contacts SQL query?

Status
Not open for further replies.

zerokode

Programmer
Jul 16, 2002
3
SI
Greetings!
I am having a problem creating a custom function in MM CF 5.0 (NOT MX!), and I cannot use the <cffunction> tag, because it is unrecognised....
Now a question... How do I create a custom function like this:

<cfscript>
function myFunction(table, row)
{
<cfquery dbtype=&quot;odbc&quot; dbsource=&quot;mydb&quot;>
INSERT
INTO sometable
(first, second)
VALUES
('#table#','#row#')
</cfquery>
}
</cfscript>

Well... The idea of connection is like this, but I have no clue, how to actually WRITE a function, that should DO this...
Ideas?

Thanx. ~W.
 
Without the functionality of CFFUNCTION in CFMX, the closest you can come to doing this in CF 5.0 is using a custom tag. CFSCRIPT doesn't support the use of CFML tags within itself.

-Tek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top