| Database Toolbox™ | ![]() |
p = procedures(dbmeta, 'cata')
p = procedures(dbmeta, 'cata',
'sch')
p = procedures(dbmeta, 'cata') returns stored procedures in the catalog cata, for the database whose database metadata object is dbmeta.
p = procedures(dbmeta, 'cata', 'sch') returns the stored procedures in:
The schema sch
Of the catalog cata
For the database whose database metadata object is dbmeta
Stored procedures are SQL statements that are saved with the database. Use the exec function to run a stored procedure. Specify the stored procedure as the sqlquery argument instead of explicitly entering the sqlquery statement as the argument.
Get the names of stored procedures for the catalog DBA, for the database metadata object dbmeta.
p = procedures(dbmeta,'DBA')
p =
'sp_contacts'
'sp_customer_list'
'sp_customer_products'
'sp_product_info'
'sp_retrieve_contacts'
'sp_sales_order'
Execute the stored procedure sp_customer_list for the database connection conn, and fetch all data.
curs = exec(conn,'sp_customer_list');
curs = fetch(conn)
curs =
Attributes: []
Data: {10x2 cell}
DatabaseObject: [1x1 database]
RowLimit: 0
SQLQuery: 'sp_customer_list'
Message: []
Type: 'Database Cursor Object'
ResultSet: [1x1 sun.jdbc.odbc.JdbcOdbcResultSet]
Cursor: ...
[1x1 com.mathworks.toolbox.database.sqlExec]
Statement: [1x1 sun.jdbc.odbc.JdbcOdbcStatement]
Fetch: ...
[1x1 com.mathworks.toolbox.database.fetchTheData]
View the results.
curs.Data
ans =
[101] 'The Power Group'
[102] 'AMF Corp.'
[103] 'Darling Associates'
[104] 'P.S.C.'
[105] 'Amo & Sons'
[106] 'Ralston Inc.'
[107] 'The Home Club'
[108] 'Raleigh Co.'
[109] 'Newton Ent.'
[110] 'The Pep Squad'
dmd, exec, get, procedurecolumns
![]() | procedurecolumns | querybuilder | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |