[row_count]

Description

Link: [row_count]
Author: Jason Huck
Category: Database
Version: 8.x
License: Public Domain
Posted: Aug. 02, 2007
Updated: Jan. 01, 0001
More by this author...
Returns the number of affected rows for the last insert, delete, or update statement against a MySQL datasource. Must be used within an [inline].

Parameters

none


Sample Usage

inline( ... );
    'There were ' + row_count + ' records updated.';
/inline;
						

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
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
define_tag(
	'row_count',
	-priority='replace',
	-description='
		Returns the number of affected rows for the last insert, 
		delete, or update statement against a MySQL datasource.
	'
);
	// default to zero
	local('out') = 0;
	
	if(
		lasso_datasourceismysql(database_name)
		&& (
			action_statement >> 'insert' 
			|| action_statement >> 'update' 
			|| action_statement >> 'delete'
		)
	);
		protect;
			inline( -sql='SELECT ROW_COUNT() AS changed');
				#out = integer(field('changed'));
			/inline;
		/protect;
	/if;
	
	return(#out);
/define_tag;

 

Related Tags



Comments

none

Email:


Password:



Newest

Most Popular