亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fastdb.htm

?? 用于嵌入式環境的數據庫
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
REGISTER(Contract);
</PRE>

The table (and correspondent class) can be used only with one database 
at each moment of time. When you open a database, FastDB imports into
the database all classes defined in the application.
If a class with the same name already exists 
in the database, its descriptor stored in the database is compared with the
descriptor of this class in the application. If the class definitions
differ, FastDB tries to convert records from the table to the new 
format. Any kind of conversion between numeric types (integer to
real, real to integer, with extension or truncation) is allowed. Also,
addition of new fields can be easily handled. But removal of fields
is only possible for empty tables (to avoid accidental data destruction).<P>

After loading all class descriptors, FastDB checks if all indices specified 
in the application class descriptor are already present in the database, 
constructs new indices and
removes indices, which are no more used. Reformatting the table and 
adding/removing indices is only possible when no more than one
application accesses the database. So when the first application is attached
to the database, it can perform table conversion. All other applications
can only add new classes to the database.<P>

There is one special internal database  <code>Metatable</code>, which
contains information about other tables in the database. C++ programmers
need not access this table, because the format of database tables is specified
by C++ classes. But in an interactive SQL program, it may be necessary to
examine this table to get information about record fields.<P>

Starting from version 2.30 FastDB supports autoincrement fields
(fields unique value to which are assigned automaticaly by database).
To be able to use them you should:<P>

<OL>
<LI>Recompile FastDB and your application with <code>-DAUTOINCREMENT_SUPPROT</code> flags 
(add this flag to <code>DEFS</code> variables in FastDB makefile).<BR>
<B>Attention</B>: database files created by FastDB compiled without this option will be incompatible 
with FastDB compiled with <code>DAUTOINCREMENT_SUPPORT</code>.

<LI>If you want to use other than 0 initial counter value, you should
asssign value to <code>dbTableDescriptor::initialAutoincrementCount</code>.
It will be shared between all tables, so all table will have the same initial value of 
autoincrement counter.

<LI>Autoincrement fields should be of int4 type and should be declared
with <code>AUTOINCREMENT</code> flag:

<PRE>
        class Record {
             int4 rid;
             char const* name;
             ...
       
             TYPE_DESCRIPTOR((KEY(rid, AUTOINCREMENT|INDEXED), FIELD(name), ...));
       }
</PRE>       
       
<LI>When record with autoincrement field is inserted in the database
there is no need to specify value of autoincremented field (it will be
ignored). After successful insertion of record this field will be
assigned unique value (which is guaranteed to be not used before this
table):

<PRE>
       Record rec;
       // no rec.rid should be specified
       rec.name = "John Smith";
       insert(rec);
       // rec.rid now assigned unique value
       int newRecordId  = rec.rid; // and can be used to reference this record
</PRE>

<LI>When record is removed the value will not be reused.
When transaction is aborted, table autoincrement counter is also rolled back.
</OL><P>


<H3><A NAME = "query">Query</A></H3>
The class query is used to serve two purposes: 

<OL>
<LI>to construct a query and bind query parameters
<LI>to cache compiled queries
</OL>

FastDB provides overloaded '<code>=</code>' and '<code>,</code>' C++ operators
to construct query statements with parameters. Parameters can be specified  
directly in places where they are used, eliminating any mapping between
parameter placeholders and C variables. In the following sample query,
pointers to the parameters <code>price</code> and <code>quantity</code> 
are stored in the query, so that the query can be executed several times
with different parameter values. C++ overloaded functions make it possible
to automatically determine the type of the parameter, 
requiring no extra information
to be supplied by the programmer (such reducing the possibility of a bug). 

<PRE>
        dbQuery q;
        int price, quantity;
        q = "price >=",price,"or quantity >=",quantity;
</PRE> 

Since the  <code>char*</code> type can be used both for specifying a fraction
of a query (such as "price >=") and for a parameter of string type,
FastDB uses a special rule to resolve this ambiguity. This rule is based on the
assumption that there is no reason for splitting a query text into two strings
like ("price ",">=") or specifying more than one parameter sequentially
("color=",color,color). So FastDB assumes the first string to be a fraction
of the query text and switches to <I>operand mode</I>
after it. In <I>operand mode</I>, FastDB treats the <code>char*</code> argument
as a query parameter and switches back to query <I>text mode</I>, and so on...
It is also possible not to use this "syntax sugar" and construct
query elements explicitly by the 
<code>dbQuery::append(dbQueryElement::ElementType type, void const* ptr)</code>
method. Before appending elements to the query,
it is necessary to reset the query by the <code>dbQuery::reset()</code> method
('<code>operator=</code>' does it automatically).<P>

It is not possible to use C++ numeric constants as query parameters, because
parameters are accessed by reference. But it is possible to use string
constants, because strings are passed by value. There two possible ways of 
specifying string parameters in a query: using a string buffer or a
pointer to pointer to string:<P>

<PRE>
     dbQuery q;
     char* type;
     char name[256];
     q = "name=",name,"and type=",&type;

     scanf("%s", name);
     type = "A";     
     cursor.select(q);
     ...
     scanf("%s", name);
     type = "B";     
     cursor.select(q);
     ...
</PRE><P>


Query variables can neither be passed to a function as a parameter
nor be assigned to another variable.
When FastDB compiles the query, it saves the compiled tree in this object. 
The next time the query will be used, 
no compilation is needed and the already compiled
tree can be used. It saves some time needed for query compilation.<P>

FastDB provides two approaches to integrate user-defined types in databases.
The first - the definition of class methods - was already mentioned. 
The other approach deals only with query construction. Programmers should
define methods, which will not do actual calculations, but instead
return an expression (in terms of predefined database types), which
performs the necessary calculation. It is better to describe it by example.
FastDB has no builtin datetime type. Instead of this, a normal C++
class <code>dbDateTime</code> can be used by the programmer. This class defines
methods allowing to specify datetime fields in ordered lists and
to compare two dates using normal relational operators:<P>

<PRE>
class dbDateTime { 
    int4 stamp;
  public:
    ...
    dbQueryExpression operator == (char const* field) { 
	dbQueryExpression expr;
	expr = dbComponent(field,"stamp"),"=",stamp;
	return expr;
    }
    dbQueryExpression operator != (char const* field) { 
	dbQueryExpression expr;
	expr = dbComponent(field,"stamp"),"<>",stamp;
	return expr;
    }
    dbQueryExpression operator &lt; (char const* field) { 
	dbQueryExpression expr;
	expr = dbComponent(field,"stamp"),">",stamp;
	return expr;
    }
    dbQueryExpression operator &lt;= (char const* field) { 
	dbQueryExpression expr;
	expr = dbComponent(field,"stamp"),">=",stamp;
	return expr;
    }
    dbQueryExpression operator &gt; (char const* field) { 
	dbQueryExpression expr;
	expr = dbComponent(field,"stamp"),"<",stamp;
	return expr;
    }
    dbQueryExpression operator &gt;= (char const* field) { 
	dbQueryExpression expr;
	expr = dbComponent(field,"stamp"),"<=",stamp;
	return expr;
    }
    friend dbQueryExpression between(char const* field, dbDateTime& from,
				     dbDateTime& till)
    { 
	dbQueryExpression expr;
	expr=dbComponent(field,"stamp"),"between",from.stamp,"and",till.stamp;
	return expr;
    }

    friend dbQueryExpression ascent(char const* field) { 
	dbQueryExpression expr;
	expr=dbComponent(field,"stamp");
	return expr;
    }	
    friend dbQueryExpression descent(char const* field) { 
	dbQueryExpression expr;
	expr=dbComponent(field,"stamp"),"desc";
	return expr;
    }	
};
</PRE>

All these methods receive as their parameter a name of a field in the record.
This name is used to contract the full name of the record's component.
This  can be done by class <code>dbComponent</code>, which constructor takes
the name of the structure field and the name of the component of the structure
and returns a compound name separated by a '.' symbol.
The class <code>dbQueryExpression</code> is used to collect expression items.
The expression is automatically enclosed in parentheses, eliminating conflicts
with operator precedence.<P>

So, assuming a record containing a field <code>delivery</code>
of dbDateTime type, it is possible
to construct queries like these:

<PRE>
        dbDateTime from, till;
        q1 = between("delivery", from, till),"order by",ascent("delivery");
        q2 = till &gt;= "delivery"; 
</PRE>

In addition to these methods, some class specific method can be defined
in such way, for example the method <code>overlaps</code> for a region type.
The benefit of this approach is that a database engine will work
with predefined types and is able to apply indices and other optimizations
to proceed such query. And from the other side, the encapsulation of the class
implementation is preserved, so programmers should not rewrite all queries
when a class representation is changed.<P>

Variables of the following C++ types can be used as query parameters:<P>

<TABLE BORDER ALIGN="center">
<TR><TD WIDTH=50%>int1</TD><TD WIDTH=50%>bool</TD></TR>
<TR><TD>int2</TD><TD>char const*</TD></TR>
<TR><TD>int4</TD><TD>char **</TD></TR>
<TR><TD>int8</TD><TD>char const**</TD></TR>
<TR><TD>real4</TD><TD>dbReference&lt;T&gt;</TD></TR>
<TR><TD>real8</TD><TD>dbArray&lt; dbReference&lt;T&gt; &gt;</TD></TR>
</TABLE><P>



<H3><A NAME = "cursor">Cursor</A></H3>
Cursors are used to access records returned by a select statement. 
FastDB provides typed cursors, i.e. cursors associated with concrete tables.
There are two kinds of cursors in FastDB: readonly cursors and cursors for 
update. Cursors in FastDB are represented by the  C++ template class 
<code>dbCursor&lt;T&gt;</code>, 
where <code>T</code> is the name of a C++ class associated with
the database table. The cursor type should be specified in the constructor
of the cursor. By default, a read-only cursor is created.
To create a cursor for update, you should pass a parameter 
<code>dbCursorForUpdate</code> to the constructor.<P>

A query is executed either by the cursor
<code>select(dbQuery& q)</code> method.
Or by the <code>select()</code> method, 
which can be used to iterate through
all records in the table. Both methods return the number of selected records
and set the current position to the first record (if available).
A cursor can be scrolled in forward or backward direction.
The methods <code>next(), prev(), first(), last()</code> can be used to 
change the current position of the cursor. 
If no operation can be performed as there are no (more) records
available, these methods return <code>NULL</code>
and the cursor position is not changed.<P>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丁香激情综合五月| 精品久久五月天| 精品日韩欧美在线| 亚洲精品成a人| 国产精选一区二区三区| 欧美在线短视频| 国产精品不卡一区| 国产在线精品一区二区不卡了| 色香蕉成人二区免费| 国产欧美精品一区二区色综合朱莉| 亚洲一区二区三区四区在线| 成人夜色视频网站在线观看| 精品精品国产高清一毛片一天堂| 亚洲国产欧美另类丝袜| 99国产精品视频免费观看| 国产女主播一区| 韩国精品久久久| 精品99久久久久久| 麻豆久久久久久久| 日韩一级精品视频在线观看| 天天射综合影视| 精品视频123区在线观看| 一区二区免费视频| 欧美亚洲尤物久久| 亚洲夂夂婷婷色拍ww47 | 色婷婷亚洲综合| 国产精品剧情在线亚洲| 国产在线国偷精品免费看| 欧美成人video| 激情综合网av| 久久久www成人免费无遮挡大片 | 成人国产精品免费观看动漫| 久久精品一区二区三区四区| 国产精品一区在线| 国产精品免费av| 91网站在线播放| 亚洲香蕉伊在人在线观| 欧美性受极品xxxx喷水| 丝袜美腿亚洲综合| 91精品在线观看入口| 午夜精品在线看| 欧美一级日韩一级| 精品亚洲欧美一区| 亚洲欧洲三级电影| 欧美性大战xxxxx久久久| 日韩国产在线一| 欧美va日韩va| 波波电影院一区二区三区| 日韩毛片在线免费观看| 欧美日韩视频在线一区二区| 免费成人性网站| 国产日产欧美一区| 91日韩精品一区| 偷拍与自拍一区| 精品欧美乱码久久久久久1区2区 | 欧美成人a∨高清免费观看| 久久精品国产99| 国产精品无人区| 欧美视频一区在线| 久久国产免费看| 中文字幕永久在线不卡| 在线播放国产精品二区一二区四区 | 天天色天天爱天天射综合| 精品理论电影在线| 一本到高清视频免费精品| 视频一区国产视频| 日本一区二区三区久久久久久久久不 | 国内精品在线播放| 国产精品美女一区二区三区| 欧美综合亚洲图片综合区| 狠狠色丁香久久婷婷综| 亚洲精品久久嫩草网站秘色| 日韩一区二区三区视频| www.日韩在线| 美国十次综合导航| 亚洲精品成人a在线观看| 久久午夜国产精品| 在线成人高清不卡| 91丨九色丨蝌蚪丨老版| 国产一区二区三区| 视频一区在线视频| 亚洲色图在线看| 国产婷婷色一区二区三区在线| 欧美日韩在线播| 99精品国产视频| 国产成人精品免费看| 日韩和的一区二区| 亚洲精品欧美激情| 中文字幕中文在线不卡住| 久久久综合九色合综国产精品| 欧美日韩国产色站一区二区三区| 不卡视频一二三四| 国产福利精品导航| 国产专区欧美精品| 久久99精品视频| 欧美aaa在线| 日本在线不卡视频一二三区| 亚洲一区二区三区免费视频| 国产精品成人一区二区艾草| 国产日韩在线不卡| 国产视频一区在线观看| 欧美精品一区二区三区在线播放 | 2024国产精品视频| 欧美三级日韩三级| 欧美亚洲综合在线| 欧美网站大全在线观看| 欧美自拍丝袜亚洲| 在线观看亚洲成人| 欧美午夜在线观看| 欧美三级电影在线观看| 欧美午夜精品一区| 91成人在线观看喷潮| 91国偷自产一区二区开放时间 | 国产老肥熟一区二区三区| 久久精品噜噜噜成人88aⅴ| 免费成人性网站| 精品中文字幕一区二区小辣椒| 久久99精品久久久久久| 国内不卡的二区三区中文字幕| 国产精品一区在线观看乱码| 国产91丝袜在线18| 99久久久精品| 欧美图片一区二区三区| 欧美日韩国产综合一区二区| 在线电影院国产精品| 精品sm捆绑视频| 国产精品乱子久久久久| 亚洲美女少妇撒尿| 婷婷国产v国产偷v亚洲高清| 精品一区二区三区在线观看国产| 狠狠色狠狠色合久久伊人| 懂色av中文字幕一区二区三区| 91丨九色丨尤物| 欧美久久久久久蜜桃| 欧美精品一区二区在线播放| 国产精品亲子伦对白| 一区二区三区精品久久久| 秋霞午夜av一区二区三区| 国产毛片精品视频| 91精品91久久久中77777| 69av一区二区三区| 欧美激情一区不卡| 午夜一区二区三区视频| 国产精品一区三区| 欧洲一区二区三区免费视频| 精品日韩99亚洲| 亚洲精品免费视频| 经典一区二区三区| 色综合亚洲欧洲| 久久亚洲精品小早川怜子| 亚洲精品日日夜夜| 国产又黄又大久久| 欧美午夜寂寞影院| 国产网站一区二区三区| 婷婷久久综合九色综合绿巨人| 国产乱理伦片在线观看夜一区| 色噜噜狠狠成人中文综合| 精品国产sm最大网站| 亚洲精品大片www| 国产一区二区三区黄视频 | 欧美三级蜜桃2在线观看| 久久久久久久网| 午夜精品免费在线| 成人午夜免费电影| 欧美电视剧在线观看完整版| 亚洲精品菠萝久久久久久久| 国产久卡久卡久卡久卡视频精品| 欧美性大战久久| 亚洲色图欧美激情| 成人小视频免费观看| 2023国产一二三区日本精品2022| 一区二区中文字幕在线| 精品一区二区三区久久| 欧美日韩大陆一区二区| 亚洲精品免费在线播放| 国产成a人亚洲| 欧美精品一区二区三区蜜桃 | 成人综合在线视频| 欧美mv日韩mv| 免费在线看一区| 91精品国产综合久久久蜜臀粉嫩 | 亚洲欧美激情插 | 亚洲狠狠丁香婷婷综合久久久| 国产一区福利在线| 日韩三级高清在线| 午夜激情久久久| 欧美人妖巨大在线| 亚洲mv在线观看| 精品视频在线免费看| 亚洲综合男人的天堂| 91免费版pro下载短视频| 日本一区二区动态图| 国产成人在线影院| 国产精品污网站| 成人黄色大片在线观看| 中文字幕精品三区| www.亚洲人| 亚洲靠逼com| 欧美日韩三级一区| 水野朝阳av一区二区三区|