Extract specific value of a Clob column with multiple nodes,similar name
Hi,
There is a clob column in the table USER_DETAILS which hold the values similar to the one given below, i would like to form a query which should fetch the entire record where the age<30, as all the child nodes are with similar name i couldn't fetch it out using xmltype.extract. Also the order of the node values may change for eg. age may follow salary or age can be the first node in the list. Please help me to fetch the desired details.
<Details>
<parameter>
<enter>
<value>name</value>
<value>jacob</value>
</enter>
<enter>
<value>Age</value>
<value>30</value>
</enter>
<enter>
<value>Salary</value>
<value>20000</value>
</enter>
<enter>
<value>DOB</value>
<value>12091980</value>
</enter>
Thanks, gilbert
Let's start with the easy part.
Cells on a Numbers table can contain data entered directly, or can contain a formula. They can't contain both. That means you cannot 'type the conditions into a single cell' in column A ("the left header" cell) AND have a formula which sets that cell to TRUE if the typed in data contains an "A".
There's no problem doing this using column A as the key holder and columns B:Z to hold the TRUE/FALSE results, staring in both cases on row 2.
Here's an example
The column header cells (row 1) contain the letter corresponding to that column.
The row header cells (starting at row 2) contain the 'bunch of letters' you describe. Note (A4) that the letters do not have to be entered in any particular order, and that extraneous characters (eg. a space) are ignored.
The formula shown is entered B2, and filled down and right from there.
=IFERROR(FIND(B$1,$A2)>0,FALSE)
FIND returns the position of the first occurrence of the target string (in this case, the single letter at the top of the column) in the search string, then compares that with the value zero. For any letter that is included in the search string, the find value will be at least 1, so the comparison will return TRUE. If the target letter is not found, FIND returns an error. IFERROR traps this and returns FALSE.
Since the target depends on the letter at the top of the column, all that's needed to extend the range of possible letters to the full alphabet is to enter an A in cell B1, then run through the alphabet A to Z, with Z in cell AA1.
Depending what you want to do with the TRUE or FALSE values in these 26 columns, it may be possible to skip the auxiliary column step and use a formula similar to the one above as the condition argument of an IF(condition,do-if-true,do-if-false) statement.
Regards,
Barry
Similar Messages
-
Doubt handling Clob columns with Java JDBC api
Hi,
we have a doubt handling Clob columns with Java JDBC api.
Reading Oracle 10g official documentation (document b10979.pdf, page 236), we found this note:
============================================
To write LOB data, the application must acquire a write lock on the LOB object. One way to accomplish this is through a SELECT FOR UPDATE. Also, disable auto-commit mode.
============================================
We also found a java sample code about how to handle Lob objects at this URL:
http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/LOBSample.java.html
In our java2 application, we access Clob objects in a quite different
manner: we use normal setString() and getString() methods, as described into paragraph "Shortcuts For Inserting and Retrieving CLOB Data"
(document b10979.pdf, page 244).
Using those methods, we never lock the table row by a SELECT FOR UPDATE statement (as described into the note above). We use simply SELECT, UPDATE and INSERT prepared statement.
In this way we can insert both clob objects and normal timestamp, number and other types with a single insert statement. Idem for update.
To recap, our question is:
Is it mandatory to create a SELECT FOR UPDATE statement when updating clob data? What may be the consequences if we don't use it? It is also correct to insert with a single sql statement both clob and not clob data using the setString() method for the clob types? And more than one lob column in the same record?
bye,
luca acri.And columns of type FLOAT. These also have, for some unknown reason a metadata type of OTHER, and a type string of 'FLOAT'. Yet PreparedStatement.setNull(x, Types.OTHER) doesn't work and setNull(x, Types.DECIMAL) does.
-
Document library view: Group by a column with multiple values
I have a document library which has a managed metadata column.
I would like to create a view which groups the documents by this managed metadata column.
The managed metadata column can have multiple values.
I know that this is not possible with SharePoint's group by, since it only accepts those columns which can have only one single value.
But is this possible to accomplish by some other means, e.g. Content query web part? Or is there perhaps a 3rd party solution to this?
Is it possible to change the group by settings somehow to allow Group by to function with columns with multiple values? <- this may be far fetched...Hi Pekch,
I'm assuming you have VS2010 to build the custom web part. From there you will need to figure out the following:
Get a SPList object for the Document Library (See below for code example)
Loop through all the documents in the SPList object
If you have audience targetting enabled, then you'll need to determine if the user has access to the document by checking the "Target_x0020_Audiences" column)
As you also want to group by metadata, you'll need to populate 2 datatables (one table with a column containing unique metadata values and another table with a metadata column and other document related columns). Link these two tables via a dataset
relation.
Set the dataset as the datasource for a repeater, add in some css and javascript for the group expand/collaspe and it should be close to what you need.
This will be a time consuming task if you don't know where to start or have problems figuring out how to perform a certain operation. So you may want to determine if the functionality you want is required or just a "nice to have". Good
luck and if I have some spare time, I'll create a blog post outlining how to do all the above.
I got the below code from a sharepoint blog sometime in the past and you can use it to retrieve a list.
You can use it like this: GetListByUrl(http://servername/Shared%20Documents/Forms/AllItems.aspx)
using Microsoft.SharePoint;
public SPList GetListByUrl(string listURL)
SPList list = null;
try
using (SPSite site = new SPSite(listURL))
if (site != null)
// Strip off the site url, leaving the rest
// We'll use this to open the web
string webUrl = listURL.Substring(site.Url.Length);
// Strip off anything after /forms/
int formsPos = webUrl.IndexOf("/forms/", 0, StringComparison.InvariantCultureIgnoreCase);
if (formsPos >= 0)
webUrl = webUrl.Substring(0, webUrl.LastIndexOf('/', formsPos));
// Strip off anything after /lists/
int listPos = webUrl.IndexOf("/lists/", 0, StringComparison.InvariantCultureIgnoreCase);
if (listPos >= 0)
// Must be a custom list
// Strip off anything after /lists/
webUrl = webUrl.Substring(0, webUrl.LastIndexOf('/', listPos));
else
// No lists, must be a document library.
// Strip off the document library name
webUrl = webUrl.Substring(0, webUrl.LastIndexOf('/'));
// Get the web site
using (SPWeb web = site.OpenWeb(webUrl))
if (web != null)
// Initialize the web (avoids COM exceptions)
string title = web.Title;
// Strip off the relative list Url
// Form the full path to the list
//string relativelistURL = listURL.Substring(web.Url.Length);
//string url = SPUrlUtility.CombineUrl(web.Url, relativelistURL);
// Get the list
list = web.GetList(listURL);
catch { }
return list; -
How do i test split by value functionality in mesage mapping with multiple
how do i test split by value functionality in mesage mapping with multiple values ?
regards,
venkatrepeat your source node. in mapping editor you can view queues by right clicking to mapped element.. selecting Display Queues option.. this will show u your values .
You can also select this Display Queue option for splitByValue option
for example
source--->splitByValue>target
Try viewing your queues to each this step... for splitByValue in display Queue you will see context inserted(grey colour) accodingly -
Using the opmn:ormi protocol with multiple nodes
Hi
If I use the opmn:ormi protocol with multiple nodes, will it load balance between the nodes or will it simply try to connect to the first node and if it can't it will connect to the second node?.
Instead of specifying multiple nodes can I set the host to point to a load balancer?
Which solution is best?repost
-
Forms 6.0 how to query clob column with oracle 9.2 DB
hi every body,
i made install for oracle 9.2 oracle DB every thing goes ok but when i made query in my form version 6.0 which have CLOB column the form closed automatically without any message?
and just for know when i run the same form with oracle 8.1.7 DB the form made query normally without any problem.
i want your help please.
Message was edited by:
mshaqalaihI know there was a problem in 6i where you would get a crash if your query returned more than {Max Length} characters of the field representing the CLOB column.
-
Reading a CLOB Column with ODBC
When I do a "select colCLOB from Table1", it is truncating the data. It looks like after about 1000 chars(+/-), it puts a bunch of spaces in. I am on 8.1.6. If I use OleDB it works fine. Any Ideas? Thanks!
Here's Note:115946.1 from our support archives "Using ADO Stream Object and ODBC to Store and Retrieve Blobs in Oracle from VB". This may help you out.
'In order to use this sample, you must have a table created as follows:
' Name: LOB_TABLE
' COL: FIELD2 VARCHAR2(50)
' COL: BLOBFIELD BLOB
'You must have references set to ADO 2.5 and Oracle's ODBC Driver 8.1.6
'Create a standard exe project
' Open a new form
' Put two command buttons on it
' Button #1: cmdSaveToFile
' Button #2: cmdSaveToDB
' Put the appropriate code in each routine.
'Modify connection information for your environment
' This has been tested using VB 6.0 SP4, Oracle 8.1.6 DB, and Oracle's 8.1.6 ODBC Driver
Option Explicit
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim mStream As ADODB.Stream
Dim ConnStr As String
Private Sub cmdSaveToFile_Click()
Screen.MousePointer = vbHourglass
Set cn = New ADODB.Connection
ConnStr = "UID=scott;PWD=tiger;DSN=ora816;"
Set cn = New ADODB.Connection
With cn
.ConnectionString = ConnStr
.Open
End With
' Open OLEDB connection
' cn.Provider = "OraOLEDB.Oracle"
' cn.ConnectionString = "Data Source=ora816;" & "User ID=scott;Password=tiger;"
' cn.Open
Set rs = New ADODB.Recordset
rs.Open "Select * from LOB_TABLE where FIELD2 IS NOT NULL", cn, adOpenKeyset, adLockOptimistic
' Create ADO stream object
Set mStream = New ADODB.Stream
' Set it to a binary file type
mStream.Type = adTypeBinary
' Open it
mStream.Open
' This writes the image from the blob field to the buffer
mStream.Write rs.Fields("BLOBFIELD1").Value
' This saves the stream to the file on disk
mStream.SaveToFile "C:\" & rs.Fields("FIELD2").Value
mStream.Close
Set mStream = Nothing
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
Screen.MousePointer = vbDefault
End Sub
Private Sub cmdSaveToDB_Click()
Screen.MousePointer = vbHourglass
Set cn = New ADODB.Connection
ConnStr = "UID=scott;PWD=tiger;DSN=ora816;"
Set cn = New ADODB.Connection
With cn
.ConnectionString = ConnStr
.Open
End With
' cn.Provider = "OraOLEDB.Oracle"
' cn.ConnectionString = "Data Source=ora816;" & "User ID=scott;Password=tiger;"
' cn.Open
Set rs = New ADODB.Recordset
rs.Open "Select * from LOB_TABLE", cn, adOpenKeyset, adLockOptimistic
' Create the ADO Stream object
Set mStream = New ADODB.Stream
' Make it a binary type
mStream.Type = adTypeBinary
' Open the stream
mStream.Open
' Read the file into the stream buffer
mStream.LoadFromFile "c:\documents and settings\rlosey\My Documents\My Pictures\DCP_1305.jpg"
' Add the blob to the database
With rs
.AddNew
.Fields("BLOBFIELD1").Value = mStream.Read
.Fields("FIELD2").Value = "DCP_1305.jpg"
.Update
End With
mStream.Close
Set mStream = Nothing
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
Screen.MousePointer = vbDefault
End Sub
null -
Although i am entering only one character into the textfield then too it is reflecting the same error.
private void initEvents()
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Connection conn = null;
Statement stmt = null;
try{
//STEP 2: Register JDBC driver
Class.forName("oracle.jdbc.driver.OracleDriver");
//STEP 3: Open a connection
System.out.println("Connecting to database...");
conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","hr","hr");
//STEP 4: Execute a query
System.out.println("Creating statement...");
stmt = conn.createStatement();
System.out.println(txtField);
String sql = "INSERT INTO DOCTORS VALUES ('"+txtField+"','"+textField_1+"','"+textField_1+"','"+textField_2+"','"+textField_3+"')";
JOptionPane.showMessageDialog(null,"Inserted Successfully!");
ResultSet rs = stmt.executeQuery(sql);
rs.close();
stmt.close();
conn.close();
}catch(SQLException se){
//Handle errors for JDBC
se.printStackTrace();
}catch(Exception e1){
//Handle errors for Class.forName
e1.printStackTrace();
}finally{
//finally block used to close resources
try{
if(stmt!=null)
stmt.close();
}catch(SQLException se2){
}// nothing we can do
try{
if(conn!=null)
conn.close();
}catch(SQLException se){
se.printStackTrace();
}//end finally try
}//end tryWhat is a the size of the text you are trying to insert?
Have you tried the increasing the size of 'Name' column to 658?
Most likely the size of Name column is 20. This isn't enough to fit in the value you are trying to insert.
You can increase the size of the Name column with alter table Hr.doctors modify ( Name column_type (658));
Let me know if this helps.
Regards,
Suntrupth -
BW 3.5 works with multiple nodes for authorizations
Hi,
Does BW 3.5 allow to do authorizations on mutiple nodes? It seems that from the How to wotk with hierarchy authorizations paper, the variable can only allow filtering 1 node. for 2.0B. We have requirements to allow viweing multiple nodes in a hierarchy.
Thanks
WillHi Will,
creat a hierarchy-node variable fill by authorizations in the frontend. The type has to be multiple entries (not single value). In RSSM at the hierarchy authorization creation you have to use the F4 for selecting nodes. The F4 allows to drag more nodes into the right frame.
Cheers
Peter -
How to generate xml file with multiple nodes using sqlserver as database in SSIS..
Hi ,
I have to generate the xml file using multiple nodes by using ssis and database is sqlserver.
Can some one guide me on to perform this task using script task?
sudhaWhy not use T-SQL for generating XML? You can use FOR XML for that
http://visakhm.blogspot.in/2014/05/t-sql-tips-fun-with-for-xml-path.html
http://visakhm.blogspot.in/2013/12/generating-nested-xml-structures-with.html
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
SUn Cluster with multiple nodes
Hi,
I am planning to setup Sun Cluster with 3+ nodes.
is it possible to configure sun cluster with just two network interfaces on each box. (One for Public access and second for cluster interconnection via dedicated switch)?
Thanks in advance for the help.Yes, but only if the adapters support VLAN tagging.
That way you would be able to create two tagged VLANs on each adapter, one for public and one for private traffic. You'd also need a switch that supported VLAN tagging, but I think these are fairly common now.
If your NICs do not support tagging then you'd need to get another adapter to allow Sun Cluster to install.
Regards,
Tim
--- -
How to create the query with multiple node types
Hi,
I am having an issue in creating a query to search multiple node types.
The requirement is to query documents/pages of the type dam:Asset and cq:Page present under a path.
I tried the following code snippet with no luck .
path=/content
1_type=cq:Page
2_type=dam:Asset
property=jcr:content/metadata/@cq:tags
property.1_value=<tag Name>
I was able to write a query with single type. However i could not find any documents/ materials with multipe types as shown above.
Thanks in advance.
Regards
SudhiI don't think multiple type is possible. Instead use super type like nt:base that will cover both page and asset.
Yogesh
www.wemblog.com -
How to extract Attribute Value from a DBC file with LabWindows and NI-XNET library
Hi all,
For my application, i would like to feed my LabWindows CVI Test program with data extracted from *.dbc file (created by another team under Vector CANdb++).
These files contains all CAN frame definition
and also some extra information added to :
Message level,
Signal level,
Network Level
These extra information are set by using specific ATTRIBUTE DEFINITIONS - FUNCTIONALITY under Vector CANdb++
The opening of the DataBase works under NI-XNET DataBase Editor as in LabWindows using: nxdbOpenDatabase ( ... )
No attribute seems be displayable under the NI-XNET DataBase Editor (it's not a problem for me)
Now, how, using the NI-XNET API and CVI, be able to extract these specially created attributes ?
Thanks in advance.
PS : In attached picture, a new attribute called Test_NI, connected to a message
Attachments:
EX1.jpg 36 KBHi Damien,
To answer your question on whether the XNET API on LabWindows/CVI allows you to gain access to the custom attributes in a DBC file, this is not a supported feature. The DBC format is proprietary from Vector. Also, custom attributes are different for all customers and manufacturers. Those two put together make it really difficult for NI to access them with an API that will be standard and reliable.
We do support common customer attributes for cyclic frames. This is from page 4-278 in the XNET Hardware and Software Manual :
"If you are using a CANdb (.dbc) database, this property is an optional attribute in the file. If NI-XNET finds an attribute named GenMsgSendType, that attribute is the default value of this property. If the GenMsgSendType attribute begins with cyclic, this property's default value is Cyclic Data; otherwise, it is Event Data. If the CANdb file does not use the GenMsgSendType attribute, this property uses a default value of Event Data, which you can change in your application. "
Link to the manual : http://digital.ni.com/manuals.nsf/websearch/32FCF9A42CFD324E8625760E00625940
Could you explain us the goal of this attribute, and what you need it on your application.
Thanks,
Christophe S.
FSE East of France І Certified LabVIEW Associate Developer І National Instruments France -
Extracting unique values from (non-category) columns for chart
Hello:
I've created a worksheet to keep inventory of my Intellivision games. It has the following columns:
Publisher
Class
Network
Title
Quantity
(misc...)
The "Class" represents whether the game is "complete in box" or "loose cartridge." The "Network" represents the general genre or game cateogory. The quantity is how much I have of each.
I have set the first three columns as categories: Publisher, Class, and Network. I also created a bar chart based on the Title and Quantity columns, to show how many I have of each.
The problem I have is that, although it looks real cool and helps me keep the games organized, since a title can appear in more than one "Class" (e.g., I can have one in box, and two loose), the chart includes duplicates, and they are not grouped together.
Is there a way that I can create a graph (or a secondary table) that exctracts only the UNIQUE values from a column that may contain duplicates?
Note that I don't want to put the "Title" column in a category. I want to group by the three major categories and list the games on each.
-dZ.From the Numbers Help Menu, download the Numbers User Guide. Read the first three or four chapters to get a feel for the app. It's well written and won't take long to read that much.
Then use the Table of Contents and the Search tool to get additional specific directions.
First, delete all unneeded Rows and Columns from your data table. If you have patches of data in a larger table, Cut the patches and Paste them to a blank Sheet area to create separate dedicated tables for your various needs. These small special purpose tables are like Named Ranges in Excel. Name them in the Sheets Pane.
This is how Numbers was intended to be used. The User Guide will describe how to reference cells in one table from expressions in another table. If you use the point and click method of creating references from within the equation editor it won't matter a bit that the tables are separate.
Come back here for specific help on anything you are having trouble with.
Jerry -
Hi
I have SPGridView control (fetching value from DB) with a column which is having multiple values
in single row seperated by ";", whenever filter applied it show these values in single row but i want
to dispaly these values separately in diff. rows when column filter is applied.
I have exactly same req. as mentioned in http://sadomovalex.blogspot.in/2011/03/spgridview-with-filtering-by-multiple.html
but this solution didn't work for me.
Please help/suggest.Hi Erland,
Thank you very much for the answer. Sorry I had to be more accurate on my XML : This XML is in a SQL Server Table column. This table also has an id column. It will be great if you can answer specifically to this.
<RootNode>
<Node1>
<Line_id_Node>1 </Line_id_Node>
<A>
<B>
<D>Val1 </D>
</B>
<B>
<D>Val2 </D>
</B>
<B>
<D>Val3 </D>
</B>
</A>
</Node1>
<Node1>
<Line_id_Node> 2 </Line_id_Node>
<A>
<B>
<D>Val4 </D>
</B>
<B>
<D>Val2 </D>
</B>
</A>
</Node1>
<Node1>
<Line_id_Node> 3 </Line_id_Node>
<A>
<B>
<D>Val5 </D>
</B>
</A>
</Node1>
</RootNode>
Expected O/P:
Line_id_Node Column_D
1 1
val1, val2, val3
2 2
val4, val2
3 3
val5
Nichesl
Maybe you are looking for
-
My friend has two ipods. Two Apple ID's and on one ipod he has a free text app on it and only Message on the other. He cannot receive a message from my iphone 4S on the one with Message, but receives it fine on the one with the free text app. He ca
-
How do I transfer pages from imac to macbook?
I have a new to me MacBook and wish to have just pages to create documents. I have already purchased Pages for my iMac. Any suggestions?
-
If i use a single value in the 1x array, I get a random pulse, Im assuming I need to do an infinite population of the array to give me a dc current? Any ideas
-
Adding memory myself easy or?
I have only 2GB on my Intel iMac, 24" Would like to uograde to say 4 or 6GB. Can I do this myself?
-
Using InDesign CC, it has been working fine then today when I try and drag a type box it automatically goes to 21" and I can not type into it.