Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default RecordCount Issues

    Hi folks!

    Long story short: Within the application, which I'm developing ATM, I have to
    do some update- and delete-queries, but it seems that they do not return
    anything. I can't even cfdump the queries because they are undefined. All I
    want is the number of deleted or updated rows. Does cfquery not support this or
    what?

    Some examples:

    <cfquery name="deltest" datasource="#dsn#">
    select * from testtab
    </cfquery>
    <cfdump var="#deltest.RecordCount#">

    <cfquery name="deltest2" datasource="#dsn#">
    INSERT INTO testtab( iddi )
    VALUES ('asdasd')
    </cfquery>
    <cfdump var="#deltest2#">

    <cfquery name="deltest3" datasource="#dsn#">
    delete from testtab where iddi='asdasd'
    </cfquery>
    <cfdump var="#deltest3#">

    supportcenter Guest

  2. Similar Questions and Discussions

    1. Indirect recordcount
      I have a variable that contains the name of a query. How can I get the RecordCount for that query? I've tried using Evaluate() in several...
    2. Getting a recordcount
      Hi I have opened a database in PHP and would like to know whether a particular record exists. i.e. $ThisUsername = $_REQUEST;...
    3. recordcount -1
      I'm simply trying to get a number of records returned in a recordset, and just get a -1. I have looke din a few books and other references, can't...
    4. RecordCount Property and SQL
      When using an access database, I could retrieve the recordcount with code below For r = 1 to RS.RecordCount When I try the same syntax on a...
    5. Why does the RecordCount property always = -1
      I have a working set of data coming back from my database without any problems. I am trying to add a textbox to each row of repeated data and...
  3. #2

    Default Re: RecordCount Issues

    If you are using SQL server you can use the @@Rowcount to get the number of
    records inserted or updated

    you can try this
    INSERT INTO testtab( iddi )
    VALUES ('asdasd')
    select @@rowcount as Rowcount

    but I don't know if it will work like that, if not convert your code to stored
    procedures


    SQLMenace Guest

  4. #3

    Default Re: RecordCount Issues

    run a select count(fieldname) right before you update or delete the records.
    As long as the where clauses are the same, it should work.

    Originally posted by: supportcenter
    Hi folks!

    Long story short: Within the application, which I'm developing ATM, I have to
    do some update- and delete-queries, but it seems that they do not return
    anything. I can't even cfdump the queries because they are undefined. All I
    want is the number of deleted or updated rows. Does cfquery not support this or
    what?

    Some examples:



    Dan Bracuk Guest

  5. #4

    Default Re: RecordCount Issues

    Thx. I think that I've already made enough slow database queries so that I do
    not really want to verify those querys by "select count..."
    Would have been nice if there was a RecordCount to get the number of affected
    rows. Luckily I do not really need it, but it would have been nice to have a
    _simple_ method of verification. But thanks anyway.

    supportcenter Guest

  6. #5

    Default Re: RecordCount Issues

    supportcenter,

    For future reference, it's always helpful to indicate the type of database
    you're using. It's possible that your database type does have this capability,
    but without knowing which type, it is difficult to definitively answer your
    question.


    mxstu Guest

  7. #6

    Default Re: RecordCount Issues

    I'm sorry...normally I do mention all the required information.
    It's MySQL 4.something together with CFMX 6.x

    Btw: isn't it possible to use some other username than the first part of my
    mail-address?!

    supportcenter Guest

  8. #7

    Default Re: RecordCount Issues

    supportcenter,

    You might have a look at this thread which suggests a few possibilities:
    [url]http://forums.mysql.com/read.php?60,45239,45239#msg-45239[/url]
    [url]http://dev.mysql.com/doc/refman/5.0/en/information-functions.html[/url]
    >Btw: isn't it possible to use some other username than the first part of my
    mail-address?!
    I don't know that it is possible to change your screen name after you sign up.
    Weren't you given the option to select your username? IF it were possible, it
    might be under membership details:
    [url]http://www.macromedia.com/cfusion/membership/index.cfm[/url]



    mxstu Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139