cast problem 8.3.1

From: Steve Clark <sclark(at)netwolves(dot)com>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: cast problem 8.3.1
Date: 2008-03-20 17:52:58
Message-ID: 47E2A47A.103@netwolves.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello List,

I can't seem to figure out what is this code that worked on 7.4.x.
I've added cast to everything but still
get:

postgres error log:
ERROR: operator does not exist: text = integer
HINT: No operator matches the given name and argument type(s). You
might need to add explicit type casts.
STATEMENT: update T_MON_DEVICE_STATUS set device_ip = $1 :: inet
, status = $2 :: integer , status_date = now () ,
last_event_log_no = case $3 when 0 then null else $4 :: integer
end where unit_serial_no = $5 :: text and device_name = $6 :: text

pgc code:
EXEC SQL UPDATE T_MON_DEVICE_STATUS
SET device_ip = :h_device_ip::inet,
status = :h_status::integer,
status_date = now(),
last_event_log_no =
case :h_event_log_no when 0 then null
else
:h_event_log_no::integer end
WHERE unit_serial_no = :h_unit_serial_no::text
AND device_name = :h_device_name::text;

table:
\d t_mon_device_status
Table "public.t_mon_device_status"
Column | Type | Modifiers
-------------------+--------------------------+-----------
unit_serial_no | character varying(15) | not null
device_name | character varying(64) | not null
device_ip | inet | not null
status | integer | not null
status_date | timestamp with time zone | not null
last_event_log_no | integer |
Indexes:
"pk_tmds_usn_dn" PRIMARY KEY, btree (unit_serial_no, device_name)
Foreign-key constraints:
"fk_tmds_usn" FOREIGN KEY (unit_serial_no) REFERENCES
t_unit_status_log(unit_serial_no) ON DELETE CASCADE

maybe someone else can see where I am going wrong.

Thanks in advance,
Steve

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Smith 2008-03-20 18:02:12 [postgis-users] how many min. floating-points?
Previous Message dan chak 2008-03-20 17:31:52 deadlock error messages