Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.3.1
-
Fix Version/s: None
-
Component/s: JDO queries
-
Labels:None
-
Environment:Windows
-
Number of attachments :
Description
I am upgrading from an older version and I have hit a problem where Castor won't return any results for a query. I have taken the SQL that Castor created and used it in an adhoc query on SQL Server. The adhoc returns multiple rows.
The attached file shows some of the output from the OQL and a portion of the mapping.
Here is what SQL Server sees when this statement executes:
Yes That one did come across in a prepare statement...
declare @p1 int
set @p1=1
exec sp_prepare @p1 output,N'@P0 nvarchar(4000),@P1 int',N'SELECT "T_ATR_PRTY"."OBJ_ID","T_ATR_ADDR"."obj_id","T_ATR_PH_NUM"."OBJ_ID","T_ATR_PRTY"."test","T_ATR_USR_PROF"."OBJ_ID",
"T_ATR_USR_PROF"."BR_OBJ_ID","T_ATR_USR_PROF"."crt_dt","T_ATR_USR_PROF"."EMP_NUM","T_ATR_USR_PROF"."FLD_LGN_NUM",
"T_ATR_USR_PROF"."USR_STUS_LKP_OBJ_ID","T_ATR_USR_PROF"."FRST_NM","T_ATR_USR_PROF"."LST_LGN_DT","T_ATR_USR_PROF"."LST_NM",
"T_ATR_USR_PROF"."MID_INIT","T_ATR_USR_PROF"."USR_NM","T_ATR_USR_PROF"."USR_PROF_OBJ_ID","T_ATR_USR_PROF_ROLE"."OBJ_ID",
"T_ATR_USR_PROF_AUDT_ENTR"."OBJ_ID","ATR_Branch_Manager"."OBJ_ID"
FROM "T_ATR_USR_PROF"
LEFT OUTER JOIN "T_ATR_ADDR" ON "T_ATR_USR_PROF"."OBJ_ID"="T_ATR_ADDR"."PRTY_OBJ_ID"
LEFT OUTER JOIN "T_ATR_PH_NUM" ON "T_ATR_USR_PROF"."OBJ_ID"="T_ATR_PH_NUM"."PRTY_OBJ_ID"
LEFT OUTER JOIN "T_ATR_USR_PROF_ROLE" ON "T_ATR_USR_PROF"."OBJ_ID"="T_ATR_USR_PROF_ROLE"."USR_PROF_OBJ_ID"
LEFT OUTER JOIN "T_ATR_USR_PROF_AUDT_ENTR" ON "T_ATR_USR_PROF"."OBJ_ID"="T_ATR_USR_PROF_AUDT_ENTR"."USR_PROF_OBJ_ID"
LEFT OUTER JOIN "ATR_Branch_Manager" ON "T_ATR_USR_PROF"."OBJ_ID"="ATR_Branch_Manager"."USR_PROF_OBJ_ID","T_ATR_PRTY"
WHERE "T_ATR_USR_PROF"."OBJ_ID"="T_ATR_PRTY"."OBJ_ID"
AND ("T_ATR_USR_PROF"."USR_NM" = @P0
and "T_ATR_USR_PROF"."USR_STUS_LKP_OBJ_ID" = @P1) ',1
select @p1
Followed by...
exec sp_execute 1,N'crouchkl',1