Ok Nat. Looks like i misread something there. So if it's in the same cfc, what about "this" - it looks like you might have forgotten it?
<cfset variables.trackingNumber = this.getNewID() /> rather than <cfset variables.trackingNumber = getNewID() /> does that work? > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Nat Papovich > Sent: Saturday, November 08, 2003 8:12 PM > To: [EMAIL PROTECTED] > Subject: RE: [CFCDev] Problems with Oracle sequence in CFC > > > Based on Nate's original post, it isn't a case of the method call to > getNewID() being unable to find an access-controlled method. He > states that > the call to the problematic method is being performed from within the same > CFC, and the error would say something like "Unable to find > method getNewID" > if there was an access problem. > > Nate, what happens if you change getNewID to allow output > (output="Yes") and > dump the result of qGetNewID from within itself? You might get a different > error in that case. Another issue might be the datasource, username and > password attributes of your cfquery. Can you verify that those > variables are > correct? Can you change qGetNewID to run a different bit of SQL without an > error? > > NAT > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Behalf Of Nando > > Sent: Saturday, November 08, 2003 1:35 AM > > To: [EMAIL PROTECTED] > > Subject: RE: [CFCDev] Problems with Oracle sequence in CFC > > > > > > What happens if you change it from a private method to a public one? i'm > > under the impression that private methods are only available from > > within the > > object they are written in. > > > > i've got a similar getID method working just fine, but it's in a public > > method. > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > Behalf Of [EMAIL PROTECTED] > > > Sent: Friday, November 07, 2003 8:55 PM > > > To: [EMAIL PROTECTED] > > > Subject: [CFCDev] Problems with Oracle sequence in CFC > > > > > > > > > I've been stuck on this for a good portion of the last two > days, and I'm > > > completely frustrated. > > > > > > 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 > > > ---------------------------------------------------------- > > > You are subscribed to cfcdev. To unsubscribe, send an email > > > to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' > > > in the message of the email. > > > > > > CFCDev is run by CFCZone (www.cfczone.org) and supported > > > by Mindtool, Corporation (www.mindtool.com). > > > > > > An archive of the CFCDev list is available at > > > www.mail-archive.com/[EMAIL PROTECTED] > > > > > > ---------------------------------------------------------- > > You are subscribed to cfcdev. To unsubscribe, send an email > > to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' > > in the message of the email. > > > > CFCDev is run by CFCZone (www.cfczone.org) and supported > > by Mindtool, Corporation (www.mindtool.com). > > > > An archive of the CFCDev list is available at > www.mail-archive.com/[EMAIL PROTECTED] > > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' > in the message of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported > by Mindtool, Corporation (www.mindtool.com). > > An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
