By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,266 Members | 1,312 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,266 IT Pros & Developers. It's quick & easy.

inserting one query before another

P: n/a
I am having trouble inserting two queries...I am trying to insert an
new item(pk) into a table in one query, and then inserting an item(fk)
in another table that relates to the other item just created in the
first. The problem is that in order for the second query to work, the
first has to exist in the first table before it will work. Is there a
way of running the first query first and then the next. Here is what I
have:

<cfquery name="q_insert" datasource="#dsn#">
INSERT INTO eccn
(eccn_num,
eccn_brief_descrip,
eccn_full_descrip,
eccn_reason_controlled)
VALUES( '1D001',
'TEST',
'TEST INPUT AND SEARCH',
'TESTING THE INPUT AND SEARCH PERFORMANCE')
</cfquery>
<cfquery name="q_insert2" datasource="#dsn#">
INSERT INTO eccN_interrelationship
(eccn_num,
related_eccn_num)
VALUES('1D001',
'1B001')
</cfquery>

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You can run both at once.

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.