Re: Copying Binary data from one table to another

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Actually, you've still lost me.
This is one of the few situations where I can recommend dynamic sql (but
only if you use parameters for user inputs - in other words don't ask the
user for a list of column names via a textbox - have him select them from a
listbox which uses column index as the value submitted, and use the
sebmitted index values to get the column names from an array in your
server-side code).
So you need col1 and col 3:

sql = "insert into table (col1,col3) select col1,col3 from othertable"
cn.execute sql,,129

If you need col 2, col3,col4 ... well, hopefully, you get the idea.

Or, if you need to update existing rows, use similar logic to build your
update statements. I'm not sure of the syntax used in MySQL to update a
table with values retrieved from another table, but you should be able to
find it in the documentation.

If you insist on using an inefficient cursor, you may need to look into
using AppendChunk. Look it up in the ADO documentation:
http://msdn2.microsoft.com/en-us/library/ms675532.aspx

And, as Evertjian says: the error is a vbscript error, not an ADO error. You
need to narrow down which statement in your code is actually throwing that
error.

normanp wrote:
Hi Bob,

Thanks. Unfortunately there is no other way for me to do this. I
have to select then insert. Because sometimes i may need a few
columns and sometime others. Its hard for me to put it in words. But
I think you'll understand.

By why will binary stuff not work?

Norman


"Bob Barrows [MVP]" wrote:

normanp wrote:
Hi,

I have these tables with binary data stored in tinyblobs and blobs
in MySql. In my application I sometimes need to copy them to another
table. Not all the data, maybe just a column or two. So I first
select the data into a record set and then loop and insert it (its
the only way can do it)

I've never worked with mysql, but this statement would make me
absolutely reject it as a database-of-choice if I was ever
considering it. Are you sure this is the only way? Can't you do a
simple "INSERT INTO tablename (<column list>) SELECT <column list>
FROM othertable" in MySQL?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so
I don't check it very often. If you must reply off-line, then remove
the "NO SPAM"

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages

  • Re: Copying Binary data from one table to another
    ... I'm not sure of the syntax used in MySQL to update a ... Please reply to the newsgroup. ... This email account is my spam trap so I ...
    (microsoft.public.inetserver.asp.db)
  • Re: Subscript out of range: 3 Need Help
    ... > I am not having to much luck in the DB's query tool. ... You may need to find a MySQL newsgroup or forum to find out the proper ... This email account is my spam trap so I ...
    (microsoft.public.inetserver.asp.general)
  • Re: Problem retrieving results from database
    ... If you execute both of these statements, the first row never gets echo'd. ... and then copying and pasting the query into the mysql commandline client and checking what the actual result is. ... is a spam trap. ...
    (comp.lang.php)
  • Centos+ on FC3
    ... CentosPlus to upgrade FC3? ... The primary objective is MySQL 5. ... server is currently running FC3 with PHP, MySQL and HTTPD out of FC4. ... Do NOT Send Email to <spam trap> Fedora@TQMcube,com ...
    (Fedora)
  • Re: How to save user inputs?
    ... with saving data that user inputs in text fields. ... If the user inputs some data in text fields and i save it in array, ... Then learn to persist data in a file or data base (JDB, MySQL). ...
    (comp.lang.java.help)