📄 isam0001.tst
字号:
#### Update the data of the current record##updatedata deta1# pblIsamUpdateData( deta1, 6 )# datalen 6#### Update the data of the current record##updatedata data1# pblIsamUpdateData( data1, 6 )# datalen 6#### Update index 0001key0 of the current record##updatekey 0 key1# pblIsamUpdateKey( 0, key1, 4 )# rc 0#### Update index 0001key0 of the current record##updatekey 0 key11# pblIsamUpdateKey( 0, key11, 5 )# rc 0#### Update index 0001key0 of the current record##updatekey 0 key1# pblIsamUpdateKey( 0, key1, 4 )# rc 0#### Update index 0001key0 of the current record##updatekey 0 key1# pblIsamUpdateKey( 0, key1, 4 )# rc 0#### Read alphabetically last record according to index 0001key0## this sets the current record##get 0 LAST# pblIsamGet( 5, 0 )# keylen 5, key long4#### Read alphabetically first record according to index 0001key0## this sets the current record##get 0 FIRST# pblIsamGet( 4, 0 )# keylen 4, key key1#### Update the value of the index 0001dup1, allowing duplicates##updatekey 1 key# pblIsamUpdateKey( 1, key, 3 )# rc 0#### Update the value of the index 0001dup1, allowing duplicates##updatekey 1 key1# pblIsamUpdateKey( 1, key1, 4 )# rc 0#### Update the value of the index 0001dup1, allowing duplicates##updatekey 1 key# pblIsamUpdateKey( 1, key, 3 )# rc 0#### Update the value of the index 0001dup1, allowing duplicates##updatekey 1 key# pblIsamUpdateKey( 1, key, 3 )# rc 0#### Read alphabetically last record according to index 0001key0## this sets the current record##get 0 LAST# pblIsamGet( 5, 0 )# keylen 5, key long4#### Read alphabetically first record according to index 0001key0## this sets the current record##get 0 FIRST# pblIsamGet( 4, 0 )# keylen 4, key key1#### Start a transaction##transaction START# pblIsamStartTransaction( )# rc 0#### Insert some records##insert ,key3,key,key1e data1# pblIsamInsert( 1, ,key3,key,key1e, 15, data1, 6 )# rc 0insert ,key4,keya,key1d data1# pblIsamInsert( 1, ,key4,keya,key1d, 16, data1, 6 )# rc 0insert ,key5,keya,key1c data1# pblIsamInsert( 1, ,key5,keya,key1c, 16, data1, 6 )# rc 0insert ,key6,keya,key1b data1# pblIsamInsert( 1, ,key6,keya,key1b, 16, data1, 6 )# rc 0insert ,key7,keya,key1a data1# pblIsamInsert( 1, ,key7,keya,key1a, 16, data1, 6 )# rc 0insert ,key8,keya,key10 data1# pblIsamInsert( 1, ,key8,keya,key10, 16, data1, 6 )# rc 0insert ,key9,key,key19 data1# pblIsamInsert( 1, ,key9,key,key19, 15, data1, 6 )# rc 0insert ,keya,key,key18 data1# pblIsamInsert( 1, ,keya,key,key18, 15, data1, 6 )# rc 0insert ,keyb,key,key17 data1# pblIsamInsert( 1, ,keyb,key,key17, 15, data1, 6 )# rc 0#### Read alphabetically last record according to index 0001key0## this sets the current record##get 0 LAST# pblIsamGet( 5, 0 )# keylen 5, key long4#### Read alphabetically first record according to index 0001key0## this sets the current record##get 0 FIRST# pblIsamGet( 4, 0 )# keylen 4, key key1#### Read the alphabetically next couple of records according to index 0001key0##get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key2get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key3get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key4get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key5get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key6get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key7get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key8get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key9get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key keya#### Rollback the transaction, the inserts that happened## after the transaction started are NOT committed##transaction ROLLBACK# pblIsamCommit( ROLLBACK )# rc 1, pbl_errno 0, errno 0#### Read alphabetically last record according to index 0001key0## this sets the current record##get 0 LAST# pblIsamGet( 5, 0 )# keylen 5, key long4#### Read alphabetically first record according to index 0001key0## this sets the current record##get 0 FIRST# pblIsamGet( 4, 0 )# keylen 4, key key1#### Read the alphabetically next couple of records according to index 0001key0##get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key2get 0 NEXT# pblIsamGet( 2, 0 )# keylen 5, key long1get 0 NEXT# pblIsamGet( 2, 0 )# keylen 5, key long2#### Start another transaction##transaction START# pblIsamStartTransaction( )# rc 0#### Repeat the inserts done during the last transaction##insert ,key3,key,key1e data1# pblIsamInsert( 1, ,key3,key,key1e, 15, data1, 6 )# rc 0insert ,key4,keya,key1d data1# pblIsamInsert( 1, ,key4,keya,key1d, 16, data1, 6 )# rc 0insert ,key5,keya,key1c data1# pblIsamInsert( 1, ,key5,keya,key1c, 16, data1, 6 )# rc 0insert ,key6,keya,key1b data1# pblIsamInsert( 1, ,key6,keya,key1b, 16, data1, 6 )# rc 0insert ,key7,keya,key1a data1# pblIsamInsert( 1, ,key7,keya,key1a, 16, data1, 6 )# rc 0insert ,key8,keya,key10 data1# pblIsamInsert( 1, ,key8,keya,key10, 16, data1, 6 )# rc 0insert ,key9,key,key19 data1# pblIsamInsert( 1, ,key9,key,key19, 15, data1, 6 )# rc 0insert ,keya,key,key18 data1# pblIsamInsert( 1, ,keya,key,key18, 15, data1, 6 )# rc 0insert ,keyb,key,key17 data1# pblIsamInsert( 1, ,keyb,key,key17, 15, data1, 6 )# rc 0#### Read alphabetically last record according to index 0001key0## this sets the current record##get 0 LAST# pblIsamGet( 5, 0 )# keylen 5, key long4#### Read alphabetically first record according to index 0001key0## this sets the current record##get 0 FIRST# pblIsamGet( 4, 0 )# keylen 4, key key1#### Read the alphabetically next couple of records according to index 0001key0##get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key2get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key3get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key4#### Commit the transacttion, make the inserts permanent##transaction COMMIT# pblIsamCommit( COMMIT )# rc 0#### Read alphabetically last record according to index 0001key0## this sets the current record##get 0 LAST# pblIsamGet( 5, 0 )# keylen 5, key long4#### Read alphabetically first record according to index 0001key0## this sets the current record##get 0 FIRST# pblIsamGet( 4, 0 )# keylen 4, key key1#### Read the alphabetically next couple of records according to index 0001key0##get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key2get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key3get 0 NEXT# pblIsamGet( 2, 0 )# keylen 4, key key4#### Read alphabetically last record according to index 0001key0## this sets the current record##get 0 LAST# pblIsamGet( 5, 0 )# keylen 5, key long4#### Read the data of the current record##readdata# pblIsamReadData( currentrecord )# datalen 1276, data 4data1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891#### Read alphabetically previous record according to index 0001key0## this sets the current record##get 0 PREV# pblIsamGet( 3, 0 )# keylen 5, key long3#### Read the value of the index 0001dup1 of the current record##get 1 THIS# pblIsamGet( 1, 1 )# keylen 3, key key#### Find a record who's index 0001dup1 value is the biggest value## that is alphabetically lower than 'keya'##find 1 keya LT# pblIsamFind( LT, keya, 4 )# keylen 3, key key#### Read the value of the index 0001key0 of the current record##get 0 THIS# pblIsamGet( 1, 0 )# keylen 4, key keyb#### Find a record who's index 0001dup1 value is alphabetically equal to 'keya'## or who's index 0001dup1 value is the biggest value that is alphabetically## lower than 'keya'##find 1 keya LE# pblIsamFind( LE, keya, 4 )# keylen 4, key keya
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -