Skip to main content
Inspiring
December 15, 2011
Answered

Alter Table

  • December 15, 2011
  • 2 replies
  • 1891 views

Hi everybody,

I would like to alter a table within a Coldfusion application. Can I do that with cfscript ? If, does anybody know how I can do that ?

Thanks.

This topic has been closed for replies.
Correct answer Adam Cameron.

Is there a cfscript equivalent for the CFQUERY Tag ?

Yup: Query.cfc:

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSe9cbe5cf462523a0693d5dae123bcd28f6d-7ffb.html

--

Adam

2 replies

Community Expert
December 15, 2011

If you want to alter a database table, you can use CFQUERY to run that, just like you use it to run standard SQL DML (SELECT, INSERT, UPDATE, DELETE) commands. That kind of SQL command is called DDL.

That said, you generally don't want to run DDL commands from applications for both security and common-sense reasons, and your database login will need a higher level of privilege to do this than it would to run DML commands.

Dave Watts, CTO, Fig Leaf Software

Dave Watts, Eidolon LLC
crikosAuthor
Inspiring
December 15, 2011

THank you very much for your answers,

what I want to do is to build an Air Application for maintaining my Tables in a Mysql system. If you know Ruby on Rails, there you have a Feature called "Migrations" - that's what I want to do with that application. It is not planned as a "normal" application, it should make it easier to keep the different versions between the development and production Environment up to date.

Is there a cfscript equivalent for the CFQUERY Tag ?

Regards

Owainnorth
Inspiring
December 15, 2011

There is in ColdFusion 9, yes.As long as you have permissions, it's just the same as running any other query.

Owainnorth
Inspiring
December 15, 2011

What kind of table? A database table? Why would you want to do that through ColdFusion?