Skip to content

Instantly share code, notes, and snippets.

@Ke-
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save Ke-/78553fef97e0ac3f9364 to your computer and use it in GitHub Desktop.

Select an option

Save Ke-/78553fef97e0ac3f9364 to your computer and use it in GitHub Desktop.
Byte example
local(data) = bytes('Hello')
my_ds->sql("
DROP TABLE IF EXISTS bytes_example;
CREATE TABLE bytes_example (
`data` binary(16) NOT NULL
);
INSERT INTO bytes_example(data) VALUES (X'" +#data->encodehex + "');
// or
// INSERT INTO bytes_example(data) VALUES (0x" +#data->encodehex + ");
")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment