开发者

Determine if text returned in MYSQL query is the default text

开发者 https://www.devze.com 2023-02-18 05:56 出处:网络
Is there a way to easily determine if the text being returned by a query is the default text put in place when the database was created?

Is there a way to easily determine if the text being returned by a query is the default text put in place when the database was created?

For example, the db I'm working with has several text fields that, when the db was set up, are pre-populated with greek ('lorem ipsum...'). But, each field is a little different in the amount of greek and what greek is used in the default. Without knowing the precise greek that is used in each field as the default, is there a 开发者_运维问答way to have the query 'tell' me that it's the default text?


You can use <cfdbinfo /> to get this information. You would use it as follows:

<cfdbinfo type="columns" name="qResult" table="tableName" datasource="dsnName" />
<cfdump var="#qResult#" />

In my tests, this returns a query with a "column_default_value" column that you can use to determine if the result is the default value or not.

You can find more info about cfdbinfo here

0

精彩评论

暂无评论...
验证码 换一张
取 消