Hi
I am using h2 database with mode as oracle ,  so need to define create
alias for Oracle function to_number
On running the JUnit test case, the error comes : Invalid SQL script for
the create alias statement.

Am I missing any dependency.
I have added dependency of H2 database. Am able to setup schema using
create table also

Or can anyone suggest any alternative to functions like to_number and
initcap that are Oracle support.


On Sat, 29 Oct, 2022, 6:52 pm 'Mark Raynsford' via H2 Database, <
[email protected]> wrote:

> On 2022-10-29T18:38:19 +0700
> Andreas Reichel <[email protected]> wrote:
> >
> > Well, it depends what you want.
> > But your MAP key should be corresponding with your Table PRIMARY KEY.
> >
> > If you have a compound Primary Key, then your Map also must have a
> > compound Key (not just an Integer) and you would likely need to build a
> > Key Class implementing Comparable, Equals and Hash.
>
> I understand that, I think we may have gone down the wrong fork in the
> road. :)
>
> My question is about being able to declare one or more maps in a way
> that will permit efficient (ie, not O(N)) to a subset of the keys in
> a map.
>
> Let's assume then that I have this as a composite primary key:
>
>   record GroupMember(int group, int member);
>
> And I have a map:
>
>   MVMap<GroupMember, GroupMember> m;
>
> This matches the definition of the `t` table I posted in the original
> email; the primary key and the row are the same value.
>
> How, then, do I efficiently ask for all rows that have a given group
> value g?
>
> I would have to do something like this:
>
>   var members = new ArrayList<Integer>();
>   for (var entry : m.entrySet()) {
>     if (entry.getKey().group() == g) {
>       members.add(entry.getKey().member());
>     }
>   }
>   return members;
>
> This works, but is O(N) in the size of the map, whereas it _could_ be
> O(1) (assuming that map access are O(1)) if I could declare the map
> as being something analogous to:
>
>   MVMap<Integer, Set<Integer>> m;
>
> I assume that I'm _not_ supposed to do this, given that MVStore doesn't
> come with DataType definitions for any collection types.
>
> Now obviously H2 is using MVStore internally for database tables, and
> there it's obviously possible to have something like:
>
>   create table t (group integer not null, member integer not null);
>   create index t_groups on t (group);
>
> ... and then have "SELECT * FROM t where t.group = ?" be an indexed
> scan instead of a seq scan over the entire t table... But what exactly
> would an equivalent MVStore configuration look like?
>
> --
> Mark Raynsford | https://www.io7m.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/h2-database/20221029132144.3b269aa0%40sunflower.int.arc7.info
> .
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/CAK_22rZUn2CHMAgY-%3DcgA5tPv9%3D-jZz6ipkjqt0dawwONxr2ow%40mail.gmail.com.

Reply via email to