This document was generated from CDN thread
Created by: Janine Graves on 07-07-2008 04:45:34 PM
Any idea why the database element wouldn't be creating element data?
for example, I did 'select count(*) numrecs from mytable' which should always return element data with the number of records matching the query. But no data was created and no errors reported.
If I use a bad table name then I get an error message, so I know tomcat is hitting the database.
FYI, this is an oracle integration using jndi. And this is being done in Tunisia and the encoding types on the oracle server are - AR8ISO8859P6 and AL16UTF16
tomcat 5.5.16, oracle 9i
Thanks, Janine
Subject: Re: database element not creating element data
Replied by: Elam Birnbaum on 16-07-2008 02:47:19 PM
Hi Janine,
I am not sure that would work with the Database element because it stores element data based on the name of the column that is returned by the query and the value or values returned. Since this query does not actually return a value in a column and instead returns a value that is not associated with a column, no element data would be created. That said, it looks like you are including a column name in the query, though I am not sure how that affects the result and whether the count would be associated with it.
Basically the Database element works with your standard queries but when you start getting into things like stored procedures it would work but not store any element data. There are some types of stored procedure calls that would best be done with a custom element or a standard action element.
Hope this helps.
Subject: Re: database element not creating element data
Replied by: Ranjana Narayan on 18-07-2008 05:51:52 AM
Hi Elam,
The query "select count(*) as numrecs from table" would return a single value with the column name set as numrecs. Here numrecs is used as an alias in the query. Hence the elementdata created would be "numrecs".
Latest heard from Janine, that for her set up in Oracle the elementdata created was "NUMRECS" in uppercase.
Cheers,
Ranjana.
Subject: RE: database element not creating element data
Replied by: Fabien Damien on 05-08-2009 12:02:34 PM
Hi Janine,
Were you able to find a solution for your oracle problem? I'm facing the same issue, please help if you have found the solution,
regards,
Subject: RE: database element not creating element data
Replied by: Ranjana Narayan on 07-08-2009 05:25:05 AM
While using Oracle DB the returned session/elementdata would be uppercased, hence use <DBElementName>.NUMRECS instead of <DBElementName>.numrecs.