الانتقال إلى المحتوى

خطأ يظهرلى فى جملة Sql


جيتارا

Recommended Posts

السلام عليكم


قمت بكتابة كود لتحويل جملة select الى صيغة xml
ولكن يظهر لى خطأ ora-00913 too many values
وهاهو الكود...



select xmlelement(
"xml",
xmlagg(xmlelement(
"region",
xmlattributes(p.area_id as "region"),
xmlagg(xmlelement(
"area_type",
xmlattributes(p.area_type as "area_type"),
(select xmlagg(xmlelement(
"product",
xmlattributes(c.name as "name",
pr.description_arabic as "description"))),
xmlagg(xmlelement(
"customer_licenses",
xmlattributes(cl.position_id as "pos_id",
cl.area as "area",
cl.description as "position",
cl.start_date as "start_date",
cl.end_date as "end_date",
cl.notes as "notes")))




FROM customer_licenses cl
LEFT JOIN positions p
ON (cl.position_id=p.id)
LEFT JOIN products pr
ON (cl.product_type=pr.id)
LEFT JOIN customers c
ON(c.id=cl.cust_id)
WHERE cl. license_type_id=4
and p.area_id IS NOT NULL
AND p.area_type IS NOT NULL
and p.id=cl.position_id
group by cl.position_id
)

)
)
)
)
)
xml
FROM positions p
WHERE p.area_id IS NOT NULL AND p.area_type IS NOT NULL
group by p.area_id

;

ارجو المساعدة فى تصحيح الخطأ

رابط هذا التعليق
شارك

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   تمت استعادة المحتوى السابق الخاص بك.   مسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

جاري التحميل
×
×
  • أضف...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية