FangerZero
FangerZero

Reputation: 101

For a ColdFusion cfqueryparam which CFSQLType do you use for TEXT?

So if I have a cfqueryparam, and the datatype in SQL is TEXT, which of the CFSQLTypes do I use? Or do I follow the below link about uniqueidentifiers? Or is it just better to change the datatype to varchar/longvarchar?

Upvotes: 5

Views: 4908

Answers (2)

Leigh
Leigh

Reputation: 28873

text is a deprecated data type used for storing very large strings (up to 2,147,483,647 bytes). As it says in the documentation, the correct cfsqltype for text columns is cf_sql_longvarchar.

uniqueidentifier is a completely different data type. It is used to store small uuid values (36 characters only). So that type does not apply here.

Upvotes: 4

Lance
Lance

Reputation: 3213

I have used longvarchar in both cfqueryparam and procparams with good success

<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#myLongText#">

Upvotes: 7

Related Questions