Skip to content

Commit dd4ac19

Browse files
committed
pushing more sqls
1 parent 88d794e commit dd4ac19

10 files changed

+106
-0
lines changed

function/ts/insertfaciestypes.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CREATE OR REPLACE FUNCTION ts.insertfaciestypes(_facies character varying)
2+
RETURNS integer
3+
LANGUAGE sql
4+
AS $function$
5+
INSERT INTO ndb.faciestypes (facies)
6+
VALUES (_facies)
7+
RETURNING faciesid
8+
$function$;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CREATE OR REPLACE FUNCTION ts.insertfractiondated(_fraction character varying)
2+
RETURNS integer
3+
LANGUAGE sql
4+
AS $function$
5+
INSERT INTO ndb.fractiondated (fraction)
6+
VALUES (_fraction)
7+
RETURNING fractionid
8+
$function$;

function/ts/insertgeochron.sql

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
CREATE OR REPLACE FUNCTION ts.insertgeochron(_sampleid integer,
2+
_geochrontypeid integer,
3+
_agetypeid integer,
4+
_age float = null,
5+
_errorolder float = null,
6+
_erroryounger float = null,
7+
_infinite smallint = 0,
8+
_delta13c float = null,
9+
_labnumber character varying = null,
10+
_materialdated character varying = null,
11+
_notes character varying = null)
12+
RETURNS integer
13+
LANGUAGE sql
14+
AS $function$
15+
INSERT INTO ndb.geochronology (sampleid, geochrontypeid, agetypeid, age, errorolder, erroryounger, infinite, delta13c, labnumber, materialdated, notes)
16+
VALUES (_sampleid, _geochrontypeid, _agetypeid, _age, _errorolder, _erroryounger, _infinite, _delta13c, _labnumber, _materialdated, _notes)
17+
RETURNING geochronid
18+
$function$;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE OR REPLACE FUNCTION ts.insertgeochroncontrol(_chroncontrolid integer, _geochronid integer)
2+
RETURNS void
3+
LANGUAGE sql
4+
AS $function$
5+
INSERT INTO ndb.geochroncontrols (chroncontrolid, geochronid)
6+
VALUES (_chroncontrolid, _geochronid)
7+
$function$;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE OR REPLACE FUNCTION ts.insertgeochronpublication(_geochronid integer, _publicationid integer)
2+
RETURNS void
3+
LANGUAGE sql
4+
AS $function$
5+
INSERT INTO ndb.geochronpublications (geochronid, publicationid)
6+
VALUES (_geochronid, _publicationid)
7+
$function$;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CREATE OR REPLACE FUNCTION ts.insertgeopoliticalunit(_geopolname character varying,
2+
_geopolunit character varying,
3+
_rank integer,
4+
_higherid integer)
5+
RETURNS integer
6+
LANGUAGE sql
7+
AS $function$
8+
INSERT INTO ndb.geopoliticalunits (geopoliticalname, geopoliticalunit, rank, highergeopoliticalid)
9+
VALUES (_geopolname, _geopolunit, _rank, _higherid)
10+
RETURNING geopoliticalid
11+
$function$;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
CREATE OR REPLACE FUNCTION ts.insertisoinstrumention(_datasetid integer,
2+
_variableid integer,
3+
_isoinstrumentationtypeid integer = null,
4+
_isosampleintrosystemtypeid integer = null,
5+
_insterrorpercent float = null,
6+
_insterrorrunsd float = null,
7+
_insterrorlongtermpercent float = null,
8+
_notes character varying = null
9+
)
10+
RETURNS void
11+
LANGUAGE sql
12+
AS $function$
13+
INSERT INTO ndb.isoinstrumentation (datasetid, variableid, isoinstrumentationtypeid, isosampleintrosystemtypeid,
14+
insterrorpercent, insterrorrunsd, insterrorlongtermpercent, notes)
15+
VALUES (_datasetid, _variableid, _isoinstrumentationtypeid, _isosampleintrosystemtypeid, _insterrorpercent, _insterrorrunsd, _insterrorlongtermpercent, _notes)
16+
$function$;

function/ts/insertisometadata.sql

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CREATE OR REPLACE FUNCTION ts.insertisometadata(_dataid integer,
2+
_isomatanaltypeid integer = null,
3+
_isosubstratetypeid integer = null,
4+
_analystid integer = null,
5+
_lab character varying = null,
6+
_labnumber character varying = null,
7+
_massmg float = null,
8+
_weightpercent float = null,
9+
_atomicpercent float = null,
10+
_reps integer = null
11+
)
12+
RETURNS void
13+
LANGUAGE sql
14+
AS $function$
15+
INSERT INTO ndb.isometadata(dataid, isomatanaltypeid, isosubstratetypeid, analystid, lab, labnumber, mass_mg, weightpercent, atomicpercent, reps)
16+
VALUES (_dataid, _isomatanaltypeid, _isosubstratetypeid, _analystid, _lab, _labnumber, _massmg, _weightpercent, _atomicpercent, _reps)
17+
$function$;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE OR REPLACE FUNCTION ts.insertisosamplepretreatments(_dataid integer, _isopretreatmenttypeid integer, _order integer, _value float = null)
2+
RETURNS void
3+
LANGUAGE sql
4+
AS $function$
5+
INSERT INTO ndb.isosamplepretreatments(dataid, isopretreatmenttypeid, "order", value)
6+
VALUES (_dataid, _isopretreatmenttypeid, _order, _value)
7+
$function$;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE OR REPLACE FUNCTION ts.insertisospecimendata(_dataid integer, _specimenid integer, _sd float = null)
2+
RETURNS void
3+
LANGUAGE sql
4+
AS $function$
5+
INSERT INTO ndb.isospecimendata(dataid, specimenid, sd)
6+
VALUES (_dataid, _specimenid, _sd)
7+
$function$;

0 commit comments

Comments
 (0)