| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

09-03-04, 18:10
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 494
|
|
|
Any code for automatically inserting queries of first table into the second?
|
|
Any code for automatically inserting queries of first table into the second?
Is there a way of inserting the query of records from the first table into the second? Because I want to use the second db by deleting records that might be unnecessary.
I want to copy the searches of one table to another. Let's say I search a keyword I want the search to go through the first table and copy the records where the keyword is to be found to the second table. I find that would be easy to study. Whatever I don't want from that search I can easily delete it. And at the same time I have the original table not tampered.
|
|

09-03-04, 18:54
|
|
Registered User
|
|
Join Date: Sep 2004
Posts: 16
|
|
could u just
INSERT INTO Table2 (field1)
SELECT * FROM Table1;
i believe u can just use the INSERT cmd
|
|

09-03-04, 19:46
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 494
|
|
|
ok...
|
|
Is it before or after (I'd guess it's before) the
HTML Code:
<%rs.Open SQL%>
statement?
|
|

09-17-04, 19:07
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 494
|
|
|
execute problem
What does this mean?
Quote:
INSERT INTO results(id, book, book_spoke, recordType, book_title, chap, chapter, chapter_spoke, vers, verse, verse_spoke, text_data) VALUES (, , , '', '', , , , , , , '')
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'execute'
/kjvresp.asp, line 280
|
|
|

09-17-04, 21:21
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
|
|
the problem is here: VALUES (, , , '', '', , , , , , , '')
you have to put something for each column
at worst, you could use nulls (assuming the table allows nulls)
VALUES (null, null, null, '', '', null, null, null, null, null, null, '')
|
|

09-17-04, 21:34
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 494
|
|
|
That was because...
I had put && around each fieldname. But I made some changes. But this is what I got now:
Quote:
INSERT INTO results SELECT * FROM bible WHERE text_data LIKE '%ezra%' AND text_data LIKE '%%' AND text_data LIKE '%%'
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.
/kjvresp.asp, line 272
|
The insertion was found in the table but the output to the ASP page is somehow blocked.
|
|

09-17-04, 21:47
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
|
|
text_data LIKE '%%' is true for every row and should be dropped
if you have an ASP problem, you should post in the ASP forum
this forum is for generic (non-proprietary) SQL
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|