Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
65 views

I have prepared a DB fiddle for my questions and also list my SQL code below. I have created a countries_boundaries table, which I intend to fill with .poly files provided at Geofabrik: CREATE ...
Alexander Farber's user avatar
-1 votes
1 answer
45 views

Is it possible to change this stored procedure to a stored function? I created the procedure thinking it was a requirement for my coursework, when in fact I need a stored function. I'd rather not ...
CannonJacks's user avatar
0 votes
0 answers
35 views

I am trying to create a stored function that checks to see if an exact string has been used already. This function that I have created always returns FALSE though, even when I set the RETURNS datatype ...
Cloud_Envy's user avatar
0 votes
1 answer
71 views

I need to make some tables which are able to auto-increment unique document names for each month of the year based on the date of each documnet type. I think it will be a good idea to make it as a ...
Lasse Staalung's user avatar
0 votes
1 answer
52 views

Consider the following statement: create function get_most_frequent_topic(out topic_id integer) as $$ begin select p.topic_id into topic_id, count(*) as freq from post p ...
Cody's user avatar
  • 2,691
0 votes
1 answer
116 views

I do have troubles with my sql scripts which I've wrote priorely and try to read with my python code and also execute it. Here my simple mysql script, where the DELIMITER command is removed: DROP ...
AbdoCherry's user avatar
1 vote
1 answer
863 views

My function is like this: CREATE OR REPLACE FUNCTION insert_o_record_desc() RETURNS text LANGUAGE 'plpgsql' AS $$ DECLARE o_record TEXT DEFAULT ''; rec_o_record RECORD; cur_o_record CURSOR ...
butching's user avatar
  • 342
0 votes
2 answers
436 views

In an SQL function I want to create multiple records based on the parameters passed into the function, for example the function takes a member primary ID, a date/time stamp and a number specifying the ...
SPlatten's user avatar
  • 5,861
-3 votes
2 answers
62 views

Can someone review my code and guide me what did I do wrong? I managed to create stored function. However, after selecting, the only result for hotellevel is silver. CREATE FUNCTION HotelLevel ( @...
user avatar
0 votes
1 answer
120 views

Unlike stored procedures, which can explicitly start & commit transactions, stored functions can't contain "Statements that perform explicit or implicit commits or rollbacks". ...
sp3ctre's user avatar
0 votes
1 answer
822 views

I have a postgres query within my springboot app that needs to return a list with each element (being an array) containing 2 items from 2 different tables. The entities for each table are as follows: ...
Joe's user avatar
  • 425
1 vote
2 answers
699 views

Considering a BigQuery view that has one column ARRAY<STRUCT<col1 FLOAT, col2 FLOAT>> called X. Which is the best way to retrieve those rows with an additional column that is a computation ...
Yak O'Poe's user avatar
  • 822
0 votes
1 answer
798 views

We are working with Azure Data Factory and there is this pipeline in which I am trying to check the response of an API which reports a pipeline status. If it returns 'InProgress', I want to wait for ...
SouravA's user avatar
  • 5,263
0 votes
1 answer
157 views

I am trying to write a simple stored function in PostgreSQL . This function will receive two parameters . (details jsonb & provider_details jsonb[] ) . details jsonb example :- {"category&...
noobdev6576576's user avatar
0 votes
0 answers
26 views

I need to turn this request to the function SELECT object_id, brigade_code, date_and_time FROM purpose WHERE date_and_time BETWEEN '2022-06-15 16:20:23' AND '2022-10-03 18:12:45'; My best attempt ...
Hachaika's user avatar
0 votes
1 answer
208 views

I want to change the postgresql queries to stored procedures in Nodejs. app.post("/add", async(req, res) => { try { const { name, email, hobby } = req.body; const newStudent = ...
Ashley Ferns's user avatar
0 votes
1 answer
508 views

I am creating a stored function in MYSQL Workbench that takes a date and returns the quarter of that fiscal year. I came up with the following code script. The SQL Editor checked the statements and ...
Rama 's user avatar
  • 85
0 votes
1 answer
13 views

`DELIMITER // CREATE FUNCTION am_or_pm (crying_time TIME) RETURNS varchar(20) DETERMINISTIC BEGIN DECLARE am_or_pm varchar(20) IF crying_time <= "11:59:00" THEN set am_or_pm = 'AM'; ...
ADN's user avatar
  • 1
0 votes
0 answers
72 views

I have a function which is accepting an id from type varchar. The id represents the pk. But sometimes the pk consists more of two parameters. So is it possible to make the function more generic and ...
DB2fan's user avatar
  • 21
0 votes
1 answer
1k views

I am trying to create either a function or a stored procedure in a Postgres database. I don't really know the syntax in Postgres. I am trying the following, but I know it is not complete. Create or ...
Chiefster's user avatar
0 votes
0 answers
53 views

I am trying to automate mathematic formulas that I need to run many times over a dataset for a view page. I have used the SELECT INTO function to successfully create these values. Below is an example ...
pronounced-seecuil's user avatar
0 votes
2 answers
685 views

I want to have an array of distinct integer values across my postgres table as the return value of a stored function. The stored function currently looks like this create or replace function ...
Thomas K.'s user avatar
  • 139
0 votes
0 answers
131 views

I'm trying to call stored function from node js using db.eval() and also provided the db connection and it is giving an error - Type Error: db.eval() is not a function. I'm facing difficulty while ...
Revathi S's user avatar
1 vote
2 answers
66 views

Here's what I've tried. My host is returning an error, "Sorry an unexpected error happened!" . I want it to return true if there is at least 1 record with combination pdriver_id, ...
Theb's user avatar
  • 162
0 votes
1 answer
54 views

Hi and thanks in advance for your help I am struggling to write a stored procedure in sql server to manipulate some records which are batch imported from a csv file without any particular order. Each ...
John 's user avatar

1
2 3 4 5
17