I have an existing working query that selects a column from an entity mapped to an Oracle View using the following JPQL
SELECT COUNT(o.id) FROM MyEntityView o
I refactored it to use the JPA 2 Criteria API with the following code:
MyEntityView model = new MyEntityView();
CriteriaBuilder criteriaBuilder = model.entityManage...
Hello everyone,
I have a table showing trains with their destination and departure time. My objective is to list the latest destination (MAX departure time) for each trains.
So for example the table is
Train Dest Time
1 HK 10:00
1 SH 12:00
1 SZ 14:00
2 HK 13:00
2 S...
Hi, I need to create some roles (I don't know how to call it correctly, so I'll name it 'role :)) on SQL Server and Oracle, and I really don't know much about both DB servers, so I don't know what I should look for.
I need to create 2 roles:
users who can only filter data from tables (SELECT).
users who can modify data (i.e. DELETE st...
Hi,
I'm selecting data from a table where one of 3 columns matches a given search string:
SELECT *
FROM CARS
WHERE MODEL LIKE searchString
OR MANUFACTURER LIKE searchString
OR DESCRIPTION LIKE searchString
But I need to order the results depending on where the match was found, based on a column weighting. I.e. if the match was found...
When I try to create an oracle stored procedure call with clob input and output in C#, I get the following error:
ORA-01036: illegal variable name/number\n
Here's the code itself:
OracleTransaction transaction = connection.BeginTransaction();
OracleCommand command = connection.CreateCommand();
command.Transaction = transaction;
comma...
I need to search a CLOB column and am looking for the best way to do this, I've seen variants online of using the DBMS_LOB package as well as using something called Oracle Text. Can someone provide a quick example of how to do this?
...
How should I write the following select in delphi:
select to_char(sysdate, 'dd.mm.yyyy hh:mm:ss) from dual
When I try to execute it I receive an error, but this works:
select to_char(sysdate) from dual
Thanks in advance!
...
Hello
I'm using Oracle 10.2.0.4 server and we are testing Java Application Servers in order to chose the most appropriate for our needs. So far we managed to get OpenEJB and GlassFish working, but not JBoss.
We have a simple fat Java client connecting to a simple EJB 3.0 (stateless session bean), which in turn, tries to perform a simpl...
Assume a table named 'log', there are huge records in it.
The application usually retrieves data by simple SQL:
SELECT *
FROM log
WHERE logLevel=2 AND (creationData BETWEEN ? AND ?)
logLevel and creationData have indexes, but the number of records makes it take longer to retrieve data.
How do we fix this?
...
I am used to oracle and now been thrown T-SQL, I am doing a course shortly but can you help out until then.
I have a list that I need to group in minutes.
Sample of rowdate data
SELECT ROWDATE,count(rowdate)
FROM [mydb].[dbo].[mytable]
GROUP BY ROWDATE
order by 1
2010-08-16 15:01:18.110 1
2010-08-16 15:01:18.203 1
2010-08-16 15:01:18...
I have a requirement in which I need to capture data changes (not auditing) and life cycle states on inventory.
Technology:
Jave, Oracle, Hibernate + JPA
For the data changes, we have been given a list of data elements that are to be monitored. If the element changes we are to notify a given 3rd party vendor. What I want to do is mak...
I would like to achieve the following in a configurable manner (that is little or no code modification in order to change behavior) :
Problem Statement :
a) For each part there are a set of key value pairs that can vary
b) The key is a static string label and the value can be one of (text, single select list of values)
c) The system ...
Like Microsoft SQL Server Management Studio for MSSQL?
...
Using:
select name, id
from "TEST"
where id :2
AND name :1
order by id desc
I am getting ORA: 00904 "TEST"."NAME": invalid identifier error but the wierd part is that I have checked my test table and it does not have NAME field but it has name field, I have also checked all the references which is made from that tabl...
hi,
I have a method SaveApp() which will deactivate the existing records and insert a new one.
void SaveApp(int appID)
{
begin transaction;
update;
insert;
commit transaction;
}
Let's say in database table SalesApp, I have 2 records with appID equal to 123;
record 1, appID 123, inactive
record 2, appID 123, active
I...
I am new at working with oracle, my only experience is in sql server. In SQL server you can right click a table and say export create script. I need that for Oracle, specifically 10g. Is there a way via GUI or sql command that can accomplish this?
...
This is a shot from Google BigTable paper
What can be the kind of scenarios in which instead of having something like Oracle's redo logs, I will need to store multiple versions of the same data within the database?
Coming specifically to this example, why do I need to store multiple versions of a html page in my database? It cannot ...
I have a question in different Oracle versions. In their download page, there is Standard/Enterprise, and there is Express. Other than performance and other infrastructure tools, do the two different versions support the same set of SQL script keywords? For example, if I generate DDL tables from standard, is there a chance it may not wor...
How can i return 2 values from a PL-SQL function?
...
I know this question has been asked before but I have a design question as well.
There are two tables like so:
Table Group_table
column pk_Group_name
column group_type
etc
Table Group_members
column fk_group_name -> foreign key to group_table
column group_member
It's easy to work with this structure but I have two questions. First,...