Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2101
  • Last Modified:

Data insertion into varbinary column

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
pavanark
Asked:
pavanark
  • 3
  • 2
1 Solution
 
libin_vCommented:
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
 
pavanarkAuthor Commented:
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
 
libin_vCommented:
Give an example of data you want to insert...
0
 
pavanarkAuthor Commented:
for example
'123'
'100'
0
 
libin_vCommented:
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now