I try create view and occur error

---- Error -------------------------------
Auto Commit: On, SQL Mode: Internal, Isolation Level: Serializable
General error;-9205 POS(1) System error: AK Catalog information not found:       
CREATE VIEW LAB.authorized_services

if I remove string 'LAB.rangeToString(c.normal_range) normal_range' from select view created succeeded

'test view'

CREATE VIEW LAB.authorized_services

AS

SELECT
   f.patient_code,
   g.profile_code service_code,
   v.profile_name service_name,
   a.counter,
DECODE(a.profile_state, 'archived', 'authorized', a.profile_state) profile_state,
   a.scheduled_time,
   a.authorized_time,
   a.conclusion,
   a.doctor,
   c.scheduled_test,
   h.test,
   h.test_type,
   h.test_code,
   x.test_name,
   k.unit_name,
   d.sampling_time,
   i.material_name,
   e.result_type,
   e.value_type,
   CASE
       WHEN e.value_type = 'result' THEN
           CASE
               WHEN e.result_type = 'qual' THEN  j.flag_name
WHEN e.result_type = 'quantflag' THEN DECODE(e.outofrange, NULL, '', e.outofrange || ' ') || e.er_result
           END
       WHEN e.value_type = 'comment' THEN e.comment
   END result,
   CASE
       WHEN e.value_type = 'result' THEN e.comment
       WHEN e.value_type = 'comment' THEN NULL
   END comment,
   c.rule,
   c.rulerevisionno,
   c.normal_node normal_node,
LAB.rangeToString(c.normal_range) normal_range, CASE
       WHEN e.result_type = 'qual' THEN  NULL
       WHEN e.result_type = 'quantflag' THEN j.flag_name
   END flag_name
FROM

   LAB.scheduled_profiles a,
   LAB.scheduled_investigations b,
   LAB.scheduled_tests c,
   LAB.scheduled_samples d,
   LAB.raw_results e,
   LAB.rt_patients f,
LAB.rt_profiles g,
   LAB.rt_profile_properties v,
LAB.rt_tests h,
   LAB.rt_test_properties x,
LAB.rt_materials i,
   LAB.er_reference_flags j,
   LAB.rt_units k
WHERE a.scheduled_profile = b.scheduled_profile
   AND b.scheduled_invest = c.scheduled_invest
   AND b.scheduled_sample = d.scheduled_sample
   AND c.raw_result = e.raw_result

   AND a.patient = f.patient

   AND a.profile = g.profile
   AND g.profile = v.profile
   AND v.FromRevisionNo <= g.RevisionNo
AND g.RevisionNo < DECODE(v.ToRevisionNo, NULL, g.RevisionNo + 1, v.ToRevisionNo) AND c.test = h.test
   AND h.test = x.test
   AND x.FromRevisionNo <= h.RevisionNo
AND h.RevisionNo < DECODE(x.ToRevisionNo, NULL, h.RevisionNo + 1, x.ToRevisionNo) AND d.work_material = i.material AND e.reference_flag = j.reference_flag (+)
   AND e.er_unit = k.unit (+)


--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to