Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
Institutional Coding
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AG Bibliometrie
Institutional Coding
Commits
a6ba4e09
Commit
a6ba4e09
authored
5 months ago
by
Christopher Lenke
Browse files
Options
Downloads
Patches
Plain Diff
23.09.2024
parent
91c89698
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Functions/get_adr_id_b_pg_varchar__varchar_.txt
+30
-0
30 additions, 0 deletions
Functions/get_adr_id_b_pg_varchar__varchar_.txt
with
30 additions
and
0 deletions
Functions/get_adr_id_b_pg_varchar__varchar_.txt
0 → 100644
+
30
−
0
View file @
a6ba4e09
-- DROP FUNCTION schema_xyz.get_adr_id_b_pg(varchar, varchar);
CREATE OR REPLACE FUNCTION schema_xyz.get_adr_id_b_pg(address_full_in character varying, city_in character varying)
RETURNS bigint
LANGUAGE plpgsql
AS $function$
DECLARE
/*
Returns an adr_id value for an address based on the result_II table (which must contain address_full, city and adr_id).
*/
DECLARE
ergebnis bigint;
BEGIN
select /*+ parallel(auto) */ distinct(adr_id) into ergebnis
from schema_xyz.result_II a
join schema_xyz.result_I b
on a.address_full=b.address_full and coalesce(a.city,'0')=coalesce(b.city,'0')
where b.address_full_original=address_full_in and coalesce(b.city_original,'0')=coalesce(city_in,'0');
return ergebnis;
END;
$function$
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment