Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert syntax to MySql 1

Status
Not open for further replies.

MarcDePoe

Programmer
Dec 19, 2000
101
0
0
US
I need to create a table and now we're using MySql as opposed to Microsoft Access.
The following code used to work fine, but now I can't seem to get the syntax ok for MySql.
Code:
<CFQUERY DATASOURCE=&quot;#listdatasource#&quot;>
	CREATE TABLE #Url.JobId#
	(id Counter,email varchar,SectionNumber integer,CONSTRAINT pk_constraint PRIMARY KEY (id))
</cfquery>
<CFQUERY DATASOURCE=&quot;#listdatasource#&quot;>
	CREATE INDEX table_index ON #Url.JobId# (email)
</cfquery>
Error message says that syntax is bad. Can anyone help?
 
Try:
CREATE TABLE #url.JobId#
(id INTEGER PRIMARY KEY AUTO_INCREMENT, email VARCHAR(30) NOT NULL , SectionNumber INTEGER, INDEX(email))


This should do it all in one query....

Hope this helps,

Brommrrrr
 
Actually that should read INDEX table_index (email) if you want to give your index a name.

Sorry 'bout that
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top