0
votes

I created a view that uses WM_CONCAT to group results together, like this: wm_concat(DISTINCT complies) and it runs smoothly in DB, without any errors.

But when I try to put it in a Django app, using, models, views, tables it gives me an error ORA-22922: nonexistent LOB value .

I tried using listagg(complies, ',') WITHIN GROUP (ORDER BY code) complies, but that gives me a DB error result of string concatenation is too long.

I'm aware that WM_CONCAT is not supported by Oracle, but I have used that successfully before.

Status in uwsgi says django.db.utils.DatabaseError: ORA-22922:

Is this a DB fix or Django fix, and how do you fix it?

1
You must avoid wm_concat function because it is undocumented and discovered as workaround at Oracle 8i times. Django has nothing to do with Oracle. Error is quiet clear, result of string concatenation is too long which mean the result of concatenation is more than 4000 chars. You can do a substr and select 4k characters - XING
@XING yes, I had used wm_concat successfully before. That error, result of string concatenation is too long happens when I use LISTAGG but not when I use wm_concat. It runs without any errors in PLSQL, but when I call it from models in Django it gives me and error:ORA-22922: nonexistent LOB value` I don't understand why that is happening. - kej

1 Answers

0
votes

I was able to fix the problem! I wrapped my whole SELECT into another SELECT and used LISTAGG on those columns that were already using WM_CONCAT.

Now the results are displaying without a problem.