Good day
Below is the code which i use if i have 3 rows then it works but if i choose 1 record then i get a resultset error - CREATE or REPLACE FUNCTION public.upload_coll(
-
l_bilbatchno character(32),
-
p_filnam CHARACTER,
-
p_filnam1 CHARACTER,
-
p_filnam2 CHARACTER,
-
user_name CHARACTER
-
)
-
-
RETURNS BOOLEAN
-
LANGUAGE plpgsql
-
AS $$
-
-
DECLARE
-
l_uuid_32_long varchar(36);
-
l_uuid_32 varchar(32);
-
l_oid varchar(32);
-
p_matid varchar(15);
-
coltran_rec record;
-
-
BEGIN
-
-
if p_filnam is not NUll then
-
l_uuid_32_long := gen_random_uuid();
-
l_oid := replace(l_uuid_32_long, '-', '');
-
-
l_uuid_32_long := gen_random_uuid();
-
l_uuid_32 := replace(l_uuid_32_long, '-', '');
-
-
select * into coltran_rec from acc.coltran where bilbatchno = l_bilbatchno;
-
-
update acc.coltran set docstored = l_uuid_32, docname1 = p_filnam where bilbatchno = l_bilbatchno;
-
-
INSERT into public.oxfiles
-
(id, data, name)
-
VALUES
-
(l_uuid_32, pg_read_binary_file(p_filnam), p_filnam);
-
end if;
-
-
if p_filnam1 is not Null then
-
l_uuid_32_long := gen_random_uuid();
-
l_oid := replace(l_uuid_32_long, '-', '');
-
l_uuid_32_long := gen_random_uuid();
-
l_uuid_32 := replace(l_uuid_32_long, '-', '');
-
-
select * into coltran_rec from acc.coltran where bilbatchno = l_bilbatchno;
-
-
update acc.coltran set docstored1 = l_uuid_32, docname2 = p_filnam1 where bilbatchno = l_bilbatchno;
-
INSERT into public.oxfiles
-
(id, data, name)
-
VALUES
-
(l_uuid_32, pg_read_binary_file(p_filnam1), p_filnam1);
-
-
end if;
-
-
-
if p_filnam2 is not Null then
-
l_uuid_32_long := gen_random_uuid();
-
l_oid := replace(l_uuid_32_long, '-', '');
-
l_uuid_32_long := gen_random_uuid();
-
l_uuid_32 := replace(l_uuid_32_long, '-', '');
-
select * into coltran_rec from acc.coltran where bilbatchno = l_bilbatchno;
-
-
update acc.coltran set docstored2 = l_uuid_32,docname3 = p_filnam2 where bilbatchno = l_bilbatchno;
-
-
INSERT into public.oxfiles
-
(id, data, name)
-
VALUES
-
(l_uuid_32, pg_read_binary_file(p_filnam2), p_filnam2);
-
-
end if;
-
return true;
-
END
-
$$;
0 1602 Sign in to post your reply or Sign up for a free account.
Similar topics
by: crispy |
last post by:
On this page, you'll see that some PubID's are repeated several times:
http://www.ihea.info/pages/website/test1.asp
That's because some records have more than one attribute. For example,
Title...
|
by: chris vettese |
last post by:
I've been searching for a few days and have't found the solution I'm
looking for. I want to create the following in my form's
header...Material: 1 of 15. The first number will change as the user...
|
by: snOOp |
last post by:
I am trying to combine the data from two similar tables into one
query, but I need for all of the records from both tables to show up
and I want the ones that have matching 'emplid' to be combined...
|
by: Tom Kaminski [MVP] |
last post by:
I want to show a table of master records, with the right most column
displayed as a comma (or space) delimited list of details. The practical
application of this is a thesaurus, where the master...
|
by: Miguel Dias Moura |
last post by:
Hello,
i have a dataSet in an ASP.Net / VB page which connects to a database named
"DB" with fields AuthorName, BookTitle, BookEditor.
I want do display 4 records in my page as follows:...
|
by: William Buchanan |
last post by:
Hi folks
I want to show 2 records on a page side by side. Each record has an image
which will be displayed and a bit of text.
How can I do this?
Thanks
Will
|
by: Zeljko |
last post by:
I'm creating Address book.
Header of the main form (frmAddress) contains combo box (cboFilter) to
filter records by Occupation on main Form(Ocupation1). That's working. Combo
box also have "Show...
|
by: Otto |
last post by:
Hi
I'm migrating from Access til MySQL.
Works fine so far - but one thing is nearly killing me:
I got the count of total records in a variabel - (antalRecords)
I got the count for the Field Q1...
|
by: kdubble |
last post by:
Hi
I am trying to get the results of a query to show only unique student
records (not duplicates). Is there a simple way to make the criteria
field do this? I am not too familiar with SQL.
...
|
by: ali3n8 |
last post by:
I am using a search form that list records in my database. On the list that shows the records that have been found I have a field called First. When I double click on this field I would like to open...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |