I have this query that does an insert, (or suppose to) and I cannot for 
the life of me figure out why. I have done a <CFDUMP> on the variables 
to make sure everthing is showing up and it outputs fine but nothing 
gets inserted. Does anyone see a problem here?

<CFQUERY DATASOURCE="cmg" NAME="get_max_albumID">
SELECT MAX(ID) AS album_ID
FROM albums
</CFQUERY>

<CFQUERY DATASOURCE="cmg" NAME="insert_titles">
DECLARE  @maxid int
BEGIN
SELECT   @maxid = MAX(ID)
FROM   titles
IF @maxid = NULL
SELECT   @maxid = 1
ELSE
SELECT   @maxid = @maxid + 1
END


INSERT INTO titles ( ID,
      artist_ID,
      album_ID,
      SG1,
      SG2,
      SG3,
      SG4,
      SG5,
      SG6,
      SG7,
      SG8,
      SG9,
      SG10,
      SG11,
      SG12,
      SG13,
      SG14,
      CP1,
      CP2,
      CP3,
      CP4,
      CP5,
      CP6,
      CP7,
      CP8,
      CP9,
      CP10,
      CP11,
      CP12,
      CP13,
      CP14 )
      
VALUES     ( @maxid,
      '#artist_ID#',
      '#get_max_albumID.album_ID#',
      '#capFirstTitle(SG1)#',
      '#capFirstTitle(SG2)#',
      '#capFirstTitle(SG3)#',
      '#capFirstTitle(SG4)#',
      '#capFirstTitle(SG5)#',
      '#capFirstTitle(SG6)#',
      '#capFirstTitle(SG7)#',
      '#capFirstTitle(SG8)#',
      '#capFirstTitle(SG9)#',
      '#capFirstTitle(SG10)#',
      '#capFirstTitle(SG11)#',
      '#capFirstTitle(SG12)#',
      '#capFirstTitle(SG13)#',
      '#capFirstTitle(SG14)#',
      '#CP1#',
      '#CP2#',
      '#CP3#',
      '#CP4#',
      '#CP5#',
      '#CP6#',
      '#CP7#',
      '#CP8#',
      '#CP9#',
      '#CP10#',
      '#CP11#',
      '#CP12#',
      '#CP13#',
      '#CP14#' )
    
</CFQUERY>






There are two major products that come out of Berkeley: LSD and [Unix] 
BSD. We don't believe this to be a coincidence.



Doug Brown
______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to