Here is an example that behaves like the
generate_unique() function of DB2:
CREATE FUNCTION GENERATE_UNIQUE()
RETURNS CHAR(13) FOR BIT DATA PARAMETER STYLE JAVA NO
SQL LANGUAGE JAVA
EXTERNAL NAME 'com.mycompany.MyClass.generate_unique';
Here is the corresponding java function in MyClass:
Rajesh, do you not need to close your statement and
result set objects in a try-finally block? rs.close
and s1.close() would be needed, no? But you should NOT
close the connection, right?
Regards,
Ali
public static long returnBigInt() throws Exception
{
Connection conn =
add try and catch
here too, should you need
}
}
Do let me know if it is otherwise
-Rajesh
Suavi Ali Demir wrote:
Rajesh, do you not need to close your statement and
result set objects in a try-finally block? rs.close
and s1.close() would be needed, no? But you should
Ali Demir wrote:
Rajesh, do you not need to close your statement and
result set objects in a try-finally block? rs.close
and s1.close() would be needed, no? But you should
NOT
close the connection, right?
Regards,
Ali
public static long returnBigInt() throws Exception
connection in such cases, no?
Regards,
Ali
--- Daniel John Debrunner [EMAIL PROTECTED] wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Suavi Ali Demir wrote:
To clarify: You shoul NOT close the connection
that
you get from the URL jdbc:default:connection. This
is
not a new
Should the default value be a quoted string? 0 is
probably not valid as a default value here.
defaultpageid varchar(48) default 0 not null,
Ali
--- Nonick Me [EMAIL PROTECTED] wrote:
I'm trying to run the following SQL script. The
first table is created but not for the second table.
Will derby support default keyword as in:
create table a(
id int not null generated by DEFAULT as identity,
...
or something like that? That would solve these
problems as it would only generate values if we do not
specify the value.
Regards,
Ali
--- Trevor Squires [EMAIL PROTECTED] wrote:
The next import may be a table with foreign keys to
the first one. Sometimes (most of the time actually)
it is desireable to keep the original values in an
identity column.
Having to use generated always blocks many solutions
including import/export, replication/sync where key
space could be
You may need to use it in a values clause in the
trigger body:
VALUES(APPBUT_USER.TRIGGER_RESIZE(schema,table))
Regards,
Ali
--- Peter Nabbefeld [EMAIL PROTECTED] wrote:
Jean T. Anderson schrieb:
A trigger can't call a procedure, but it can call
a user-defined sql
function.
Could
Hi Paulo,
This asp page discusses different ways of doing what
you want:
http://www.aspfaq.com/show.asp?id=2120
One of the easy SQL ways discussed there is:
To fetch 5 rows at a time and get the 3rd page you
would use this sql:
SELECT
a.empno
FROM
employee a
After a shutdown=true, you should be able to connect to the same database again after doing aDriverManager.registerDriver( Class.forName(driverName).newInstance() )
Then, if the shutdown=true cleans up as you expect, that should work fine for you.
Regards,
SuaviLars Clausen [EMAIL PROTECTED]
Thanks for the clarification. Some applications might be actually registering the driver themselves. Whatare the problems that this might cause (if the app calls DriverManager.registerDriver() explicitly)?
Regards,
Suavi
Daniel John Debrunner [EMAIL PROTECTED] wrote:
Suavi Ali Demir wrote: After
Actually, it sounds like the problem of finding top 1000 rows out of 166333 rows is different than sorting 166333 rows and maybe it could be optimized. There is no need to sort all 166333 but the information that we are only looking 1000 rows would have to be passed all the way down to the point
thread cannot read the chunk structure whileanother is inserting a value into it... Come to think of it, it might run faster in single thread version when synchronization is not involved.
Regards,
Ali
Daniel John Debrunner [EMAIL PROTECTED] wrote:
Suavi Ali Demir wrote: Actually, it sounds like
Another little detail about optimization is that Statement.setMaxRows() kind of functions on the JDBC side may not be sufficientsince it iscalled after SQL statement is prepared and returned as an object (after query plan is built). Therefore, it may be necessary to have language syntax to
You can use varchar types and inside your saveDoc() function you can save the document in smaller chunksin multiple rows with an ORDERING column. Orcall it PAGE column. When you readDoc() you can assemble them back again. Table data will look like:
DOCID TEXT PAGE
1"Hello " 1
1 "World." 22
SELECT CASE WHEN COL1 is NULL THEN0 ELSE1 END FROM MYTABLE
Regards,
AliNicolas Dufour [EMAIL PROTECTED] wrote:
HelloI try to put tests in select clause.I mean I have a field which can be null and I want to create a select which return 0 when the field is null and 1 in the other case.Is it
update card set anythingyourwant where card.name in (
select c.namefrom edition as e, card_version as cv, card as c, edition as e2,session.load_card as lcwhere e.edition_id = cv.edition_id and c.card_id = cv.card_id and c.name = lc.name and c.card_id is not null and e.release_date
Hello,Does anybody know why the JDBC method: PreparedStatement.setBinaryStream(s,size)requires the caller to pass in the length of the stream?Regards, Ali
Hi Jim,How much memory did your colleagues start the JVM with when they evaluated Derby?Regards, AliJim Newsham [EMAIL PROTECTED] wrote: Rajesh,Thanks for the update on DERBY-756. Regarding DERBY-912, I recognize that it¡¯s a subtask of 756, nevertheless 756 is
derby:net is to connect to the network server, which could be running on another machine. ithas host:port to connect to. You start the derby network server and it runs as a database server to serve many clients.jdbc:derby:dbname is used to connect to a local database in embedded mode (derby
Instead of "dual", in IBM lingo,i believe that table is calledSYSIBM.SYSDUMMY1. For example to test a connection you can use: SELECT 1 FROM SYSIBM.SYSDUMMY1or yours would be:SELECT CURRENT_TIMESTAMP FROM SYSIBM.SYSDUMMY1VALUES(1) would work in DB2/LUW butnot work in OS/390 for
if it is a forward only cursor, when you do a select * and loop through all rows and doSomething() with each row (and not hold a reference tothe data yourself), there would be only 1 row's data in memory at a given time, no? (or few rows if Derby prefetches in chunks as you do rs.next()) [EMAIL
Add a new column to the table, copy the data into new column, change your view (drop-create)to start using the new column and ignore the old column in the table. Ali Edson Carlos Ericksson Richter [EMAIL PROTECTED] wrote: Just curious, how could a view change datatype of one column?AFAIK, I can
That query needs to be modified little bit. It does notwork when my table contains:1 1 12 2 21 1 3result is 3,3,3, where as it should have been 2,2,3.This one works:SELECT (SELECT COUNT(DISTINCT b.field1) FROM table_a b) as field1_count, (SELECT
It seems you want all the repeating values next to each other? Would a sort help? Does order by work? Regards, Ali Robert Enyedi [EMAIL PROTECTED] wrote: Does Derby support user functions in GROUP BY clauses?I'm thinking of the following scenario:SELECT USER_FUNCTION(t1.column1)FROM TABLE
export the mysql ddl and manually convert it to derby ddl.
create the derby database schema from this ddl.
export mysql tables into delimited text files.
import data from text files.
regards,
ali
Bryan Richardson [EMAIL PROTECTED] wrote:
Hello all,
Can anyone tell me how I can
drop the table and ignore the does not exist error.
regards,
ali
Brad Berens [EMAIL PROTECTED] wrote:
I've googled for this but all I can find is create statements so I'm hoping
someone can just give me a quick answer. I'm trying to write some db creation
scripts. Normally in MSSQL I
By the way, while deciding whether a value x== Double.Nan or not, you probably
cannot use == operator (may never be true). But if you compare string versions,
they should equal (NaN).
Ali
Suavi Ali Demir [EMAIL PROTECTED] wrote:
Can you make your column nullable and insert null instead
Have a table where you have 1 row that marks the relationship between two
clients. Like a cartesian product:
A, B
A, C
A, D
B, A
B, C
B, D
..and so on.
Have all clients have their dedicated connection acquire locks on these rows.
Each lock represents a client that may
How much memory do you give to your JVM?
Ali
John English [EMAIL PROTECTED] wrote:
I have a table containing about 22000 records defined as follows:
CREATE TABLE system_log (
id INTEGER GENERATED ALWAYS AS IDENTITY,
time TIMESTAMP DEFAULT NULL,
username VARCHAR(15),
facility VARCHAR(15) NOT
in derby's bin directory there is a startNetworkServer.bat
regards,
ali
wotcha [EMAIL PROTECTED] wrote:
Sorry if this has already been posted, but I'm a new Derby user. i've created
an application using Netbeans 6.0 and embedded Derby DB - using the tutorial
supplied by Netbeans - very
If 100 is not absolute necessity, you can give datetime ranges. For example select 1 hour of logs at a time.
Ali
--- On Tue, 5/13/08, Matt Chambers [EMAIL PROTECTED] wrote:
From: Matt Chambers [EMAIL PROTECTED]Subject: top N reporting with derbyTo: derby-user@db.apache.orgDate: Tuesday, May 13,
for case insensitive index, you can have another column that holds lower-case
version of your original column. you can create an index on that lowercase
column and use it in your sql. you can use triggers to maintain the lowercase
column.
ali
--- On Mon, 6/23/08, Alan Burlison [EMAIL
Does the same happen if you use single thread? Does disk space use go down if
you compress table?
Should the
word=word.trim().toLowerCase();
appear before setString?
When you store the frequency of words, you would have records like:
home, 1217
Then the number of rows would not exceed
Google App Engine does not seem to be using a relational database. It looks
like a hashtable. Joins are not possible. In other words, yes some relational
database functionality is not possible to be scalable at the prices Google
offers. So Google does not provide a relational database. But this
You should have an index.
--- On Sun, 10/19/08, Amir Michail [EMAIL PROTECTED] wrote:
From: Amir Michail [EMAIL PROTECTED]
Subject: Re: Most efficient way to get max row id?
To: Derby Discussion derby-user@db.apache.org
Date: Sunday, October 19, 2008, 9:18 PM
On Mon, Oct 20, 2008 at 12:15
Insert the string value into the table. Language does not matter.
Regards,
Ali
--- On Sun, 11/2/08, Graeme Henderson [EMAIL PROTECTED] wrote:
From: Graeme Henderson [EMAIL PROTECTED]
Subject: chinese text
To: derby-user@db.apache.org
Date: Sunday, November 2, 2008, 2:57 PM
What is the
Plz leave catalog as null.
Ali
--- On Sun, 11/9/08, Ole Ersoy [EMAIL PROTECTED] wrote:
From: Ole Ersoy [EMAIL PROTECTED]
Subject: Re: DatabaseMetaData.getTables() resultset empty?
To: Derby Discussion derby-user@db.apache.org
Date: Sunday, November 9, 2008, 8:29 PM
Ali,
I had percentage
Try % instead of null.
Ali
--- On Sun, 11/9/08, Ole Ersoy [EMAIL PROTECTED] wrote:
From: Ole Ersoy [EMAIL PROTECTED]
Subject: Re: DatabaseMetaData.getTables() resultset empty?
To: Derby Discussion derby-user@db.apache.org
Date: Sunday, November 9, 2008, 8:12 PM
Emmanuel,
I gave it a go.
Try something like this:
select house_number, street, city from table (legacy_realty_data('house_number,
street, city where price 50'))
then parse the string passed to your table function and implement a way to push
down those predicates to your backend to only retrieve what is needed.
41 matches
Mail list logo