Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Alter Table

Explorer ,
Dec 15, 2011 Dec 15, 2011

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.

TOPICS
Database access
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 15, 2011 Dec 15, 2011

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

Translate
Guide ,
Dec 15, 2011 Dec 15, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 15, 2011 Dec 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 15, 2011 Dec 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Dec 15, 2011 Dec 15, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 15, 2011 Dec 15, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 15, 2011 Dec 15, 2011
LATEST

Thanks a lot - that was the one I needed.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources