我试图通过sqlplus将大于4000字符的XML文档插入到XMLType列中。
我收到错误:
ORA-01704: string literal too long
我正在遵循以下步骤:
注册架构:
BEGIN
-- Register the schema
DBMS_XMLSCHEMA.registerSchema('http://www.example.com/fvInteger_282.xsd',
'<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="FeatureVector">
<xs:complexType>
<xs:sequence>
<xs:element name="feature" type="xs:integer" minOccurs="282" maxOccurs="282"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>',
TRUE, TRUE, FALSE);
END;
/
创建表格:
CREATE TABLE itest_xml_282 (
id NUMBER,
fv XMLTYPE)
XMLTYPE fv STORE AS OBJECT RELATIONAL
XMLSCHEMA "http://www.example.com/fvInteger_282.xsd"
ELEMENT "FeatureVector";
插入XML文档:
INSERT INTO itest_xml_282 VALUES ( 1 , '<FeatureVector><feature>-1</feature><feature>18</feature><feature>21</feature><feature>-1</feature><feature>4</feature><feature>7</feature><feature>19</feature><feature>20</feature><feature>-31</feature><feature>-16</feature><feature>17</feature><feature>-3</feature><feature>21</feature><feature>14</feature><feature>50</feature><feature>22</feature><feature>-7</feature><feature>7</feature><feature>2</feature><feature>11</feature>
<feature>-8</feature><feature>4</feature><feature>-5</feature><feature>8</feature><feature>0</feature><feature>2</feature><feature>-4</feature><feature>0</feature><feature>-13</feature><feature>5</feature><feature>-31</feature><feature>-4</feature><feature>-3</feature><feature>-3</feature><feature>-3</feature><feature>-11</feature><feature>-3</feature><feature>-3</feature><feature>-3</feature><feature>-3</feature>
<feature>-4</feature><feature>-7</feature><feature>-5</feature><feature>-2</feature><feature>-2</feature><feature>2</feature><feature>4</feature><feature>3</feature><feature>1</feature><feature>2</feature><feature>2</feature><feature>2</feature><feature>2</feature><feature>3</feature><feature>3</feature><feature>0</feature><feature>4</feature><feature>2</feature><feature>0</feature><feature>-2</feature>
<feature>8</feature><feature>-2</feature><feature>-3</feature><feature>-3</feature><feature>11</feature><feature>50</feature><feature>19</feature><feature>27</feature><feature>8</feature><feature>13</feature><feature>17</feature><feature>22</feature><feature>25</feature><feature>9</feature><feature>9</feature><feature>20</feature><feature>103</feature><feature>29</feature><feature>0</feature><feature>0</feature>
<feature>223</feature><feature>20</feature><feature>0</feature><feature>1</feature><feature>62</feature><feature>2</feature><feature>0</feature><feature>12</feature><feature>0</feature><feature>0</feature><feature>0</feature><feature>0</feature><feature>89</feature><feature>92</feature><feature>37</feature><feature>9</feature><feature>0</feature><feature>0</feature><feature>27</feature><feature>0</feature>
<feature>74</feature><feature>19</feature><feature>0</feature><feature>1</feature><feature>2</feature><feature>5</feature><feature>0</feature><feature>0</feature><feature>58</feature><feature>45</feature><feature>3</feature><feature>0</feature><feature>60</feature><feature>17</feature><feature>0</feature><feature>0</feature><feature>83</feature><feature>11</feature><feature>0</feature><feature>0</feature>
<feature>33</feature><feature>0</feature><feature>0</feature><feature>1</feature><feature>60</feature><feature>4</feature><feature>0</feature><feature>0</feature><feature>72</feature><feature>10</feature><feature>0</feature><feature>0</feature><feature>193</feature><feature>20</feature><feature>5</feature><feature>0</feature><feature>0</feature><feature>0</feature><feature>0</feature><feature>0</feature>
<feature>0</feature><feature>2</feature><feature>0</feature><feature>4</feature><feature>2</feature><feature>5</feature><feature>0</feature><feature>1</feature><feature>4</feature><feature>0</feature><feature>0</feature><feature>0</feature><feature>0</feature><feature>0</feature><feature>0</feature><feature>3</feature><feature>0</feature><feature>2</feature><feature>0</feature><feature>0</feature>
<feature>3</feature><feature>1</feature><feature>1</feature><feature>1</feature><feature>2</feature><feature>2</feature><feature>0</feature><feature>0</feature><feature>5</feature><feature>2</feature><feature>2</feature><feature>1</feature><feature>2</feature><feature>1</feature><feature>2</feature><feature>4</feature><feature>0</feature><feature>2</feature><feature>2</feature><feature>3</feature>
<feature>1</feature><feature>0</feature><feature>0</feature><feature>0</feature><feature>1</feature><feature>1</feature><feature>0</feature><feature>0</feature><feature>6</feature><feature>0</feature><feature>3</feature><feature>3</feature><feature>4</feature><feature>5</feature><feature>5</feature><feature>2</feature><feature>1</feature><feature>5</feature><feature>5</feature><feature>3</feature>
<feature>3</feature><feature>0</feature><feature>0</feature><feature>6</feature><feature>1</feature><feature>0</feature><feature>0</feature><feature>0</feature><feature>0</feature><feature>0</feature><feature>3</feature><feature>0</feature><feature>1</feature><feature>2</feature><feature>0</feature><feature>3</feature><feature>0</feature><feature>3</feature><feature>0</feature><feature>1</feature>
<feature>113</feature><feature>35</feature><feature>142</feature><feature>174</feature><feature>182</feature><feature>185</feature><feature>184</feature><feature>180</feature><feature>143</feature><feature>143</feature><feature>140</feature><feature>157</feature><feature>156</feature><feature>155</feature><feature>121</feature><feature>114</feature><feature>97</feature><feature>139</feature><feature>105</feature><feature>148</feature>
<feature>94</feature><feature>74</feature><feature>74</feature><feature>112</feature><feature>90</feature><feature>121</feature><feature>93</feature><feature>95</feature><feature>86</feature><feature>90</feature><feature>90</feature><feature>113</feature><feature>139</feature><feature>177</feature><feature>184</feature><feature>182</feature><feature>187</feature><feature>183</feature><feature>133</feature><feature>141</feature>
<feature>139</feature><feature>156</feature><feature>148</feature><feature>149</feature><feature>109</feature><feature>111</feature><feature>84</feature><feature>133</feature><feature>89</feature><feature>148</feature><feature>86</feature><feature>60</feature><feature>70</feature><feature>108</feature><feature>85</feature><feature>119</feature><feature>81</feature><feature>80</feature><feature>71</feature><feature>93</feature>
<feature>68</feature><feature>99</feature></FeatureVector>');
我该如何解决?
答案 0 :(得分:0)
你可以在pl / sql中插入带有binded变量的xml,它允许biger varchar2分配:
Click()