I have a query where I need to create a reccuring id. As of now I create a table in sql that recurs starting at number 101. here is the code I use.
<cflock timeout="3" throwontimeout="No" name="mylock" type="EXCLUSIVE">
<cfquery name="getrid" datasource="#dsn#">
select recurid from recuridtest
</cfquery>
<cfoutput><cfset rid = #getrid.recurid# + 1></cfoutput>
<cfquery name="upid" datasource="#dsn#">
UPDATE recuridtest
SET recurid = #rid#
</cfquery>
</cflock>
This is where I am getting a little lost. Since the recurring id generates a 3 digit number I need to find a way to add a letter plus 8 zeros. I want my number to look like this on the output T00000000101.
The only reason I need this format is because my final insert is going to be made into an Oracle db that has been formatted to hold a length of 12 digits.
my insert statements looks something like this
<cfquery name="addEvent" datasource="test">
Insert Into test_data.event
(
xname
xnumber
)
Values
(
#xname#
#rid#
)
All help will be appreciated.
<cflock timeout="3" throwontimeout="No" name="mylock" type="EXCLUSIVE">
<cfquery name="getrid" datasource="#dsn#">
select recurid from recuridtest
</cfquery>
<cfoutput><cfset rid = #getrid.recurid# + 1></cfoutput>
<cfquery name="upid" datasource="#dsn#">
UPDATE recuridtest
SET recurid = #rid#
</cfquery>
</cflock>
This is where I am getting a little lost. Since the recurring id generates a 3 digit number I need to find a way to add a letter plus 8 zeros. I want my number to look like this on the output T00000000101.
The only reason I need this format is because my final insert is going to be made into an Oracle db that has been formatted to hold a length of 12 digits.
my insert statements looks something like this
<cfquery name="addEvent" datasource="test">
Insert Into test_data.event
(
xname
xnumber
)
Values
(
#xname#
#rid#
)
All help will be appreciated.