I want to update a BLOB column in Oracle DB with HTML.
I am using Oracle Oracle Database 11g Release 11.2.0.3.0
The column contains HTML code which would be used in front end in JSP Servlets. The content of cell should be updated with below code
<table width="100%" border="0" cellspacing="0">
<tbody>
<tr>
<td height="130"> </td>
</tr>
<tr>
<td height="130">© 2013</td>
</tr>
</tbody>
</table>
The above code is formatted.The whole thing is single line.Now when I run a update query as below its showing the message
UPDATE TemplateTbl
SET TemplateConetent = (RAWTOHEX (UTL_RAW.cast_to_raw ('<table width="100%" border="0" cellspacing="0"><tbody><tr><td height="130"> </td></tr><tr><td height="130">© 2013</td></tr></tbody></table>')))
WHERE TemplateId = TL2600
Now oracle is asking for variable values because of © and as below
I have tried using underscore, Backslash and percentage in front of © and  . But nothing worked. How do I solve this issue?
1、sql plus or plsql command window
set define off;
UPDATE TemplateTbl
SET TemplateConetent = (RAWTOHEX (UTL_RAW.cast_to_raw ('<table width="100%" border="0" cellspacing="0"><tbody><tr><td height="130"> </td></tr><tr><td height="130">© 2013</td></tr></tbody></table>')))
WHERE TemplateId = TL2600
HTML ist plain text, use an (N)CLOB for that.
Related
I am trying to scrape a table which looks like the below.
<table class="table">
<caption>Caption</caption>
<tbody>
<tr>
<th scope="row">Title</th>
<td>Detail</td>
</tr>
<tr>
<th scope="row">Title 2</th>
<td>Detail 2</td>
</tr>
</tbody>
</table>
How would you set up scrapy so my output file generates an output similar to the below?!
Title: Detail
Title2: Detail2
Currently I can get all the text using two css selectors (one for the td's and one for the th's) but I would love to be able to combine these!
Unfortunately the number of rows differs from page to page..
Using xpath:
tabledata={}
for i in response.xpath("//table[#class='table']//tr")
tabledata[i.xpath("th/text()").extract_first()] = i.xpath("td/text()").extract_first()
Output
{"Title":"Detail", "Title 2":"Detail 2"}
I am trying to achieve following matrix kind of layout:
TABLE1,1 TABLE1,2
CHART2,1 TABLE2,2
TABLE3 --> occupies whole row
CHART4 --> ocupies whole row
CHART5,1 CHART5,2
................. List goes on...
These components may span over multiple pages. What is the best way to have them side by side and still be able to view them in MigraDoc.
CHART5,1 could be a combination of 4 charts in one cell.
In HTML view I can use following analogy:
<TABLE>
<TR>
<TD>TABLE1,1</TD> <TD>TABLE1,2 </TD>
</TR>
<TR>
<TD>CHART2,1</TD> <TD>TABLE2,2 </TD>
</TR>
<TR>
<TD>TABLE3</TD colspan =2>
</TR>
<TR>
<TD>CHART4</TD colspan =2>
</TR>
<TR>
<TD>CHART5,1</TD> <TD>CHART5,2 </TD>
</TR>
</TABLE>
The MigraDoc equivalent for colspan=2 is MergeRight=1. This is a property of the Cell class.
I am attempting to fix an issue on a company website. The page in question is http://www.srbc.com/SiteMap.asp. I am getting the following error when trying to call a global options file:
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/_Includes/Callout_Global.asp, line 40
And this is the line the error references in the /_Includes/Callout_Global.asp file:
rs_main.open "Select TeamID, FirstName + ' ' + LastName as FullName from team where Category = 'Attorney' and IsActive = '1' Order by OrderNum"
The code controls the dropdown box that should contain a listing of attorney names.
This code works just fine on other pages in the site (see for example http://www.srbc.com/Careers/Default.asp).
I am not a coder, just trying to cleanup this site a bit. It is pretty dated code, but any suggestions on what I could do to fix this would be appreciated.
The coding on the SiteMap.asp page around where this function is called looks like:
<td width="210" valign="top" class="hideforprint">
<!--#include virtual="/_Includes/Callout_Global.asp" -->
</td>
<td width="20"> </td>
</tr>
</table>
<table width="726" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25"></td>
</tr>
</table>
</td>
<td width="22" valign="top" background="/Images/CommonImages/rightborder.gif"> </td>
</tr>
</table>
<!--#include virtual="/_Includes/Footer.asp" -->
</body>
</html>
Thanks!
That error would suggest that you haven't created an object called rs_main. It looks like it should be a recordset object, so you earlier in your code you should have the line
Set rs_main = Server.CreateObject("ADODB.Recordset")
Could you post the first 40 lines of Callout_Global.asp, there might be other stuff missing?
I'm a dope!
I figured it out. At the top of the SiteMap.asp code, there was a function call missing. Once I added that back in, everything started working. I just noticed that was different from every other page that was working normally.
Now to tackle a search index issue.
Thanks!
I am writing a script to automate certain tasks. I am at a point where I have a table and hyperlinked name written in its second row, first column ([2][1]). I want to access that cell and click on it to go to intended page. Structure of the page looks like this:
<table id="listViewTable" class="listview" width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-top: 0px;">
<tbody></tbody>
<tbody id="lvTred">
<tr id="1381137000000078119" class="tdout">
<td width="10" data-cid="dummy"></td>
<td class="lvCB" data-cid="dummy"></td>
<td>
<a id="listView_1381137000000078119" class="link" href="/crm/EntityInfo.do?id=1381137000000078119&module=Potentials&relCntId=1381137000000078117" data-params="{"relContactId":"1381137000000078117","module":"Potentials",…id":"1381137000000075541","recordNum":"1","lookback":"true"}" data-cid="detailView"></a>
</td>
I have successfully accessed table with id 'listviewTable' but not able to access cell with id 'listView_1381137000000078119' which is at location [2][1] in table. I did something like this:
cell = table.cell(:id, 'listView_1381137000000078119')
where table is actual table with mentioned id. Can anyone help?
Based on your HTML, there is no <td> tag with an id attribute of listView_1381137000000078119. However, there is an <a> tag with an id attribute of listView_1381137000000078119.
puts b.table.td(:id, 'listView_1381137000000078119').exists?
puts b.table.link(:id, 'listView_1381137000000078119').exists?
#=> false
#=> true
I'm trying to import some data from a HTML page with feeds importer. The context is this:
<table class="tabela">
<tr valign="TOP">
<td class="formulario-legenda">Nome:</td>
<td nowrap="nowrap">
<b>Raul Fernando de Almeida Moreira Vidal</b>
</td>
</tr>
<tr valign="TOP">
<td class="formulario-legenda">Sigla:</td>
<td>
<b>RMV</b>
</td>
</tr>
<tr valign="TOP">
<td class="formulario-legenda">Código:</td>
<td>206415</td>
</tr>
<tr valign="TOP">
<td class="formulario-legenda">Estado:</td>
<td>Ativo</td>
</tr>
</table>
<table>
<tr>
<td class="topo">
<table>
<tr>
<td class="formulario-legenda">Categoria:</td>
<td>Professor Associado</td>
</tr>
<tr>
<td class="formulario-legenda">Carreira:</td>
<td>Pessoal Docente de Universidades</td>
</tr>
<tr>
<td class="formulario-legenda">Grupo profissional:</td>
<td>Docente</td>
</tr>
<tr valign="TOP">
<td class="formulario-legenda">Departamento:</td>
<td>
<a href="uni_geral.unidade_view?pv_unidade=151"
title="Departamento de Engenharia Informática">Departamento de Engenharia Informática</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
I tried with this:
/html/body/div/div/div/div/div/div/div/table/tbody/tr/td/table/tbody/tr[1]/td[2]
but nothing appears. Can someone help me with the right syntax to obtain "Grupo Profissional"?
Quick answer that might work
Considering just the HTML sample you provided (which only has two tables) you can select the text you want using this expression, based on the table's position:
//table[2]//tr[3]/td[1]/text()
This will work in the HTML you pasted above. But it might not work in your actual scenario, since you might have other tables, the table you want to select has no ID and you didn't suggest some invariant text in your code which could be used to anchor the context for the expression. Assuming the initial part of your XPath expression (the div sequence) is correct, you might be able to use:
/html/body/div/div/div/div/div/div/div/table[2]//tr[3]/td[1]/text()
But it's wuite a fragile expression and vulnerable to any changes in the document.
A (possibly) better solution
A better alternative is to look for some identifier you could use. I can only guess, since I don't know your code. In your sample code, I would guess that Codigo and the number following it 206415 might be some identifier. If it is, you could use it to anchor your context. First you select it:
//table[.//td[text()='Código:']/following-sibling::td='206415']
The expression above will select the table which contains a td with the exact text Código: followed by a td containing the exact text 206415. This will create a unique context (considering that the number is an unique identifier). From that context, you can now select the text you want, which is inside the next table (following-sibling::table[1]). This is the context of the second table:
//table[.//td[text()='Código:']/following-sibling::td='206415']/following-sibling::table[1]
And this should select the text you want (Grupo profissional:) which is in the third row tr[3] and first cell/column td[1] of that table:
//table[.//td[text()='Código:']/following-sibling::td='206415']/following-sibling::table[1]//tr[3]/td[1]/text()