Board index » delphi » FETCH

FETCH


2003-09-14 12:46:03 AM
delphi8
Does anybody knows how to implement a FETCH in a TIBQuery ? (NOT FETCHALL!)
I want to perform "SELECT * FROM XXX" in my program and every time when my
user
scrolls in DBGRID my program FETCHS the next records.
Thanks
 
 

Re:FETCH

Hi
Would you please show me how to use FETCH in C++ builder? i mean a simple
example...
Thanks
 

Re:FETCH

"Cenk" <XXXX@XXXXX.COM>writes:
Quote
Hi Would you please show me how to use FETCH in C++ builder? i mean
a simple example...
What is FETCH? What does it have to do with C++?
--
Chris (TeamB);
 

Re:FETCH

Declaring cursor and using FETCH in this cursor!!!
"Chris Uzdavinis (TeamB)" <XXXX@XXXXX.COM>, haber iletisinde sunlari
yazdi:XXXX@XXXXX.COM...
Quote
"Cenk" <XXXX@XXXXX.COM>writes:

>Hi Would you please show me how to use FETCH in C++ builder? i mean
>a simple example...

What is FETCH? What does it have to do with C++?

--
Chris (TeamB);
 

Re:FETCH

"Cenk" <XXXX@XXXXX.COM>writes:
Quote
>>Hi Would you please show me how to use FETCH in C++ builder? i mean
>>a simple example...
>
>What is FETCH? What does it have to do with C++?
>
Declaring cursor and using FETCH in this cursor!!!
You still haven't explained what you mean when you write "FETCH".
 

Re:FETCH

FETCH
Retrieves a specific row from a Transact-SQL server cursor.
Syntax
FETCH
[ [ NEXT | PRIOR | FIRST | LAST
| ABSOLUTE { n | @nvar }
| RELATIVE { n | @nvar }
]
FROM
]
{ { [ GLOBAL ] cursor_name } | @cursor_variable_name }
[ INTO @variable_name [ ,...n ] ]
Arguments
NEXT
Returns the result row immediately following the current row, and increments
the current row to the row returned. If FETCH NEXT is the first fetch
against a cursor, it returns the first row in the result set. NEXT is the
default cursor fetch option.
PRIOR
Returns the result row immediately preceding the current row, and decrements
the current row to the row returned. If FETCH PRIOR is the first fetch
against a cursor, no row is returned and the cursor is left positioned
before the first row.
FIRST
Returns the first row in the cursor and makes it the current row.
LAST
Returns the last row in the cursor and makes it the current row.
ABSOLUTE {n | @nvar}
If n or @nvar is positive, returns the row n rows from the front of the
cursor and makes the returned row the new current row. If n or @nvar is
negative, returns the row n rows before the end of the cursor and makes the
returned row the new current row. If n or @nvar is 0, no rows are returned.
n must be an integer constant and @nvar must be smallint, tinyint, or int.
RELATIVE {n | @nvar}
If n or @nvar is positive, returns the row n rows beyond the current row and
makes the returned row the new current row. If n or @nvar is negative,
returns the row n rows prior to the current row and makes the returned row
the new current row. If n or @nvar is 0, returns the current row. If FETCH
RELATIVE is specified with n or @nvar set to negative numbers or 0 on the
first fetch done against a cursor, no rows are returned. n must be an
integer constant and @nvar must be smallint, tinyint, or int.
GLOBAL
Specifies that cursor_name refers to a global cursor.
cursor_name
Is the name of the open cursor from which the fetch should be made. If both
a global and a local cursor exist with cursor_name as their name,
cursor_name to the global cursor if GLOBAL is specified and to the local
cursor if GLOBAL is not specified.
@cursor_variable_name
Is the name of a cursor variable referencing the open cursor from which the
fetch should be made.
INTO @variable_name[,...n]
Allows data from the columns of a fetch to be placed into local variables.
Each variable in the list, from left to right, is associated with the
corresponding column in the cursor result set. The data type of each
variable must either match or be a supported implicit conversion of the data
type of the corresponding result set column. The number of variables must
match the number of columns in the cursor select list.
Remarks
If the SCROLL option is not specified in an SQL-92 style DECLARE CURSOR
statement, NEXT is the only FETCH option supported. If SCROLL is specified
in an SQL-92 style DECLARE CURSOR, all FETCH options are supported.
When the Transact_SQL DECLARE cursor extensions are used, these rules apply:
a.. If either FORWARD-ONLY or FAST_FORWARD is specified, NEXT is the only
FETCH option supported.
b.. If DYNAMIC, FORWARD_ONLY or FAST_FORWARD are not specified, and one of
KEYSET, STATIC, or SCROLL are specified, all FETCH options are supported.
c.. DYNAMIC SCROLL cursors support all the FETCH options except ABSOLUTE.
The @@FETCH_STATUS function reports the status of the last FETCH statement.
The same information is recorded in the fetch_status column in the cursor
returned by sp_describe_cursor. This status information should be used to
determine the validity of the data returned by a FETCH statement prior to
attempting any operation against that data. For more information, see
@@FETCH_STATUS.
Permissions
FETCH permissions default to any valid user.
"Thomas Maeder [TeamB]" <XXXX@XXXXX.COM>, haber iletisinde sunlari
yazdi:XXXX@XXXXX.COM...
Quote
"Cenk" <XXXX@XXXXX.COM>writes:

>>>Hi Would you please show me how to use FETCH in C++ builder? i mean
>>>a simple example...
>>
>>What is FETCH? What does it have to do with C++?
>>
>Declaring cursor and using FETCH in this cursor!!!

You still haven't explained what you mean when you write "FETCH".
 

Re:FETCH

Since C++ Builder is a C++ language compiler, both of Mr Uzedavinis and Mr
Maeder answered you in the context of the C++ language.
If you want to ask about databases, perhaps posting in one of the groups
where people discuss them might be more productive. The groups here are:
borland.public.cppbuilder.ado
borland.public.cppbuilder.dbexpress
borland.public.cppbuilder.desktop
borland.public.cppbuilder.interbaseexpress
borland.public.cppbuilder.multi-tier
borland.public.cppbuilder.sqlservers
. Ed
Quote
Cenk writes
news:XXXX@XXXXX.COM...

FETCH
Retrieves a specific row from a Transact-SQL server cursor.
...