• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to upload an audio file into MySql using SQL command

 
utsav gupta
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have an audio file which I want to insert into a database using plain sql command. How do I do that?
I know its not a good idea to do that but the audio files are very small (hardly few kbs)
I understand that the files have to be converted into a binary stream and inserted in the form of BLOB but how do i do that is there an inbuilt function in MySQL to convert the file into BLOB?
I cannot use java or any other programming language just sql and windows batch commands.

Please reply.

Thanks
Utsav.
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A simple search ...

INSERT INTO blob_tabl (some_col) values(load_file('/path/to/file'));

WP
 
utsav gupta
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wow!

I wonder how did i miss that in google!

Thank You William!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic