When I created the database table, I included only a field to store the photos using app scripts
and imported an photo file((jpg file) to a bucket. However, I encountered a problem trying to
import the image file to a table. The table field in the database is of the mediumblob data type.
The character set as defined in the sql import instruction is of utf8 type. Is this a problem when
importing into database table? The image file is not in a csv file. Is it supposed to be included in a
csv file? If it is supposed to be included in a csv file, how do I reference the image file in the csv file?
I was also trying to import image file using the app scripts function by using the following:
var instanceUrl = 'jdbc:mysql://' + address;
var dbUrl = instanceUrl + '/' + db;
var conn = Jdbc.getConnection(dbUrl, user, userpwd);
conn.createStatement().execute("UPDATE companylogo SET logo = LOAD DATA LOCAL INFILE(gs://imagedb/code_logo.png)");
// or using conn.createStatement().execute("LOAD DATA LOCAL INFILE 'gs://imagedb/code_logo.png' INTO TABLE companylogo CHARACTER SET utf8");
Should I use a different character set like hex blob or varbinary?
However, I am getting a syntax error when trying to use either of the two statements.What is the correct syntax for the statements?
Oracle isn't too explanatory. Are other methods of importing an image file to the database?
Thanks very much
Kevin