2
Copyright (C) 1997-2007 MySQL AB
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of version 2 of the GNU General Public License as
6
published by the Free Software Foundation.
8
There are special exceptions to the terms and conditions of the GPL
9
as it is applied to this software. View the full text of the exception
10
in file LICENSE.exceptions in the top-level directory of this software
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
18
You should have received a copy of the GNU General Public License
19
along with this program; if not, write to the Free Software
20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
/** Test SQL_POSITION */
32
if (!driver_supports_setpos(hdbc))
35
SQLExecDirect(hstmt,(SQLCHAR *)"drop table t_chunk",SQL_NTS);
37
rc = SQLExecDirect(hstmt,(SQLCHAR *)"create table t_chunk(id int not null primary key, description varchar(50), txt text)",SQL_NTS);
40
rc = SQLExecDirect(hstmt,(SQLCHAR *)"INSERT INTO t_chunk VALUES(1,'venu','Developer, MySQL AB')",SQL_NTS);
43
rc = SQLExecDirect(hstmt,(SQLCHAR *)"INSERT INTO t_chunk VALUES(2,'monty','Michael Monty Widenius - main MySQL developer')",SQL_NTS);
46
rc = SQLExecDirect(hstmt,(SQLCHAR *)"INSERT INTO t_chunk VALUES(3,'mysql','MySQL AB- Speed, Power and Precision')",SQL_NTS);
49
SQLFreeStmt(hstmt,SQL_CLOSE);
51
rc = SQLExecDirect(hstmt,(SQLCHAR *)"SELECT * from t_chunk",SQL_NTS);
54
rc = SQLFetchScroll(hstmt, SQL_FETCH_NEXT, 1);
57
rc = SQLSetPos(hstmt, 1, SQL_POSITION, SQL_LOCK_NO_CHANGE);
60
rc = SQLGetData(hstmt, 2, SQL_C_CHAR, txt, 100, &len);
62
printMessage("\ntxt:%s(%d)",txt,len);
64
SQLFreeStmt(hstmt,SQL_RESET_PARAMS);
65
SQLFreeStmt(hstmt,SQL_UNBIND);
66
SQLFreeStmt(hstmt,SQL_CLOSE);