File: mysql_hex_string.xml

package info (click to toggle)
scilab-scimysql 0.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 988 kB
  • ctags: 105
  • sloc: xml: 7,315; ansic: 2,573; sql: 143; makefile: 19; sh: 6
file content (96 lines) | stat: -rw-r--r-- 3,041 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?xml version="1.0" encoding="UTF-8"?>
<refentry version="5.0-subset Scilab" xml:id="mysql_hex_string" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:db="http://docbook.org/ns/docbook">
  <refnamediv>
    <refname>mysql_hex_string</refname>

    <refpurpose>This function is used to create a legal SQL string that you can use in an SQL statement.</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <title>Calling Sequence</title>

    <synopsis>to = mysql_hex_string(from, from_len)</synopsis>
  </refsynopsisdiv>

  <refsection>
    <title>Description</title>

    <para>This function is used to create a legal SQL string that you can use in an SQL statement.</para>
    <para>The string in from is encoded to hexadecimal format, 
      with each character encoded as two hexadecimal digits.</para>
    <para>The result is placed in to and a terminating null byte is appended.</para>
    <para>When <literal>mysql_hex_string</literal> returns, 
      the contents of to is a null-terminated string.</para>
    <para>The return value is the length of the encoded string, not including the terminating null character.</para>
    <para>The return value can be placed into an SQL statement using either
      0xvalue or X'value' format. However, the return value does not
      include the 0x or X'...'. The caller must supply whichever of those is desired. </para>
  </refsection>

  <refsection>
    <title>Parameters</title>

    <variablelist>
      <varlistentry>
        <term>from</term>

        <listitem>
          <para>the string to be encoded</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>from_len</term>

        <listitem>
          <para>the length of the <literal>from</literal> string</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>to</term>

        <listitem>
          <para>the encoded string</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>

  <refsection>
    <title>Examples</title>

    <programlisting role="example"><![CDATA[ 
end = "INSERT INTO test_table values(";
end = end + '0x';
end = end + mysql_hex_string(end,'What is this',12);
end = end + ',0x';
end = end + mysql_hex_string(end,'binary data: \0\r\n',16);
end = end + ')';
 ]]></programlisting>
  </refsection>

  <refsection>
    <title>See Also</title>

    <simplelist type="inline">
      <member><link linkend="mysql_init">mysql_init</link></member>
      <member><link linkend="mysql_real_connect">mysql_real_connect</link></member>
      <member><link linkend="mysql_close">mysql_close</link></member>
    </simplelist>
  </refsection>

  <refsection>
    <title>Authors</title>

    <simplelist type="vert">
      <member>Yann COLLETTE</member>
    </simplelist>
  </refsection>
</refentry>