Results 1 to 8 of 8

Thread: MYSQL mediumblob

  1. #1
    39
    posts
    Registered User

    MYSQL mediumblob

    Hi, I need some help desperately! is it possible to move a mediumblob data piece from one table in a database to another table in the same database? and if so, how do u do it? i thought it wud be simply doing a select statement first and then placing it into variables then inserting the variable into the table. but i keep gettin this:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2 X cŵ F<UuAy(@Zsyw"p|' at line 1.

    PLEASE HELP!!

  2. #2
    Code:
    /* if you already have the destination table created */
    INSERT INTO destinationTableName
    	( destColName )
    SELECT sourceColName
    FROM sourceColTable
    
    /* if the destination table isn't made yet */
    SELECT sourceColName INTO destinationTableName
    FROM sourceTableName

  3. #3
    39
    posts
    Registered User
    Thanks it worked a treat!!

  4. #4

  5. #5
    39
    posts
    Registered User
    ok so i got this working, but how do i update a specific row with this? cus it doesn't seem to like it, spewing out:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(attachment) WHERE file_name = 'Coll' SELECT file FROM temp_files WHERE file_nam' at line 1

  6. #6
    you should have an ID field which you will use to reference individual rows. i recommend making an INT auto_increment column for the ID. then it's merely:
    Code:
    UPDATE tableName
    SET colName = 'newValue'
    WHERE idColName = idValue

  7. #7
    39
    posts
    Registered User
    ok i kinda goofed up, i meant to ask, how wud u transfer the medium blob to another table as you showed before but to a specific row, say updating that specific row and placing the mediumblob into the appropriate column for that row.

  8. #8
    Code:
    UPDATE destinationTableName a, sourceTableName b
    SET a.destinationColName = b.sourceColName
    WHERE a.destinationIDColName = destinationIDColVal
    AND b.sourceIDColName = sourceIDColVal

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012