473,289 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

postgress [42883]: ERROR

1
i tried create storeprocedure in postgress 13, when i set up with parameter and call. there is some error 42883

CREATE OR REPLACE PROCEDURE public.logavlunit(pavl_unit_id character varying, pvehicle_id integer, pvehicle_number character varying, pregistration_number character varying, pdevice_type smallint, pserver_port integer, pserver_address character varying DEFAULT NULL::character varying(50))
LANGUAGE plpgsql
AS $procedure$

DECLARE
v_LogId int;
v_RegistrationNumber varchar(50);
v_VehicleId int;
v_VehicleNumber varchar(50);
v_DeviceType smallint;
v_DateTime timestamp(3);
BEGIN

v_DateTime := NOW();

SELECT id, registration_number, vehicle_id, vehicle_number, device_type INTO v_LogId, v_RegistrationNumber, v_VehicleId, v_VehicleNumber, v_DeviceType
FROM avl_unit_log
WHERE avl_unit_id=pavl_unit_id AND existing=1;

IF v_VehicleId = pvehicle_id AND v_VehicleNumber = pvehicle_number AND v_RegistrationNumber = pregistration_number AND v_DeviceType = pdevice_type
THEN
UPDATE avl_unit_log
SET last_report_time=v_DateTime, server_port=pserver_port, server_address=pserver_address
WHERE id=v_LogId;
ELSE
IF v_LogId IS NOT NULL
THEN
UPDATE avl_unit_log SET existing=0
WHERE avl_unit_id=pavl_unit_id AND existing=1;
END IF;
INSERT INTO avl_unit_log (avl_unit_id, vehicle_id, vehicle_number, registration_number,
device_type, first_report_time, last_report_time, server_port, server_address, existing)
VALUES (pavl_unit_id, pvehicle_id, pvehicle_number, pregistration_number,
pdevice_type, v_DateTime, v_DateTime, pserver_port, pserver_address, 1);
END IF;
END
$procedure$
;


CALL public.logavlunit('354018111122143',34637914,'TM10 ','19.232529.7',5000,60109,null)
Jul 26 '21 #1
0 3261

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
0
by: Greg Lindstrom | last post by:
Hello, All- I am running Python 2.3 on a Windows XP box and would like to access a postgres database running on a Linux fileserver. I've googled for Python and Postgres but most of the stuff I...
1
by: Liza | last post by:
Hi, I'm a novice to postgress and need to constract a simple tree. In my table I have: regionID int parentID int name char I need to do two functions: find all the children of XXX parent...
5
by: Enos Meroka | last post by:
Hallo, I am a student doing my project in the university.. I have been trying to compile the program using HP -UX aCC compiler, however I keep on getting the following errors. ...
2
by: Gregory | last post by:
Hi, One of the disadvantages of using error handling with error codes instead of exception handling is that error codes retuned from a function can be forgotten to check thus leading to...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
67
by: Bob Powell | last post by:
To whom it may concern: I find the recent articles in various trade publications a little disturbing due to the lack of PostgrSQL mention. I continue to see articles about how IBM may be...
1
by: Praveen | last post by:
Hi All, Can anybody tell from where i can download the latest Postgress Windows version? Thanks, Praveen
3
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.