ESQL: Data Type of the specified SQL, esqlsql Data Type
When using an SQL statement, you must specify the data type required by the current SQL statement.For example, the expression used in the above example@{Sys: date: datetime}. We have extended the syntax.
Start character |
Schoolbag name |
Delimiter |
Keywords |
Delimiter |
Type |
Terminator |
@{ |
Id |
: |
Key |
: |
Type |
} |
WebEasy supports almost all data types in JDBC2.0 and combines the same or similar types to simplify developers' writing. The following table lists the specified methods for all data types:
Type |
Expression |
Description |
String |
@{Id: key: string} |
String type |
Memo |
@{Id: key: memo} |
Text types in complex formats (such as HTML) |
Int |
@{Id: key: int} |
Integer |
Long |
@{Id: key: long} |
Long Integer |
Float |
@{Id: key: float} |
Floating Point Type |
Double |
@{Id: key: double} |
Double Precision type |
Boolean |
@{Id: key: boolean} |
Boolean |
Numeric |
@{Id: key: numeric} |
Number Type |
Date |
@{Id: key: date} |
Date type |
Time |
@{Id: key: time} |
Time Type |
Datetime |
@{Id: key: datetime} |
Datetime type |
Timestamp |
@{Id: key: timestamp} |
Timestamp type (accurate to milliseconds) |
Binary |
@{Id: key: binary} |
Binary |
Link |
@{Id: key: link} |
Link Type |
The example of the specified data type has already appeared multiple times in the previous document.
OrLight B2C e-commerce websites(Blog_add_save.chtml under the site \ blog directory)
Insert
<ESql module=base act=edit commit=true>Insert Into favorite_base(we_id,title,words,content,words_content)Values(@{doc:we_id:int},@{pPage:title:string},@{pPage:words:string},@{pPage:content:memo},@{pPage:words_content:memo})</ESql>
The reason for doing so is very simple. When you want to insert text in complicated formats (such as HMTL) to the database, it can easily avoid conflicts between special symbols and SQL reserved words (such as greater than, less than, and single double quotation marks) and ensure normal insertion.
Try it yourself
Download and description of light platform Resources
Platform free download: http://download.csdn.net/detail/tx18/8381859
Latest Development Manual download: http://download.csdn.net/detail/tx18/8411089
Development Instance:Light B2C e-commerce websites, Free download: http://download.csdn.net/detail/tx18/8318585
The light-Open Platform will occasionally upgrade to provide more powerful and Easy functions for you. Please pay attention to the latestDevelopment Manual