Cf  MX to cf 5

Hie there,
I need a solution for my prob. Currently we used cf MX for
our application(which is for internal access) and cf 5 for external
access. There's a lot changes to make if we want to use same
application for 2 diff version of CF. For a few reason, we still
use cf 5 for external access. I realised that cf 5 not support
variable id. I give you an example
<cfquery name="insertData" datasource="#ds#">
insert into SetupDetail
(configValue, dateStart, dateEnd, CreatedBy)
values (CONVERT(datetime, '#form.quotedatefrom#',
103),CONVERT(datetime, '01/01/1980', 103),(datetime,
'#session.userid#' )
select id=@@identity
</cfquery>
<cfquery name="updateDataCode" datasource="#ds#">
update SetupDetail
set name = '#insertData.id#'
where id='#insertData.id#'
</cfquery>
Prob: There's an error on insert.id. If not mistaken
undefined insert.id.
So if anyone can help to solve my prob.

cf_mis wrote:
> <cfquery name="insertData" datasource="#ds#">
SET NOCOUNT ON
> insert into SetupDetail
> (configValue, dateStart, dateEnd, CreatedBy)
> values(
CONVERT(datetime, '#form.quotedatefrom#', 103),
CONVERT(datetime,'01/01/1980', 103),
(datetime, '#session.userid#'
> select id=@@identity
SET NOCOUNT OFF
> </cfquery>
assuming sql server & that SetupDetail table has an
identity column:
- for starters wrap the insert & select in NOCOUNT to
prevent the db server from
returning rowcounts which will confuse cf.
- next you also seem to have 4 columns to insert & 3
values and/or your sql
syntax is messed up.
also probably don't need to use CONVERT on those date values,
sql server should
be able to figure out that those strings represent dates.

Similar Messages

Maybe you are looking for

  • Tab canvas color

    Hi, I had a form with content/stacked canvases and I converted all of them to tab so that it would be much easier for the users to view. Everything's working fine but somehow the color of all the canvases has changed to light gray. Earlier my canvase

  • How to handle children using JDOM 8

    Hi, I'll like to handle (write, add child, remove child) a XML file with this structure using JDOM : <parent> <child1 name=""> <element1></element1> <element2></element2> <element3></element3> </child1> <child2 name=""> <element1></element1> <element

  • My iPod in not function.

    I tried & tried again to update and restore my ipod 4 gen. and it said when conect to iTunes "ipod in recovery mode" i did click on restore iPod but never finish the process, every time is the same what can I to do? my iPod in not function.

  • Quicktime-Update crash

    Quicktime-Update crashes with the message: unhandled exception - QuickTime.cpl. (Quicktime v 7.3) Message was edited by: comic-book-guy

  • OEM DB control has no oem agent, right?

    I am new to this 10g OEM things, can I understand that oem agent is installed in each db that will be monitored by GRID control, for individual db, there is DB control that doesn't need agent , right? Thanks a lot.