Saturday, February 28, 2009
Arrays in MySQL Stored Procedures
Keywords: Arrays in MySQL Stored Procedures, Arrays in MySQL, MySQL Stored Procedures, Stored Procedures, MySQL, Arrays, MySQL Functions, MySQL Custom Functions, MySQL LibrariesWonder how to arrays in MySQL? Everyone knows that there is no Arrays in MySQL & MySQL Stored Procedures, but we badly need arrays, isn't it?a
Here is the answer for your unique questions about Arrays in MySQL Stored Procedures, Functions.
There is MySQL 3rd party library which helps us acheiving the same. It is quiet good and structured too. It helps reducing more lines of your MySQL Program.
Note: The following functions shall only be called in select statements and stored procedures
Examples:
To create a new array from your MySQL stored procedure:-
mysql> call array_create('mysql_array_name',0);
To create an array from a list/string (with comma separated):-
mysql> call array_from_list('one,two,three', 'mysql_array_name');
To create an array from a list/string (with ":" separated):-
mysql> call array_from_list_complete('string1:string2:string3:string4', 'mysql_array_name', ':');
To set value into a mysql array using a key:-
mysql> array_set_value_by_key('mysql_array_name','index','value');
To retrieve value from a mysql array using a key:-
mysql> select array_get_value_by_key(('mysql_array_name','index' );
To set value into a mysql array using index:-
mysql> array_set_value_by_index('mysql_array_name','index','value');
To retrieve value from a mysql array using index:-
mysql> select array_get_value_by_index('mysql_array_name','index' );
To perform queue functions in mysql array:-
mysql> array_unshift('mysql_array_name', 'value'); --Inserts a value into mysql arraymysql> select array_shift('mysql_array_name'); --Deletes the last element in the mysql array
To perform stack functions in mysql array:-
mysql> array_push('mysql_array_name', 'value'); --Inserts a value into mysql array at the end/topmysql> array_po('mysql_array_name'); --returns the top/last_inserted element from the mysql array (Last in First out)
To see the values in the mysql array:-
mysql> call array_show( 'mysql_array_name' );mysql> call array_list(); --List of all arrays;mysql> call array_full_list(); --List of all arrays;
For more information on MySQL Stored Procedure, Functions Library, Please visit:-
Detailed list of MySQL Array Functions:-
- function array_create
- function array_copy_complete
- function array_grep_complete
- function array_grep
- function array_copy
- function array_append
- function array_sort_complete
- function array_sort
- function array_merge_complete
- function array_merge
- function array_from_list_complete
- function array_from_list
- function array_from_pair_list_complete
- function array_from_pair_list
- function array_set_value_by_key
- function array_unshift
- function array_push
- function array_set_key_by_index
- function array_set_value_by_index
- function array_set
- function array_setn
- function array_get_value_by_index
- function array_get_key_by_index
- function array_to_list_complete
- function array_to_list
- function array_to_pair_list_complete
- function array_to_pair_list
- function array_get_value_by_key
- function array_get
- function array_clear
- function array_drop
- function array_size
- function array_max_index
- function array_exists
- function array_pop
- function array_shift
- procedure array_create
- procedure array_copy_complete
- procedure array_grep_complete
- procedure array_grep
- procedure array_copy
- procedure array_append
- procedure array_sort_complete
- procedure array_sort
- procedure array_merge_complete
- procedure array_merge
- procedure array_from_list_complete
- procedure array_from_list
- procedure array_from_pair_list_complete
- procedure array_from_pair_list
- procedure array_set_value_by_key
- procedure array_unshift
- procedure array_push
- procedure array_set_key_by_index
- procedure array_set_value_by_index
- procedure array_set
- procedure array_list
- procedure array_show
- procedure array_full_list
- procedure array_clear
- procedure array_drop
Keywords: Arrays in MySQL Stored Procedures, Arrays in MySQL, MySQL Stored Procedures, Stored Procedures, MySQL, Arrays, MySQL Functions, MySQL Custom Functions, MySQL Libraries
Featured Blog Topics:
- MySQLDUMP: Taking Backup of Multiple Databases - http://kathyravan.blogspot.com/2009/02/mysqldump-taking-backup-of-multiple.html
- MySQL LEFT JOIN - http://kathyravan.blogspot.com/2009/01/mysql-left-join.html
- MySQL SQL_CACHE - http://kathyravan.blogspot.com/2008/12/mysql-sqlcache.html
- MySQL Query Caching - http://kathyravan.blogspot.com/2008/12/mysql-query-cache.html
- MySQL Show - http://kathyravan.blogspot.com/2008/12/mysql-show-statements.html
- CSV - MySQL Storage Engine - http://kathyravan.blogspot.com/2008/12/csv-mysql-storage-engine.html
- Blackhole - MySQL Storage Engine - http://kathyravan.blogspot.com/2008/12/blackhole-mysql-storage-engine.html
- Memory - MySQL Storage Engine (Formerly Heap Storage Engine) - http://kathyravan.blogspot.com/2008/12/memory-mysql-storage-engine-formerly.html
- Xml in MySQL - http://kathyravan.blogspot.com/2008/03/xml-in-mysql.html
- Forgot mySQL root Password? - http://kathyravan.blogspot.com/2008/02/forgot-mysql-root-password.html
- Samba - Installation & Configuration - http://kathyravan.blogspot.com/2008/02/samba-installation-configuration.html
- Enabling HTTP Authentication in Apache - http://kathyravan.blogspot.com/2008/08/enabling-http-authentication-in-apache.html
- PHP Function: isFTPFileExists (Searching a FILE in FTP) - http://kathyravan.blogspot.com/2008/12/php-function-isftpfileexists-searching.html
- Shell Scripting & Linux - http://kathyravan.blogspot.com/search/label/Shell%20Scripts
- SBI's New Home Loan Scheme - http://paisamechanic.blogspot.com/2009/02/sbis-special-home-loan-scheme.html
- ATM Locations in Chennai - http://paisamechanic.blogspot.com/search/label/ATM%20Locations%20-%20Chennai
- Deutsche Bank ATM Locations - http://paisamechanic.blogspot.com/search/label/Deutsche%20Bank%20ATM%20Locations
- SBI ATM Locations - http://paisamechanic.blogspot.com/search/label/SBI%20ATM%20Locations
- iMobile - ICICI Bank's New age of Mobile Banking
- HSBC Cheque Drop Box Locations -http://paisamechanic.blogspot.com/search/label/HSBC%20Cheque%20Drop%20Box%20Locations
- CITIBANK Cheque Drop Box Locations -http://paisamechanic.blogspot.com/search/label/Citibank%20Cheque%20Drop%20Box%20Locations
- Standard Chartered Bank Cheque Drop Box Locations - http://paisamechanic.blogspot.com/search/label/Citibank%20Cheque%20Drop%20Box%20Locations
- IFSC Code Definition - http://paisamechanic.blogspot.com/2008/12/ifsc-code-definition.html
- IFSC Codes of All Banks - http://paisamechanic.blogspot.com/2008/12/ifsc-codes-of-indian-banks.html
- IFSC Codes of Deutsche Bank - http://paisamechanic.blogspot.com/2009/01/ifsc-codes-of-deutsche-bank.html
- IFSC Codes of Syndicate Bank - http://paisamechanic.blogspot.com/2009/01/ifsc-codes-of-syndicate-bank.html
- IFSC Codes of Andhra Bank - http://paisamechanic.blogspot.com/search/label/IFSC%20Codes%20-%20Andhra%20Banks
- OneView HDFC Bank - All in One Internet Banking -http://paisamechanic.blogspot.com/2008/12/oneview-hdfc-bank-all-in-one-internet.html
- EMI Calculator - http://paisamechanic.blogspot.com/2008/12/emi-calculator.html
- Standard Chartered Bank Cheque Drop Box Locations Chennai -http://paisamechanic.blogspot.com/2008/12/standard-chartered-bank-cheque-drop-box.html
- Standard Chartered Bank Cheque Drop Box Locations Bangalore -http://paisamechanic.blogspot.com/2008/12/standard-chartered-bank-cheque-drop-box.html
- Reliance Guarantee Return Plan- http://paisamechanic.blogspot.com/2008/12/reliance-guarantee-return-plan.html
- SBI NEFT Fund Transfer - http://paisamechanic.blogspot.com/2008/12/sbi-neft-fund-transfer.html
- IFSC Codes of Indian Banks - http://paisamechanic.blogspot.com/2008/12/ifsc-codes-of-indian-banks.html
- Mobile Showroom Locations - http://paisamechanic.blogspot.com
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment