[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Inconsistent Data Types



The TRUNC function is more commonly used with numerics.  You could try a
to_char such as...
where to_char(cal_date, 'yyyymmdd') <= to_char(to_date($pay_end_dt),
'yyyymmdd')

-----Original Message-----
From: Chrisman, Dan: [mailto:Daniel.E.Chrisman@conocophillips.com]
Sent: Thursday, July 31, 2003 8:35 AM
To: sqr-users@sqrug.org
Subject: [sqr-users] Inconsistent Data Types


I get the following error when I test my program code.

SQR 5528 ORACLE OEXEC error -932 in cursor 1:
ORA-00932: inconsistent datatypes

error on Line 344:
(SQR 3735) could not execute SQL.

I am trying to execute the following code

! Lock the current pay period

begin-SQL
update TK_Calendar
  set Cal_Payroll_Code = {LOCKED}
where trunc(Cal_Date) <= trunc($Pay_End_Dt) 
AND Cal_Payroll_Code = {OPEN}
end-SQL

where Cal_Date is a Data field in the Table and Cal_Payroll_Code is CHAR (1)
field.
$Pay_end_Dt is keyed in on an input statement as the date dd-mmm-yy. As I
understand it $ can mean either a Date or character field.

Could someone tell me what I'm doing wrong?

Daniel E. Chrisman
Senior Analyst
Ponca City Refinery
ETN 442.5654
DDE 580.767.5654

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users