Creating the Text Table
Perform the following steps to create and load documents into a table.
-
Connect as the new user.
Before creating any tables, assume the identity of the user that you created.
CONNECT myuser; -
Create your text table.
The following example creates a table called
docswith two columns,idandtext, by using theCREATETABLEstatement. This example makes theidcolumn the primary key. Thetextcolumn isVARCHAR2.CREATE TABLE docs (id NUMBER PRIMARY KEY, text VARCHAR2(200));
Note: Primary keys of the following type are supported: NUMBER, VARCHAR2, DATE, CHAR, VARCHAR, and RAW.
-
Load documents into the table.
Use the SQL
INSERTstatement to load text into a table.To populate the
docstable, use theINSERTstatement:INSERT INTO docs VALUES(1, '<HTML>California is a state in the US.</HTML>'); INSERT INTO docs VALUES(2, '<HTML>Paris is a city in France.</HTML>'); INSERT INTO docs VALUES(3, '<HTML>France is in Europe.</HTML>');