Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Data insertion into varbinary column

Posted on 2008-10-03
7
Medium Priority
?
2,070 Views
Last Modified: 2011-09-20
i have following table in the mysql.
create table test123 (  name varchar(30), binarynum varbinary(200)).
how to insert data into the table test123.
0
Comment
Question by:pavanark
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 5

Accepted Solution

by:
libin_v earned 2000 total points
ID: 22632005
Hi,

You I have answered your question in http://www.experts-exchange.com/Database/MySQL/Q_23777229.html

insert into test123 values ( "test", 0x2165489765464546748976465465798 );

You give the data in a Hex Format got instance "012345" in hex is 0x3031323333435 where
30 is ASCII value of 0
31 -> 1
...

So total you can insert values 00 to FF

0
 

Author Comment

by:pavanark
ID: 22632117
here you are inserting hex values.

lets say i have varchar(10)  datatype value. i want to insert  it into varbinary columns. how to do?
0
 
LVL 5

Expert Comment

by:libin_v
ID: 22632129
Give an example of data you want to insert...
0
 

Author Comment

by:pavanark
ID: 22632193
for example
'123'
'100'
0
 
LVL 5

Expert Comment

by:libin_v
ID: 22632232
values that you can print can be inserted directly....

insert into test123 values ( "test", "123" );
insert into test123 values ( "test", "100" );

Non Printable data can be inserted using HEX values
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this article, we’ll look at how to deploy ProxySQL.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question