How to store large text in clob column???
i have create a table this ..
create table realistic_docs
id number primary key,
text clob
and i want to load text data into clob column
the data is ....
The solar system may not be alone. Yesterday
astronomers announced the first ever
discovery of a planetary system like our own.
Three planets, they say, orbit a nearby star, Upsilon
Andromedae.
If confirmed, their discovery suggests that the Milky
Way galaxy is filled with planets. "This shows that
[outside of the solar system] it is possible to have more
than one planet going around a star. If we can prove
this once, we can extrapolate that it may happen
elsewhere," said Adam Contos from the
Harvard-Smithsonian Center for Astrophysics.
The planets orbiting Upsilon Andromedae are believed
to be gas giants like Jupiter and are not thought to
harbor life. According to Contos, however, the more
planetary systems there are, the greater the chance of
finding a planet with the elements essential for life.
The astronomers detected the proposed planets by
measuring the wavelengths of light from stars similar
to our sun. The presence of a planet would be
indicated by a tiny shift in wavelength known as a
gravitational wobble.
how to do this?kindly list me steps which are required...
thanks a lot .....
Here is the code. You will have to create a directory object first. The idea is to get the clob by reading it from a file using bfile and dbms_lob package.
declare
l_clob clob;
l_bfile bfile;
begin
dbms_lob.createtemporary ( l_clob, false );
l_bfile := bfilename ( 'MY_FILE_DIR', 'file_name.txt' );
dbms_lob.fileopen ( l_bfile );
dbms_lob.loadfromfile ( l_clob, l_bfile, dbms_lob.getlength ( l_bfile ) );
dbms_lob.fileclose ( l_bfile );
insert into table ( l_clob );
dbms_lob.freetemporary ( l_clob );
end;
Pratap
Similar Messages
-
How to update html file in clob column in oracle
hi,
please help me how to update html file in clob column in oracle
ThanksThis is your main query as i am able to understand and you want to update your html file into terms columns based on conditions :
SELECT b.terms As terms
FROM chklst_item_x_enrlmnt_type a, prvdr_enrlmnt_agreement b
WHERE a.enrlmnt_type_cid = 1
AND a.chklst_item_cid = b.chklst_item_cid
AND a.chklst_item_cid = 79
AND a.oprtnl_flag = 'A'
AND b.oprtnl_flag = 'A'
AND TRUNC (SYSDATE) BETWEEN b.from_date AND b.TO_DATE;So i suggest below one but you need to create a directory where you can store your html file and then you can update .. And remaining consult Experts suggestions too as your
question is improperly posted . . .
DECLARE
vclob CLOB;
v_bfile BFILE := BFILENAME ('YOUR_DIR', 'filename.html');
BEGIN
SELECT b.terms
INTO vclob
FROM chklst_item_x_enrlmnt_type a, prvdr_enrlmnt_agreement b
WHERE a.enrlmnt_type_cid = 1
AND a.chklst_item_cid = b.chklst_item_cid
AND a.chklst_item_cid = 79
AND a.oprtnl_flag = 'A'
AND b.oprtnl_flag = 'A'
AND TRUNC (SYSDATE) BETWEEN b.from_date AND b.TO_DATE
FOR UPDATE;
DBMS_LOB.fileopen (v_bfile);
DBMS_LOB.loadfromfile (vclob, v_bfile, DBMS_LOB.getlength (v_bfile));
DBMS_LOB.fileclose (v_bfile);
END;
/ Regards.. -
How to store a text file in a hash table in C#?
I am fairly new to c#. I am creating a console application project for practice. I am supposed to create a program that reads a text file (it's a poem), store it in a hash table, have two different sorts, and unhash the table. I managed to get the poem read
by using streamwriter, but now I am not sure how to store it in a hash table.
I'm not sure if I am doing this hash table correct, but I made my hash table like this to store the text file:
Hashtable hashtable = new Hashtable();
hashtable[1] = (@"C:\\Documents\\Datastructures\\Input\\Poem");Hi,
Hashtable in C# represents a collection of key/value pairs which maps keys to value. Any non-null object can be used as a key but a value can. We can retrieve items from hashTable to provide the key . Both keys and values are Objects.
Here is a sample about Hashtable,
Hashtable weeks = new Hashtable();
weeks.Add("1", "SunDay");
weeks.Add("2", "MonDay");
weeks.Add("3", "TueDay");
weeks.Add("4", "WedDay");
weeks.Add("5", "ThuDay");
weeks.Add("6", "FriDay");
weeks.Add("7", "SatDay");
//Display a single Item
MessageBox.Show(weeks["5"].ToString());
//Search an Item
if (weeks.ContainsValue("TueDay"))
MessageBox.Show("Find");
else
MessageBox.Show("Not find");
//remove an Item
weeks.Remove("3");
//Display all key value pairs
foreach (DictionaryEntry day in weeks)
MessageBox.Show(day.Key + " - " + day.Value);
>>I managed to get the poem read by using streamwriter, but now I am not sure how to store it in a hash table
Hashtable hashtable = new Hashtable();
hashtable[1] = (@"C:\\Documents\\Datastructures\\Input\\Poem");
But follow your scenario above, you just store a string path to hashtable not a file.
About saving data to a file, you can use the following code.
// Write the string to a file.
System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\test.txt");
file.WriteLine(lines);
file.Close();
Best wishes!
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How to store the text Inputted in JTextArea
I have created a JtextArea using Applets. I wanted to know how we get the text from that area and store it in a datastructure?..please help me
String text = textarea.getText();
-
Java servlet: how to store large data result across multiple web session
Hi, I am writing a java servlet to process some large data.
Here is the process
1), user will submit a query,
2) servlet return a lot of results for user to make selection,
3). user submit their selections (with checkboxes).
4). servlet send back the complete selected items in a file.
The part I have trouble with (new to servlet) is that how I can store the results arraylist (or vector) after step 2 so I needn't re-search again in step 4.
I think Session may be helpful here. But from what I read from tutorial, session seems only store small item instead of large dataset. Is it possible for session to store large dataset? Can you point me to an example or provide some example code?
Thanks for your attention.
MikeI don't know whether you connect the databases and store the resultset?
-
How to insert data into a CLOB column
In UIX XML I used a bc4j:textInput control for a CLOB column and I cannot type any letter in this field....Why ?
Regards,
LucianHello again !
Here are my findings (Content is a CLOB column; I use UIX XML + BC4J):
1.If I put:
<inlineMessage prompt="Content" required="no" vAlign="middle" >
<contents>
<bc4j:textInput name="Content" attrName="Content" columns="162" rows="5" />
</contents>
</inlineMessage>
I cannot type any letter in the text Input field !!!!!!
2. If I put
<inlineMessage prompt="Content" required="no" vAlign="middle" >
<contents>
<bc4j:attrScope name="Content">
<contents>
<textInput name="Content" columns="162" rows="5">
<boundAttribute name="text">
<bc4j:attrProperty name="value"/>
</boundAttribute>
</textInput>
</contents>
</bc4j:attrScope>
</contents>
</inlineMessage>
I can type in the textInput field, but I cannot save the text after a certain number of characters. Also I cannot see the saved text. I receive :
Servlet error: Renderer failed: java.lang.ArrayIndexOutOfBoundsException: -35</PRE></BODY></HTML>
inside the textInput field.
Please help me ...
Regards,
Lucian -
Hello experts,
I want to store long text field into database using abap oops, any valuable inputs?
I guess i can use internal table and breakup lines to multiple lines, but not sure this would help, any suggestions?
Thanks in advance.
Viralhii,
SELECT single tdtxtlines
from stxh
into v_textline
where tdid = 'Z01A'
and tdname = p_vbeln
and tdobject = 'VBBK'.
if v_textline ne 0.
L_NAME = P_VBELN.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'Z01A'
LANGUAGE = SY-LANGU
NAME = L_NAME
OBJECT = 'VBBK'
TABLES
LINES = IT_TLINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
ENDIF.
If you want continous text u can use Loop under this.
Regards,
Sridhar.V -
How to store long text in Rich Text Format in custom table
Hi
I have a requirement to store long text in the RTF in custom table.. Is this possible..
I am aware of a way to store them as Standard texts (SO10).. But not sure on if we can store them in tables..
Plz advise
Thanks
GeethaNot that familiar with RTF, but you could try and create a field of type (x)string in your table and store the data there.
-
How to Display Formatted Text IN ALV Column?
HI experts ,
I am displaying ALV with Multiple Column's , One of the Column is TEXT(Fomatted text).
When ALV is Displayed TEXT Column Comes as Continues TEXT . and is Not Formatted .
Now when i want to edit this text i am Calling another View which contains text edit . This Text edit will display correct Formatted Text . but when i save it and Come back to ALV again i do see continues text .
Is there any way where in i can display the Formatted text in ALV Column ?
Any body have any clue with this ...
Thanks in Advance
Patil
Edited by: Badarinarayan Patil on Feb 22, 2008 3:45 PMHi Juergen,
I found Your blog and found it really interesting... though I was not able to use it: I (like Jun Li is asking, I guess) need to use a dynamic text, containing formatting informations (according the xhtml syntax).
I tried to pass it to the form by an ABAP-dictionary based interface and by means of the context (in a webdynpro page), but both tries failed.
Some suggestion will be greatly appreciated.
Thankyou
Simone -
Forms: How to add large text without getting wrapped
hi Waveset/Sun IDM folks,
I need to add a large text to the form via a Field at the bottom of the Form. So using Title and SubTitle form properties is not an option.
When I use Label/Text/TextArea type of Fiels, I see that the text is getting wrapped as if it is a label for a text box or text area or Radio.
I do not have an option of using Title and SubTitle properties of the Form as the text appears at the middle and bottom of the page. What options do I have?
My form has :
SectionHead:
FirstName: <Text>
LastName: <Tex>
Address: <Text Area>
Contract(Section Head)
<Large text needs to go here>ok, nevermind, Using FieldType-Panel and adding Label fields in it worked out fine for me. Issue closed.
-
How to extract data from a CLOB column
I have a column that is in CLOB format which stores a table (which has 2 columns-Initiative and SLM) into it.
Example:
<Table><TableStructure><Col Name="Initiative" Index="Y" Mandatory="N" Type="Text" DefaultValue="" /><Col Name="SLM" Index="N" Mandatory="N" Type="Text" DefaultValue="" /></TableStructure><TableElements><Elem><Initiative>.</Initiative><SLM>De Gendt, Chris</SLM></Elem><Elem><Initiative>..</Initiative><SLM>Kracik, Gosia</SLM></Elem><Elem><Initiative>...</Initiative><SLM>Iacono, Michel</SLM></Elem><Elem><Initiative>....</Initiative><SLM>Heighes, Michelle</SLM></Elem><Elem><Initiative>.....</Initiative><SLM>Smit, Christophe</SLM></Elem><Elem><Initiative>......</Initiative><SLM>Den Hartog, Stefan</SLM></Elem><Elem><Initiative>........</Initiative><SLM>Van Trier, Geert</SLM></Elem></TableElements></Table>
I want to retrieve the values of these 2 columns using a SQL query.
Does anybody know how can this be done?
Thanks in advance.SQL> create table t_parameters (table_value clob)
Table created.
SQL> insert into t_parameters
values (
'<Table><TableStructure><Col Name="Initiative" Index="Y" Mandatory="N" Type="Text" DefaultValue="" /><Col Name="SLM" Index="N" Mandatory="N" Type="Text" DefaultValue="" /></TableStructure><TableElements><Elem><Initiative>.</Initiative><SLM>De Gendt, Chris</SLM></Elem><Elem><Initiative>..</Initiative><SLM>Kracik, Gosia</SLM></Elem><Elem><Initiative>...</Initiative><SLM>Iacono, Michel</SLM></Elem><Elem><Initiative>....</Initiative><SLM>Heighes, Michelle</SLM></Elem><Elem><Initiative>.....</Initiative><SLM>Smit, Christophe</SLM></Elem><Elem><Initiative>......</Initiative><SLM>Den Hartog, Stefan</SLM></Elem><Elem><Initiative>........</Initiative><SLM>Van Trier, Geert</SLM></Elem></TableElements></Table>'
1 row created.
SQL> select t2.*
from t_parameters t, xmltable ('Elem' passing extract (xmltype (t.
table_value), 'Table/TableElements/Elem')
columns initiative varchar2 (15) path
'Initiative', slm varchar2 (15) path 'SLM') t2
INITIATIVE SLM
. De Gendt, Chris
.. Kracik, Gosia
... Iacono, Michel
.... Heighes, Michel
..... Smit, Christoph
...... Den Hartog, Ste
........ Van Trier, Geer
7 rows selected.;) -
How to store PDF file in BLOB column without using indirect datastore
Hi ,
I want to store a pdf file in a BLOB column.
But , it should be a direct store. I cannot usre indirect datastore.
BLOB column doesn't support indirect datastore. I get the following error.
ERROR at line 1:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-10581: indirect datastores cannot be used with long or lob text columns
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 365
can anyone give me any clue onhow to manage this issue?Thanks This really helped.
For other readers, I am summarising what I did.
create table test
id number primary key,
docs BLOB
create or replace directory doc_loc
as 'c:\test';
CREATE OR REPLACE PROCEDURE Load_BLOB_From_File (file_name in varchar2)
AS
src_loc bfile:= bfilename('DOC_LOC',Load_BLOB_From_File.file_name);
dest_loc BLOB;
begin
insert into tkctsf15t values(1,empty_blob()) returning docs
into dest_loc;
dbms_lob.open(src_loc,DBMS_LOB.LOB_READONLY);
DBMS_LOB.OPEN(dest_loc, DBMS_LOB.LOB_READWRITE);
DBMS_LOB.LOADFROMFILE(
dest_lob => dest_loc
,src_lob => src_loc
,amount => DBMS_LOB.getLength(src_loc));
DBMS_LOB.CLOSE(dest_loc);
DBMS_LOB.CLOSE(src_loc);
COMMIT;
end;
show errors;
exec Load_BLOB_From_File('test.pdf');
exec ctx_ddl.create_preference('mylex','BASIC_LEXER');
create index testx on test(docs) indextype is ctxsys.context
parameters
('filter ctxsys.AUTO_FILTER LEXER mylex ');
select id from test where contains(docs,'patch')>0;
Thanks Roger once more -
How to catch selected text in JTable Column
Hi there,
I am learning JTable. Need help for How to get the selected text from the JTable Column which is set to be editable.
for example in JTextFiled you have method on getSelectedText(), is there any method for tracking the selected text.
Thanks in advance
MinalHere's an example of the model I used in my JTable. Not the "getValueAt" method & "getRecordAt" method. You will have to have a Record object - but it only contains the attributes of an inserted record (with appropriate getters & setters). Hope this helps.
public class FileModel5 extends AbstractTableModel
public boolean isEditable = false;
protected static int NUM_COLUMNS = 3;
// initialize number of rows to start out with ...
protected static int START_NUM_ROWS = 0;
protected int nextEmptyRow = 0;
protected int numRows = 0;
static final public String file = "File";
static final public String mailName = "Mail Id";
static final public String postName = "Post Office Id";
static final public String columnNames[] = {"File", "Mail Id", "Post Office Id"};
// List of data
protected Vector data = null;
public FileModel5()
data = new Vector();
public boolean isCellEditable(int rowIndex, int columnIndex)
// The 2nd & 3rd column or Value field is editable
if(isEditable)
if(columnIndex > 0)
return true;
return false;
* JTable uses this method to determine the default renderer/
* editor for each cell. If we didn't implement this method,
* then the last column would contain text ("true"/"false"),
* rather than a check box.
public Class getColumnClass(int c)
return getValueAt(0, c).getClass();
* Retrieves number of columns
public synchronized int getColumnCount()
return NUM_COLUMNS;
* Get a column name
public String getColumnName(int col)
return columnNames[col];
* Retrieves number of records
public synchronized int getRowCount()
if (numRows < START_NUM_ROWS)
return START_NUM_ROWS;
else
return numRows;
* Returns cell information of a record at location row,column
public synchronized Object getValueAt(int row, int column)
try
FileRecord5 p = (FileRecord5)data.elementAt(row);
switch (column)
case 0:
return (String)p.file;
case 1:
return (String)p.mailName;
case 2:
return (String)p.postName;
catch (Exception e)
return "";
public void setValueAt(Object aValue, int row, int column)
FileRecord5 arow = (FileRecord5)data.elementAt(row);
arow.setElementAt((String)aValue, column);
fireTableCellUpdated(row, column);
* Returns information of an entire record at location row
public synchronized FileRecord5 getRecordAt(int row) throws Exception
try
return (FileRecord5)data.elementAt(row);
catch (Exception e)
throw new Exception("Record not found");
* Used to add or update a record
* @param tableRecord
public synchronized void updateRecord(FileRecord5 tableRecord)
String file = tableRecord.file;
FileRecord5 p = null;
int index = -1;
boolean found = false;
boolean addedRow = false;
int i = 0;
while (!found && (i < nextEmptyRow))
p = (FileRecord5)data.elementAt(i);
if (p.file.equals(file))
found = true;
index = i;
} else
i++;
if (found)
{ //update
data.setElementAt(tableRecord, index);
else
if (numRows <= nextEmptyRow)
//add a row
numRows++;
addedRow = true;
index = nextEmptyRow;
data.addElement(tableRecord);
//Notify listeners that the data changed.
if (addedRow)
nextEmptyRow++;
fireTableRowsInserted(index, index);
else
fireTableRowsUpdated(index, index);
* Used to delete a record
public synchronized void deleteRecord(String file)
FileRecord5 p = null;
int index = -1;
boolean found = false;
int i = 0;
while (!found && (i < nextEmptyRow))
p = (FileRecord5)data.elementAt(i);
if (p.file.equals(file))
found = true;
index = i;
} else
i++;
if (found)
data.removeElementAt(i);
nextEmptyRow--;
numRows--;
fireTableRowsDeleted(START_NUM_ROWS, numRows);
* Clears all records
public synchronized void clear()
int oldNumRows = numRows;
numRows = START_NUM_ROWS;
data.removeAllElements();
nextEmptyRow = 0;
if (oldNumRows > START_NUM_ROWS)
fireTableRowsDeleted(START_NUM_ROWS, oldNumRows - 1);
fireTableRowsUpdated(0, START_NUM_ROWS - 1);
* Loads the values into the combo box within the table for mail id
public void setUpMailColumn(JTable mapTable, ArrayList mailList)
TableColumn col = mapTable.getColumnModel().getColumn(1);
javax.swing.JComboBox comboMail = new javax.swing.JComboBox();
int s = mailList.size();
for(int i=0; i<s; i++)
comboMail.addItem(mailList.get(i));
col.setCellEditor(new DefaultCellEditor(comboMail));
//Set up tool tips.
DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
renderer.setToolTipText("Click for mail Id list");
col.setCellRenderer(renderer);
//Set up tool tip for the mailName column header.
TableCellRenderer headerRenderer = col.getHeaderRenderer();
if (headerRenderer instanceof DefaultTableCellRenderer)
((DefaultTableCellRenderer)headerRenderer).setToolTipText(
"Click the Mail Id to see a list of choices");
* Loads the values into the combo box within the table for post office id
public void setUpPostColumn(JTable mapTable, ArrayList postList)
TableColumn col = mapTable.getColumnModel().getColumn(2);
javax.swing.JComboBox combo = new javax.swing.JComboBox();
int s = postList.size();
for(int i=0; i<s; i++)
combo.addItem(postList.get(i));
col.setCellEditor(new DefaultCellEditor(combo));
//Set up tool tips.
DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
renderer.setToolTipText("Click for post office Id list");
col.setCellRenderer(renderer);
//Set up tool tip for the mailName column header.
TableCellRenderer headerRenderer = col.getHeaderRenderer();
if (headerRenderer instanceof DefaultTableCellRenderer)
((DefaultTableCellRenderer)headerRenderer).setToolTipText(
"Click the Post Office Id to see a list of choices");
} -
How do I get text value in column next to tree element?
I can only get elements from the left column...how do I read from other column.
For example if I want "Version 1.0" i get the section1 tag, then the first child...and then?
thanks
Attachments:
get_tree_column_elements.JPG 17 KBThank you
in the mean time I came up with a similar solution.
What is the difference between the property and invoke node I used and yours? Maybe my version is more flexible because require a generic tree reference? But yours looks more simple and clear...
I'm not an expert of these functions I was just wondering about the theory beyond them and which is best in which case.
diego
Attachments:
get tree attributes.JPG 55 KB
tree example.JPG 21 KB -
How to store long text in transaction f-65
Hi all,
I need to add long text in the transaction f-65 for a particular document number. I have used the FM CREATE_TEXT. There are no errors but the text is not getting updated.
Pointers on this will be really helpful.
Regards,
PraveenNot that familiar with RTF, but you could try and create a field of type (x)string in your table and store the data there.
Maybe you are looking for
-
Just bought a new HP Pavillion with Vista. I installed iTunes and synched by nano. I can see all the music in the libraries but they are "greyed out" meaning I can't edit any lists. Any ideas how to fix this?
-
Dear Experts, How to issue a single cheque payment for multiple open item for a single vendor in automatic payment program, normally we issue single cheque for each open item but if we want to issue single for a number of open items then how to cuzto
-
HELP! my ipod has a thin blue line across the screen whenever i play videos
i got my ipod a day ago. i havent dropped it or anything and when i play a video there is a thin, blue, vertical line on my screen. is it broken or what!?
-
Observer/Observable design pattern
Is there a way to implement the Observer/Observable pattern in a pure java FX 1.2 desktop Application? And if yes how ? :)
-
Media Tracker not working in array element initialization...
Hi, I'm new to Java... and I'm also in a hurry. Having trouble here. Ever since I turned TerrainPalette into an array the media tracker hasn't been able to add the image. I'm sure it's something simple that I'm doing wrong since I'm so new. Here's my