Solved

create temporary table... insert...

Posted on 2003-12-11
2
1,129 Views
Last Modified: 2008-02-01
Im trying to create a temporary table as a select statement, then sequentially insert stuff as one prepared statement..

CREATE TEMPORARY TABLE AAAA as (SELECT.....); INSERT INTO AAAA ....;

but it wont get past the first ";"

If I run the first statement alone it works fine..
0
Comment
Question by:illucid
2 Comments
 

Expert Comment

by:johnbisounours
Comment Utility
you simply can not

your front-end language (ADO etc) for sure doesn't allow for multiple statements

you can just do this in sequence, as "prepared statements" have no sense in MySql and Oracle if the cache stuff is working properly (MySql 4+)

CREATE TEMPORARY TABLE AAAA SELECT * FROM .... WHERE ...;
INSERT INTO AAAA VALUES(...);
INSERT INTO AAAA VALUES(...);
INSERT INTO AAAA VALUES(...);
0
 
LVL 4

Accepted Solution

by:
ElectroNitz earned 125 total points
Comment Utility
You can build a single INSERT to insert multiple records, but you will have to send the CREATE and INSERT separately.

INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)

http://www.mysql.com/doc/en/INSERT.html
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now