I have written the following function that calls an Oracle sequence:
<cffunction name="getNewID" returntype="numeric">
<cfquery name="qGetNewID" datasource="#variables.DSN#" username="#varibles.UN#" password="#variables.PW#">
SELECT ESERVICES.CGI_ID_SEQ.NEXTVAL as newID
FROM DUAL
</cfquery>
<cfreturn qGetNewID.newID />
</cffunction>
To test whether the above function works I placed it in a regular .cfm file and called it within the same file as follows:
<cfset variables.trackingNumber = getNewID() />
No problems.
When I take the same function and place it in a cfc as a private method and call it from within another setter function in the same cfc...
<cffunction name="setVariables">
....
<cfset variables.trackingNumber = getNewID() />
....
</cffunction>
It fails with the following error "Element newID is undefined in qGetNewID."
Anyone have any idea what I am doing wrong?
Thanks,
Nate
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

