verwendetes Datenbanksystem: <SQLite>
Hi,
ich schreibe gerade eine H2 Database in SQLite mit C Sharp um.
ich muss ein VIEW in die SQLIteDatabase einführen, in dem ein ALIAS benutzt wird, der auf eine Methode in JAVA verweist.
CREATE ALIAS methode_a FOR "JAVA_CLASS.methode";
public class JAVA_CLASS
{
public static final Integer methode_a (final Integer go_Value, final Integer
schieber_Value, final int offset_Value)
{
int xy = schieber_Value.intValue() << offset_Value;
return new Integer(go_Value| xy);
}
}
create view if not exists VIEWA as
select
id,
TabelleY_ID as eSpalteY,
F_LABEL as pType,
Ananas_Index as xSpalte,
methode_a (methode_a (methode_a (methode_a (0, A, 2), T, 3), B, 4) , R, 6) as eSpalte,
Brot_Text as cMehl
from
(
SELECT
x.id as id,
y.Number as TabelleY_ID ,
IFNULL(B, 0) as B,
IFNULL(A, 0) as A,
IFNULL(F_LABEL , '') as F_LABEL ,
IFNULL(Ananas_Index , 0) as Ananas_Index ,
IFNULL(T, 0) as T,
IFNULL(Brot_Text , '') as Brot_Index ,
(CASE
WHEN x.Spaltecv= true THEN 1
ELSE 0
END) as R
from TabelleX x left join TabelleY y on x.TabelleY_ID = y.id
)
CREATE TABLE `TabelleX `
(
`ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`Ananas_Index ` INTEGER,
`A` NUMERIC,
`T` NUMERIC,
`R` NUMERIC,
`Brot_Index ` TEXT
)
CREATE TABLE `TabelleY `
(
`ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT
)
-Kann man in SQLITE ein ALIAS auch auf eine C Sharp-Methode setzen?
-Oder muss muss man die Methode-LOGIK in SQLITe schreiben und in dem View einfügen?
-Oder muss man einen Trigger in der SQlite-DB, der auf dem VIEW verweist.Und dann ausgeführt wird, wenn im VIEW Zeilen inserted werden.
Ich hoffe mir kann jemand weiterhelfen.
Gruß