DBcursor->c_put |
|
#include <db.h>int DBcursor->c_put(DBC *DBcursor, DBT *key, DBT *data, u_int32_t flags);
The DBcursor->c_put method stores key/data pairs into the database.
Unless otherwise specified, the DBcursor->c_put method returns a non-zero error value on failure and 0 on success.
If DBcursor->c_put fails for any reason, the state of the cursor will be unchanged. If DBcursor->c_put succeeds and an item is inserted into the database, the cursor is always positioned to refer to the newly inserted item.
(Btree and Hash의 경우,커서가 참조하고 있는 키의 duplicate 요소로서 데이타아이템을 삽입한다.새로운 요소는 현재 커서포지션 바로 직후에 나타난다.데이타아이템의 duplicate를 지원하지 않게 설정된 Btree 또는 Hash에서 DB_AFTER 를 사용하는 것은 에러다. 키인자는 무시된다.)
In the case of the Recno access method, it is an error to specify DB_AFTER if the underlying Recno database was not created with the DB_RENUMBER flag. If the DB_RENUMBER flag was specified, a new key is created, all records after the inserted item are automatically renumbered, and the key of the new record is returned in the structure to which the key parameter refers. The initial value of the key parameter is ignored. See DB->open for more information.
(Recno에서,DB_RENUMBER플래그로 설정되지 않고 DB_AFTER 를 사용하는 것은 에러다.만약 DB_RENUMBER가 설정되었다면 새로운 키는 생성되고 삽입된 레코드 후의 모든 레코드는 자동으로 재넘버링된다.그리고 새로운 레코드의 키는 key 파라미터가 참조하고 있는 구조체에 리턴된다.초기 key파라미터는 무시된다.)
The DB_AFTER flag may not be specified to the Queue access method.
(DB_AFTER 는 큐에 설정되지 않아야 한다.)
The DBcursor->c_put method will return DB_NOTFOUND if the current cursor record has already been deleted and the underlying access method is Hash.
In the case of the Recno access method, it is an error to specify DB_BEFORE if the underlying Recno database was not created with the DB_RENUMBER flag. If the DB_RENUMBER flag was specified, a new key is created, the current record and all records after it are automatically renumbered, and the key of the new record is returned in the structure to which the key parameter refers. The initial value of the key parameter is ignored. See DB->open for more information.
The DB_BEFORE flag may not be specified to the Queue access method.
The DBcursor->c_put method will return DB_NOTFOUND if the current cursor record has already been deleted and the underlying access method is Hash.
지정된 data아이템을 가르키는 커서위치에 key/data pair의 data로 덥어쓰여진다.
The DBcursor->c_put method will return DB_NOTFOUND if the current cursor record has already been deleted and the underlying access method is Hash.
만약에 현재 커서 레코드가 이미 지워졌거나 Hash access method일 경우 DBcursor-c_put메소드는 DB_NOTFOUND를 리턴할 것이다.
If the underlying database supports duplicate data items, and if the key already exists in the database and a duplicate sort function has been specified, the inserted data item is added in its sorted location. If the key already exists in the database and no duplicate sort function has been specified, the inserted data item is added as the first of the data items for that key.
만약 database가 duplicate data를 지원하고 key가 이미 database에 존재하고 duplicate sort 함수가 지정되었다면 삽입된 data 아이템은 그것의 정렬된 위치에 추가된다. 만약 key가 이미 database에 존재하고 duplicate sort 함수가 지정되지 않았다면 삽입된 data 아이템은 그 키를 위한 첫번째 data아이템으로서 추가된다.
The DB_KEYFIRST flag may not be specified to the Queue or Recno access methods.
If the underlying database supports duplicate data items, and if the key already exists in the database and a duplicate sort function has been specified, the inserted data item is added in its sorted location. If the key already exists in the database, and no duplicate sort function has been specified, the inserted data item is added as the last of the data items for that key.
The DB_KEYLAST flag may not be specified to the Queue or Recno access methods.
Btree와 Hash access method의 경우, 만약 key/data쌍이 이미 database상에 존재하는 것과 같지 않다면 지정된 key/data쌍은 database에 삽입된다. 만약 key와 data싸이 database상에 존재한다면 DB_KEYEXIST가 리턴된다. DB_NODUPDATA플래그는 오직 정렬된 duplicate data items이 지원되는 환경을 갖는 database에만 허락된다.
The DB_NODUPDATA flag may not be specified to the Queue or Recno access methods.
The DBcursor->c_put method may fail and return one of the following non-zero errors:
![]()
|
Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.