stored procedure in mysql example cursor

Tài liệu Built-In Functions in MySQL (Hàm xây dựng sẵn trong MySQL) doc

Tài liệu Built-In Functions in MySQL (Hàm xây dựng sẵn trong MySQL) doc

... chènnewstring : chuỗi sẽ được chèn Ví dụ: select insert('hoa bằng lăng đỏ ',15,2,'tím') Trang 19Trích chuỗiLeft ( string , length) Right( string ,length) Mid( string , start_position, length ) Substring(string,position) ... đếm số dòng trong trường. Trang 29SELECT max( ngay_sinh ) FROM sinhvienSELECT min( ngay_sinh ) FROM sinhvien SELECT sum(hoc_bong) FROM sinhvien Trang 30Các hàm điều khiểnCác cấu trúc điều kiện ... khácLength( string ) Lcase( string) Ucase( string ) Với string là chuỗi cần thao tác Trang 23Các hàm thao tác trên dữ liệu kiểu sốTrang 24Floor(number): Làm tròn xuống số nguyên gần nhấtCeiling (number)

Ngày tải lên: 25/02/2014, 03:20

36 777 1
BACKUP AND RESTORE DATBASE IN MYSQL pot

BACKUP AND RESTORE DATBASE IN MYSQL pot

... admin accounts > accounts.sql • Chỉ backup cấu trúc các bảng mysqldump -u admin -p admin no-data accounts > accounts.sql Chỉ backup dữ liệu mysqldump -u admin -p admin no-create-info ... lệnh, di chuyển đến thư mục bin của thư mục cài đặt và gõ vào lệnh: mysql - u admin -p admin accounts < accounts.sql Trang 11Backup và Restore dữ liệu sử dụng MySQL Administrator Trang 12Backup ... tục và hàm mysqldump -u admin -p admin routines accounts > accounts.sql Trang 10Restore DatabaseKhôi phục Database về trạng thái được backup gần nhất Các bước thực hiện: Khởi động MySQL Server

Ngày tải lên: 10/03/2014, 09:20

16 533 3
bài 4 stored procedure và giao dịch

bài 4 stored procedure và giao dịch

... SELECT @DateVar = MIN (InvoiceDate) FROM Invoices DECLARE @InvCount int SELECT @InvCount = COUNT (InvoiceID) FROM Invoices JOIN Vendors ON Invoices VendorID = Vendors.VendorID WHERE ((InvoiceDate >= ... @InvCount Trang 15Demo Làm việc với giá trị trả vềDECLARE @InvCount int EXEC @InvCount = spInvCount '2008-06-01', 'P%' PRINT 'Invoice count: ' + CONVERT ( varchar , @InvCount) Lời gọi Stored Procedure ... PROC spInsertInvoice @VendorID int , @InvoiceNumber varchar (50), @InvoiceDate smalldatetime , @InvoiceTotal money , @TermsID int , @InvoiceDueDate smalldatetime CREATE PROC spInsertInvoice

Ngày tải lên: 23/05/2014, 16:13

36 437 0
tài liệu stored procedure

tài liệu stored procedure

... customer_cursor into Trang 26GV Phạm Thị Lan Anh 27Sử dụng OUTPUT cursor parameter USE northwind CREATE PROCEDURE customer_cursor @customer_cursor CURSOR VARYING OUTPUT AS SET @customer_cursor = CURSOR ... or scrolling cursor. sp_describe_cursor_columns Describes the attributes of the columns in the cursor result set. sp_describe_cursor_tables Describes the base tables accessed by the cursor. ... store procedure  Bài tập áp dụng Trang 3Nội dung bài học1. Giới thiệu Stored procedures 2. Tạo, thực thi, cập nhật và xoá stored procedures 3. Bài tập thực hành 4. Truyền tham số trong stored procedures

Ngày tải lên: 06/07/2014, 08:52

36 378 1
Lấy dữ liệu dùng Stored Procedure doc

Lấy dữ liệu dùng Stored Procedure doc

... UDF khi chạy: Trang 14Tổng kết LINQ to SQL supports the ability to call Stored Procedures and UDFs within the database and nicely integrate them into our data model In this blog post I demonstrated ... bạn có thể viết các biểu thức truy vấn LINQ cho một mô hình dữ liệu LINQ to SQL dùng đoạn mã như sau: Trang 2Khi bạn viết các biểu thức LINQ kiểu như vậy, LINQ to SQL sẽ thực thi các câu lệnh SQL ... nay, tôi sẽ cho thấy cách chúng ta có thể dùng các stored procedure (SPROCs) và các hàm do người dùng định nghĩa (UDFs) với mô hình dữ liệu LINQ to SQL Bài viết này sẽ tập trung chủ yếu vào cách

Ngày tải lên: 10/08/2014, 23:24

14 429 0
SQL Server 2000 Stored Procedure Programming phần 1 pps

SQL Server 2000 Stored Procedure Programming phần 1 pps

... Recompiling Stored Procedures 86 Storing Stored Procedures 88 Managing Stored Procedures 90 Listing Stored Procedures 90 Viewing Stored Procedures 93 Renaming Stored Procedures ... Types of Procedures 345 Types of Stored Procedures 346 User-Defined Stored Procedures 346 System Stored Procedures 346 Extended Stored Procedures 348 Temporary Stored Procedures ... Online 43 Basic Operations with Stored Procedures 44 Execution of Stored Procedures from Query Analyzer 44 Managing Stored Procedures from Enterprise Manager 49 Editing Stored Procedures

Ngày tải lên: 13/08/2014, 08:20

50 279 0
SQL Server 2000 Stored Procedure Programming phần 2 pdf

SQL Server 2000 Stored Procedure Programming phần 2 pdf

... information from a stored procedure ■ Pass input parameters to a stored procedure ■ Receive output parameters from a stored procedure ■ Receive a return value from a stored procedure ■ Explain ... Explain where stored procedures are stored on SQL Server ▲ Explain the compilation and reuse of stored procedures ANATOMY OF A STORED PROCEDURE We can describe a stored procedure in terms of ▼ ... way to transfer informationfrom a stored procedure to a caller In the first place, it is limited bydatatype Only integers can be returned this way (includingint,smallint, andtinyint) This method

Ngày tải lên: 13/08/2014, 08:20

76 317 0
SQL Server 2000 Stored Procedure Programming phần 3 ppsx

SQL Server 2000 Stored Procedure Programming phần 3 ppsx

... assigned in theSetstatement, displayed in thePrintstatement, stored in a table usingUpdateandInsert, or even used as parameters for other functions Create Procedure prInsertNewSchedule @intLeaseId int, ... system stored procedure for each of them Excessive processing based on a single row (for example, business logic implemented in the form of an extended stored procedure) can also be implemented using ... (for example by nesting comments or by spanning comments over multiple batches) Trang 4The preceding example is based on part of a SQL script forcreating a stored procedure generated by Visual InterDev

Ngày tải lên: 13/08/2014, 08:20

76 279 0
SQL Server 2000 Stored Procedure Programming phần 4 pot

SQL Server 2000 Stored Procedure Programming phần 4 pot

... Transact-SQL code into explicitly set batches In the following example, the code for dropping a stored procedure is in one batch and the code for creating a new stored procedure is in another The ... when one stored procedure containing a transaction calls another stored procedure that also contains a transaction In the following example, prCompleteOrder completes an order by setting its completion ... Server A stored procedure can call or execute another stored procedure.Such stored procedures are said to be “nesting.” SQL Server 7.0 andSQL Server 2000 have a limit of 32 stored procedure nesting

Ngày tải lên: 13/08/2014, 08:20

76 323 0
SQL Server 2000 Stored Procedure Programming phần 5 ppsx

SQL Server 2000 Stored Procedure Programming phần 5 ppsx

... the calling procedure that there was a problem Nested Stored Procedures The calling stored procedure might have the same error handlingsystem in place In such a case, calls to the stored procedures ... 19Create Procedure prInsertLeasedAsset_5 Insert leased asset and update total in LeaseSchedule. Declare @intErrorCode int Select @intErrorCode = @@Error @intStatusId, @intLeaseId, @intLeaseScheduleId,@intOwnerId, ... when a stored procedure calls another stored procedure) It is a useful practice to display the name of the stored procedure at the beginning and end of the stored procedure declare @chvProcedure

Ngày tải lên: 13/08/2014, 08:20

76 284 0
SQL Server 2000 Stored Procedure Programming phần 6 ppsx

SQL Server 2000 Stored Procedure Programming phần 6 ppsx

... equipment Insert into Equipment(Make, Model, EqTypeId) Select inserted.Make, inserted.Model, EqType.EqTypeId From inserted Inner Join EqType On inserted.EqType = EqType.EqType GO Insert Into vEquipment(EquipmentId, ... Print Inside a Trigger ThePrintandSelectcommands are very useful in triggers during the debugging process However, they can be very dangerous if left in a trigger after it has been introduced into ... type of procedure Triggers are very similar to events—a type of procedure in certain programming languages such as Visual Basic Events in Visual Basic are initiated by the systemwhen certain actions

Ngày tải lên: 13/08/2014, 08:20

76 262 0
SQL Server 2000 Stored Procedure Programming phần 7 pps

SQL Server 2000 Stored Procedure Programming phần 7 pps

... Server 2000 Stored Procedure ProgrammingThe best way to insert a record into a SQL Server table and obtain an identity key is to use a stored procedure The following storedprocedure prInsertInventory ... calling stored procedure You can use the cursordatatype as the output parameter of a stored procedure In the following example, prGetInventoryProperties_CursorGet creates Trang 7and opens a cursor ... Server 2000 Stored Procedure Programmingstored procedures, but SQL Server Books Online now provides thatinformation NOTE: Unfortunately, it is not possible to collect information if a stored procedure

Ngày tải lên: 13/08/2014, 08:20

76 318 0
SQL Server 2000 Stored Procedure Programming phần 8 pps

SQL Server 2000 Stored Procedure Programming phần 8 pps

... uniquely named In the preceding example, theroot element is namedInventory.Each element can contain one or more other elements In thepreceding example, theInventoryelement contains oneAsset element ... and user-defined stored procedures can be used to performall administrative activities in SQL Server Everything you can dothrough Enterprise Manager can also be done using stored procedures It ... repeat an attribute in the same tag The following example shows a syntactically incorrect element: <Inventory Inventoryid="12" Inventoryid="13"/> Processing Instructions An

Ngày tải lên: 13/08/2014, 08:20

76 296 0
SQL Server 2000 Stored Procedure Programming phần 9 potx

SQL Server 2000 Stored Procedure Programming phần 9 potx

... can be created in the stored procedure as well: CREATE PROCEDURE prGetEquipment_xml Accessing Database Information Using Templates In the preceding section, we showed how you can incorporate aTransact-SQL ... occurred Using a Stored Procedure Through HTTP SQL Server 2000 and the ISAPI driver do not force you to use only can also use stored procedures The following stored procedure contains a simpleSelectstatement ... sp_xml_removedocument @intDocreturn @intErrorCodeFigure 12-10 demonstrates the use of the stored procedure A longXML document was created by copying and pasting the same set ofnodes into the string (XML document)

Ngày tải lên: 13/08/2014, 08:20

76 301 0
Báo cáo môn PHP chủ đề Export & Import  in MySQL by PHP

Báo cáo môn PHP chủ đề Export & Import in MySQL by PHP

... Trang 1ĐẠI HỌC QUỐC GIA TP HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC CÔNG NGHỆ THÔNG TIN GVHD : ThS Mai Xuân Hùng Export & Import in MySQL by PHP Serminar PHP chủ đề: SVTH: Y-BUĂN ADRƠNG – 09520733 ... <th>idalbum</th>"; mysql_query("SET NAMES utf8"); $sql = "select `id`,`tenbh`,`loai`,`idalbum` from `baihat`"; $data = mysql_query($sql); Trang 10while($rows = mysql_fetch_assoc($data)) ... Trang 2• Excel • Text EXPORT • Excel • Word Trang 3IMPORT CSDL TỪ FILE EXCELTẠO BẢNG CSDL TRONG MYSQL Trang 4IMPORT CSDL TỪ FILE EXCEL CODE CHUYỂN Trang 5IMPORT CSDL TỪ FILE EXCELTẠO BẢNG DỮ LIỆU

Ngày tải lên: 05/04/2015, 21:53

14 741 0
Stored procedure

Stored procedure

... <Cau_lenh_SQL | BEGIN <Khoi_lenh> END > [BREAK ] <Cau_lenh_SQL |BEGIN <Khoi_lenh> END >[ CONTINUE ] <Cau_lenh_SQL |BEGIN <Khoi_lenh> END > SET @Dem = 0 BEGIN SET @Dem ... [Bieu_thuc_nguyen] - Dùng để thoát khỏi SP - Ví dụ  PRINT <Chuoi | @Bien> - Dùng để xuất kết quả, giá trị ra màn hình - Ví dụ PRINT ‘ABC’ PRINT @Dem PRINT GETDATE () Trang 17Nội dung chi tiếtTrang ... : CREATE PROCEDURE, CREATE RULE, CREATE VIEW, CREATE TRIGGER Để thi hành lệnh CREATE PROCEDURE, người dùng phải là thành viên của một trong các role: sysadmin, db_owner, db_ddladmin hoặc được

Ngày tải lên: 03/12/2015, 07:45

32 241 1
HỆ QUẢN TRỊ CSDL SQL SERVER   chương 7  STORED PROCEDURE

HỆ QUẢN TRỊ CSDL SQL SERVER chương 7 STORED PROCEDURE

... (@string_var | [N]'string_expression') Trang 111- Biến cục bộ : 1- Biến cục bộ : a) Khai báo biến cục bộ: DECLARE @VarName data_type [, n] Ví dụ: Declare @n TinyInt, @m TinyInt, @y SmallInt ... spDTNam(@Nam int, @DoanhThu Float Output ) • Tham số hình thức nhận giá trị mặc định khi không truyền giá trị cho nó Trang 81.2 Thực hiện Stored Procedures có Tham số1.2 Thực hiện Stored Procedures ... AS Begin Declare @Dgmax float, @Dgmin float FROM MatHang SELECT * FROM MatHang WHERE DonGia = @Dgmax OR DonGia = @Dgmin ORDER BY DonGia DESC End Trang 13Print 'Thang sai' EndElse Begin Select

Ngày tải lên: 03/12/2015, 15:38

28 610 0
slide môn học MySQL bài 6 using basic functions in MySQL

slide môn học MySQL bài 6 using basic functions in MySQL

... used for joining tables  When using INNER JOIN the common field of the joining tables should have the matching value  An OUTER JOIN is used to join two tables, a source and joining table, ... syntax for obtaining the length of the string in bits is: Trang 22String Functions Using MySQL - IV LENGTH function  Returns the length of a string in bytes  The syntax for obtaining the length ... obtaining the year for a date argument is: YEAR (date) Trang 19String Functions Using MySQL - I String Functions operate on character type of data Trang 20String Functions Using MySQL - II BIN

Ngày tải lên: 30/11/2016, 22:11

30 212 0
Effects of Water Invasion to Design and Production Procedure in Fractured Basement Reservoir, SuTu Den oil Field and Prevention Solutions

Effects of Water Invasion to Design and Production Procedure in Fractured Basement Reservoir, SuTu Den oil Field and Prevention Solutions

... production well closely, optimizing production-injection design, determining and quantifying the origins of production water) to prevent and protect water invasion hence increasing oil recovery efficiency ... expansion really low and in fact in order to maintain the reservoir (above the bubble point pressure) the sea water injection method has been applied [3] From study in water injection in SD oilfield (no ... such as well observing, reservoir monitoring, formation testing, production technology diagram updating and revising, water invasion possibility, level predicting to reservoir, since then build

Ngày tải lên: 19/02/2017, 18:55

36 344 0
w