CFScript to create tables (using MySQL) and configure it to use InnoDB

I use a cfscript to create my database and the tables using MySQL, and I was able to DO this with success, accept that I'm having a problem. I want to put my tables use InnoDB instead of MyISAM. How to do this?

That's what I did:

< cfquery = 'test' datasource name = 'mydatasource' >
CREATE TABLE Test
(
Id int (11) NOT NULL auto_increment,
Name varchar (20) default NULL,
Tinyint (4) active default NULL,
PRIMARY KEY (Id)
); ENGINE = InnoDB DEFAULT CHARSET = latin;
< / cfquery >

But when I get an error when I run this script. That's what I get:

-You have an error in your SQL syntax; "check the manual for your version of the MySQL server for the right syntax to use near '; ENGINE = InnoDB DEFAULT CHARSET = latin1'.

I look and it's the right syntax. Any ideas what I am doing wrong?

Thanks for any help

Alfie

Nevermind, I figured it. I misspelled it.

ENGINE type = InnoDB... must be before the semicolon.

:)

Tags: ColdFusion

Similar Questions

  • creating table using joins in the subquery

    can we create a table using joins in the subquery?
    Like this
    create table emp in select * from employee e, Department d
    where d.department_id = e.department_id
    ??
    We can?

    987018 wrote:
    We can?

    Yes, as long as you column alias names common to both tables to make them unique.

    SY.

  • Creating Tables using the piped cmdlets

    Hi all

    Sorry to do this, but I'm in a hurry nature. I know that I need to read the manual and I intend to do very soon!

    I'm currently building a table or create an output that displays the name of the virtual machine and the NetworkName. I don't know how make the output show both. I implemented the command below, but it only displays the NetworkName. I tried various things, but I can't get the two items will appear...

    Can someone help me? Thank you!!!

    Get-Cluster DEV | Get - VM | Get-NetworkAdapter | Select-Object - property "NetworkName".

    Try something like this

    Get-Cluster DEV | Get-VM |
    Select Name, @{N="NIC";E={$_ | Get-NetworkAdapter | %{$_.NetworkName}}}
    

    If you have more than 1 NETWORK adapter on a virtual machine, you can do

    Get-Cluster DEV | Get-VM |
    Select Name, @{N="NIC";E={[string]::Join(',',($_ | Get-NetworkAdapter | %{$_.NetworkName}))}}
    
  • Creating Tables with a Script

    I am trying to create tables using a script, but it seems that the consecutive statements in the script will not run - someone ' one can tell me what I need to use the syntax?

    ****************************************************************************
    Here is my script - I use SQL-Plus:

    CREATE TABLE parts
    (region_id NUMBER
    NOT NULL CONSTRAINT Region_id_nn
    , region_name VARCHAR2 (25)
    )

    CREATE TABLE countries
    (country_id TANK (2)
    NOT NULL CONSTRAINT Country_id_nn
    , country_name VARCHAR2 (40)
    region_id NUMBER
    CONSTRAINT Country_c_id_pk
    PRIMARY KEY (country_id)
    )
    INDEX OF THE ORGANIZATION

    Here's what I touch in:

    SQL > get c:\oracle\test.txt

    Here is the error that comes out:

    1 parts of CREATE TABLE
    2 (region_id NUMBER
    3 region_id_nn of CONSTRAINT NOT NULL
    4, region_name VARCHAR2 (25)
    5)
    6 countries in CREATE TABLE
    7 (country_id TANK (2)
    8 country_id_nn of CONSTRAINT NOT NULL
    9, country_name VARCHAR2 (40)
    10, region_id NUMBER
    11, CONSTRAINT country_c_id_pk
    12 PRIMARY KEY (country_id)
    13)
    14 * ORGANIZATION INDEX
    15 run;
    CREATE TABLE countries
    *
    ERROR on line 6:
    ORA-00922: missing or not valid option
    ****************************************************************************
    If trim down the script - just 1 create table command, none of the semicolons, this works:

    Script:

    CREATE TABLE parts
    (region_id NUMBER
    NOT NULL CONSTRAINT Region_id_nn
    , region_name VARCHAR2 (25)
    )

    Key in:
    SQL > get c:\oracle\test.txt
    1 parts of CREATE TABLE
    2 (region_id NUMBER
    3 region_id_nn of CONSTRAINT NOT NULL
    4, region_name VARCHAR2 (25)
    5 *)
    SQL > execute;

    Receive:

    1 parts of CREATE TABLE
    2 (region_id NUMBER
    3 region_id_nn of CONSTRAINT NOT NULL
    4, region_name VARCHAR2 (25)
    5 *)

    Table created.
    ****************************************************************************
    adding a semicolon between the instructions in create table does not solve this problem - anyone got any ideas?

    Thank you

    -Tom

    Please see this for more information on the GET sqlplus command.

    http://download.Oracle.com/docs/CD/A97630_01/server.920/a90842/ch13.htm#1009882

    Get command Loads a host operating system file into the SQL buffer.
    
    *The operating system file should contain a single SQL statement or PL/SQL block*.
    The statement should not be terminated with a semicolon. If a SQL*Plus command or
    more than one SQL statement or PL/SQL block is loaded into the SQL buffer from an
    operating system file, an error occurs when the RUN or slash (/) command is used to
    execute the buffer.
    

    I hope it is clear now. So if you want to run a script that may contain more then one of SQL statements, create a file * .sql, put all the instructions, complete with a semicolon and run as follows:

    SQL > @script_name.sql

  • Substitution of the class, how to create the child class and then the base class

    I started to write a program for a DMM smart, that the problem is all versions of DMM greet the change company communication.

    My idea is to write a child class for each version, DMM and each Subvi child will replace the Subvi base class.

    My problem is, I first want to create a child class and after I see everything is working, start creating the base class. in this way, I'll see if think the right way.

    My question is

    How can I create a child class and then create the base class and configure the Subvi class of the child to be the substitution of the base class?

    I tried searching in the property of the class, but I don't see anything.

    Thank you

    This can be done and I did on occasion.

    You create the base class with the methods of dynamic distribution, you need (Connector components must be identical to those of the class of the child).

    Set then the legacy of the class inherits this base class.  If your method is defined as a dynamic distribution method in the parent, you will probably now have some errors (unless your method of child was already DD, in which case you might be OK already).

    To change the inheritance of a class, right-click on the properties of the class in your project, and then select Properties.  According to me, the tree of estate is at the lower end of the property.  Click on the 'legacy of change' (or something similar) to choose the class from which you now want to inherit.

  • create table on the production database

    Hi expert I want some knowledge in real time
    If a user has requested to create a table on the production database where DBA one should contact 1.
    form where dba approval for create table.


    Thanks and greetings
    Sanat

    It depends on your hierarchy of society. Generally, your immediate boss.

  • How to insert image from mysql into the table using php and create the checkbox in the table?

    How can I insert image from mysql into the table using php and create the checkbox for each data as a vote? Here is my code...

    WELCOME

    connect_error) {die ("connection failed:".)} $conn-> connect_error); } $sql = "SELECT no, Calon, ID, of course, the Image OF THE candidates." $result = $conn-> Query; If ($resultat-> num_rows > 0) {echo ' '; export data of each line while ($row = $result-> fetch_assoc()) {"echo"}}
    NO Candidate INFO Vote
    " . $row ["no"]. "-" . $row ["Calon"]. "
    -" . $row ['ID']. "
    -" . $row ['class']. "
    "; } ECHO ' ' ;} else {echo '0 results' ;} $conn-> close();?} >

    hope someone can help me because I am a newbie in this program... need to finish this project... Thank you.

    If you have saved the file name in the database, it's pretty simple.

    echo '' . $row['description'] . '';
    

    Is the same for the box:

    echo '';
    

    If you have saved the image file in the database, it is much more complicated. I recommend you store only the file name in the database.

  • Creating table and use - part 1

    be no difficulty with arrays in C, etc. but creating tables of LabVIEW poisoned me. Unfortunately, the heart I sure table labs start out with a table already in place is not much help either. For example, in the attachment, I have a simple loop generating a series of figures that I want to put in a picture. I place a table on the block diagram and its type sucks and I can't find a good way to change it. The textbook says to drag an object in the table on the front panel. So, how is - a hang out an integer in an array?

    Thank you

    JVH

    jvh75021 wrote:
    Thanks for the post. Where did you get the constant that you drag in the table?

    I'll try to help in this form:

    Darren wrote:

    If you know the name of the object you want, you don't have to look at all the pallets.

    Amazing that NEITHER use YouTube for video hosting, because it is blocked by the firewall of our company.

    Andrey.

  • Please how can I use a value in a table of the adf in an actionListener to a button I created in a popup and thanks

    Please how can I use a value in a table of the adf in an actionListener to a button I created in a popup and thanks

    What is your version of JDev?

    Actually your question is not clear to me, but as I understand, it is you the table in the page and you have popup inside this popup you have the button you need when you click on the button to read the value of the selected table row. In the listener action button, so if you can get the current row of the table and after that you can get any attribute of the line as:

    DCIteratorBinding iter = (DCIteratorBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("TableIteratorName"); // from pageDef.
    Row r = iter.getCurrentRow();
    Object value1 = r.getAttribute("attribute1");
    Object value2 = r.getAttribute("attribute2");
    
  • How can I create a new database without table using database configuration

    How can I create a new database without table using database configuration

    You can search for your "DBA 2 days" version oracle documentation for your version.  You should also read the manual of the concepts.  Create your own schema is pretty basic, all you have to do is to create a user.  Don't use dba or system for your own objects.

  • Hello! can any1 pls let me know how to create a look up table in labview and use it in the vi.


    If the lookup table will always stay the same (for example, a character generator or something similar), you can put the values into a constant matrix 2D on your diagram, with the input as a column, the equivalent in the other value. When you need to search you use an array of index to return all values in the "input" column, search for it using 'search in table 1 d' and the index number that results allows you to index the data in the other column. If the values may change, so it is probably better to load a table control with your equivalent values from a file.

    S...

  • drop and re-create the table using dynamic sql

    The following procedure should drop the table and re-create it. Currently, I get the dbms_output of the query. If I run the query only, it works well. but through the procedure, it does not work. Please help me

    PROCEdure emp_backup is
    sql_txt varchar2(10000);
    begin
         begin
         EXECUTE IMMEDIATE 'drop table emp_backup ' ;
         exception
         when others then
         null;
    
         sql_txt:= 'CREATE TABLE emp_backup as ' ||
                     'select * from emp  '||
                     'where dep_no=10 ' ;
         dbms_output.put_line(sql_txt);
         EXECUTE IMMEDIATE sql_txt;
    Exception
    when others then
    Null;
    
    End;

    Daniel wrote:
    I'm getting following error ORA-01031: insufficient privileges

    What is the command to grant privileges to this

    GRANT CREATE TABLE TO <>
    

    Detaching Frank, however, and echoing my previous comment, let them down and to re-create the tables makes no sense. It is logical to truncate a table if you test a load. If you build a data warehouse, it makes sense to delete and re-create a partition if you rerun a load for a particular date and that you have daily partitions. Deletion and recreation of a table in a stored procedure is not a reasonable way to test a system (nor is there a reasonable way to approach change control issues that will inevitably produce when you need to change the structure of a table).

    Justin

  • CREATE TABLE to another OWNER/SCHEMA and in a different TABLESPACE?

    I am connected to a user of the SYSTEM. Now, I want to create a table of aaa. The owner of this table should not be SYSTEM but user KARL. and STORAGE space should not be SYSTEM but the tdtc TABLESPACE (existing).

    As far as I know I can do this by running the following command:

    CREATE TABLE KARL.aaa (an INTEGER,...) Tttt TABLESPACE;

    Regarding the TABLESPACE parameter, I'm not sure. Is it possible to return a user Karl TABLE in a TABLESPACE that is not assigned to him?

    In addition, I have another problem.
    I have a script with hundreds of CREATE TABLE, ALTER TABLE + CREATE INDEX DDL statements.
    Each of them are not prefixed with schema/owner and a TABLESPACE clause.

    I can put a single statement at the top of the script somehow that such Oracle
    to use
    -Karl OWNER as a schema/owner for all DDL stements
    -Thomas TABLESPACE as TABLESPACE for all DOF stements
    ?

    In MYsql, there is a statement «use < database >» Is soemthing similar to Oracle?

    Thank you
    Peter

    Yes... you can do. For example, a user who has a secret password that you do not want to give... as a schema of the application. User B needs to make paintings/objects in A schema and you want to follow this as user B. First configure Oracles Fine grain auditing and then grant "connect via" user A to user B as follows:
    -----

    SQL> create user b identified by abc123
      2    quota unlimited on users;
    
    User created.
    SQL> grant create session to b;
    
    SQL> create user a identified by abc123
      2    quota unlimited on users;
    
    User created.
    
    SQL> grant create table
      2      , create session
      3     to a;
    
    Grant succeeded.
    
    SQL> alter user a grant connect through b;
    
    User altered.
    
    SQL> connect b[a]/abc123@a486
    Connected.
    
    SQL> show user
    USER is "A"
    SQL> create table a.my_proxy_table
      2  ( c1 number
      3  , c2 varchar2(50)
      4  , c3 date
      5  );
    
    Table created.
    

    -----
    See I have connected using the syntax "username [proxyuser]." Also note that user B is by proxy user has, as evidenced by my order 'show user '. The connection through can be granted/revoked as needed without disclosing A goes to B. In addition, your audit tables or xml logs will follow the fact that user B created the table a.my_proxy_table.

    Hope this helps,
    John

  • create aggregation tables using job Manager windows client linux server BI

    Hi people,

    I have OBIEE 10.1.3.4.1 running on a Linux server.
    I'm trying to run the script in overall table created via the wizard by using the Task Manager.

    Task Manager requires a DSN to run on. But saw that the job scheduler runs on the Linux machine so there is no DSN point to?

    My question is:

    I need to install and configure a scheduler on a windows environment to launch task manager to run the NQCmd script to the aggregation tables?
    or
    Can I get the linux box to have his own NAME or see the windows one somehow?

    If you have information or advice that would be really untangle me.

    Thank you.

    You don't need to change anything, just use AnalyticsWeb in your nqcmd call, and it should work.

  • How replot a table using plotXY without creating a new parcel?

    I want to replot continually a table using plotXY without increment the name of the parcel. Is this possible?

    Whenever I call plotXY a new path is created. For example, the first time that plotXY is run, I get a marked route Plot1 (parcel number 1). The second time I call plotXY, I get a parcel named Plot2 (parcel number 2) and so on. But I want to draw the same picture several times that I've added more data to it. And I want the name of the parcel to be Plot1 every time.

    I know that I can change the name 'Plot1' attribute after the call to plotXY. But I feel that somewhere in the internal parts of the graph I'm ever increasing utilization of certain resources. I'll be Replot the table several hundred thousand times so I don't want to run out of memory or something.

    So my question is this, is it possible to re - initialize a graph to its original state before you run the plotXY?

    Do not confuse the name of the parcel and manage the resources allocated to the curve. If you delete all the plots in the graph with DeleteGraphPlot () then draw a new curve, you should have 'Track 1' under the name of the plot, but you will get a continuously raise the handle of the plot; This does not assume that you are summarizing additional resources whenever you draw on the graph, the graph simply never reuses draw handles associated with deleted locations.

    In your case, you can also try a different approach:

    1. Use a graph of the band instead of the chart: if possible you will avoid the problem of more names of conspiracy and will reduce the program activity that you will draw only new points in every race
    2. Only new field points with PlotXY showing only the first parcel in the legend: you will need to keep track of array index, already mapped out so that if you have traced up to array [index] to date, you will draw array [index] to array [newindex] on the new iteration

Maybe you are looking for