惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
H
Help Net Security
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
量子位
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
AI
AI
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
U
Unit 42
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
博客园 - Franky
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
N
News | PayPal Newsroom
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网

博客园 - Dream

将Windows桌面扩展到第二个显示器/投影机上 绿茶一杯辨蜂蜜 Microsoft太小气了,Wallop的帐号竟然被取消了。 Google.com 竟然会出现"502 Server Error",导致不能使用! - Dream IIS 6.0配置HTTP壓縮的步驟 [轉載] 使用 ClearType 获得更佳的屏幕分辨率 关于Mozilla Firefox的使用感受! 可扩展商业报告语言XBRL DoNews的Blog又进不去了。 Google旗下的好東西 Introduction to Indigo Google Desktop Search - Very good 如何透过ISA来使用Skype? WinDirStat - Directory Statistics 提醒:近来MSN病毒泛滥,大家小心了。 用.NET开发MSN聊天机器人 (转) HP M2000 AntiSpyware Beta Overview Gmail vs. Sogou
HOWTO: RDO: Use ODBC Escape Clauses in Your SQL Syntax (zt)
Dream · 2005-01-18 · via 博客园 - Dream

An ODBC escape clause is a way to talk to the ODBC driver you are using in a DBMS independent manner. The escape clause is represented by a pair of curly braces ({}) surrounding the standard form of the SQL syntax and a one- character or two-character token that specifies the type of the escape clause.

For example, if you want to specify a date value and you don't know which ODBC driver you will be using, you can use the Escape clause in this construct, {d 'yyyy-mm-dd'} and it will be translated by the ODBC driver manager into the form the backend can utilize. The following select statement will work with any ODBC driver: "SELECT * FROM table1 WHERE datefield = {d '1995-09-12'}" There are also other areas where you can use ODBC escape clauses:


Date and Time

   Date      {d 'yyyy-mm-dd'}
   Time      {t 'hh:mm:ss'}
   Timestamp   {ts 'yyyy-mm-dd hh:mm:ss[.f...]'}
    

where [.f...] allows you to specify fractions of a second if you wish.


Stored Procedures

For stored procedures a parameter marker (?) must be used for the return value (if any) and any output arguments because it is bound to a program variable. Input arguments can be either literals or parameters, for example, "{? = call procedure_name(arg1, arg2, ?)}" or "{call procedure_name(arg1, arg2, ?)}".


String Functions

ASCII(), CHAR(), CONCAT(), DIFFERENCE(), INSERT(), LCASE(), LEFT(), LENGTH(), LOCATE(), LTRIM(), REPEAT(), REPLACE(), RIGHT(), RTRIM(), SOUNDEX(), SPACE(), SUBSTRING() and UCASE().

This example will retrieve a resultset where the first three characters of author field is 'dat' from the Pubs database. "Select * from authors where {fn LEFT(author, 3)} = 'dat'".

This example will retrieve a resultset with the author field all in uppercase letters. It is necessary to alias the column with the phrase "as AUTHORS" because the RDC control doesn't know what you are asking for in an escape clause so if you do not alias the column, the RDC control will refer to is as "Expr1000". MSRDC1.SQL = "Select {fn UCASE(author)} as AUTHORS from authors"


Math Functions

ABS(), ACOS(), ASIN(), ATAN(), ATAN2(), CEILING(), COS(), COT(), DEGREES(), EXP(), FLOOR(), LOG(), LOG10(), MOD(), PI(), POWER(), RADIANS(), RAND(), ROUND(), SIGN(), SIN(), SQRT(), TAN() and TRUNCATE().


System Functions

DATABASE(), IFNULL() and USER().

This example returns all the orders entered by the current user: "Select ordnum From orders Where employee = {fn User()}".

Time and Date Functions

CURDATE(), CURTIME(), DAYNAME(), DAYOFMONTH(), DAYOFWEEK(), DAYOFYEAR(), HOUR(), MINUTE(), MONTH(), MONTHNAME(), NOW(), QUARTER(), SECOND() and TIMESTAMPADD()


Data Type Conversion Functions

The data type conversion function converts a data type to a different data type on the server. This example shows the simple conversion of a date column to a character string. It also shows how powerful the use of scalar functions in expressions can be. In this case, the query returns all orders made in the 1990s "Select ordnum From orders Where {fn convert(orddate, SQL_CHAR)} like '199%'".

For complete documentation see the "Microsoft ODBC 2.0 Programmer's Reference and SDK Guide."