473,398 Members | 2,125 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,398 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 3271

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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
0
BarryA
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.