Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

Help converting from MS SQL

I don't think some of these functions are available to mySQL.  I am new to using it and wonder if anyone can help.


Here is a much shortened version of the script.  I think it has to do wth the @@rowcount, begin, end syntax...


UPDATE bp_item
                                    SET ItemID=<cfqueryparam cfsqltype="cf_sql_varchar"  value="#thisItem.itemId[1]#">                        
                                    WHERE ItemID= '#thisItem.itemId[1]#'                        
                                    IF @@ROWCOUNT = 0
                                    BEGIN
                                          INSERT INTO item
                                                            (KeywordID)
                                                VALUES
                                                            (<cfqueryparam cfsqltype="cf_sql_integer"  value="#getNextKeywords.keyword_ID#">)
                                    END




Thank you
0
theideabulb
Asked:
theideabulb
1 Solution
 
pateljituCommented:
Please try this article which explain the use of FOUND_ROWS();

SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name WHERE id > 100;
SELECT FOUND_ROWS();

http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_found-rows
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now