Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Error trying to generate multiple images. [Displaying images for dummies]

I'm trying to display multiple images based on an id we can have 1,2,3 + images based on the id.
The full thing is → Dinamically create buttons based on the id, then click this buttons (this provide an id ) and this id get's the # of tables that correspond to that button.

Currently I'm just trying to display images based on id for testing is id 1

I upload the row from python connection :
data['FILENAME'] ="just testing"
data['FILE_BLOB'] = curr_fig
data['OPP_ID'] = "1"

with connection.cursor() as cursor:
cursor.execute(INSERT_PLOTS_QRY, data)
connection.commit()

Where curr_fig is just a fig from plot figs[0]['fig'].to_image() → type: go.Figure

and it works fine, the first thing to see if the BLOB is uploaded right I just did this :

Display Image, sql statemtnt → this retrieves the LAST image from the row and is displayed right. this works fine for 1 image, but I want to create depending on the id N number of images like dynamically

Now the first erorr: ORA-06502: PL/SQL: numeric or value error: character to number conversion error

It's from a Interactive Report:

Where the column file_blob is like.

FILE_MIMETYPE is : image/png

but I'm getting that error… so I tried another way..

from a classic report : same thing.

report error: ORA-00932: inconsistent datatypes: expected - got BLOB

Then I tried:

Within a **static region ** an item with pl/sql function body an got

Error computing item source value for page item P61_NEW_1.

Contact your application administrator.

function body: I hardcoded the l_mimetype and changed to image/jpeg jpg, png to see if the problem was the FILE_MIMETYPE from the row data. but nope.. is not that case

DECLARE
l_html CLOB;
l_mime_type VARCHAR2(100) := 'image/jpg'; --jpeg, jpg, png,
BEGIN
l_html := '';
FOR r IN (SELECT FILE_BLOB FROM AWR_PLOTS_HTML WHERE OPP_ID = 1) LOOP
l_html := l_html || '<img src="data:' || l_mime_type || ';base64,' || utl_encode.base64_encode(r.FILE_BLOB) || '">';
END LOOP;
return l_html;
END;

I'm just bashing my head against a wall, quite new into all of these apex thing and

Error computing item source value for page item P61_NEW_1.

Contact your application administrator.

Full stack from above :

Technical Info (only available for developers)

  • is_internal_error: true
  • apex_error_code: WWV_FLOW_FORMS.ITEM_SOURCE_ERR
  • ora_sqlcode: -6502
  • ora_sqlerrm: ORA-06502: PL/SQL: numeric or value errorORA-06512: at "APEX_230200.WWV_FLOW_CODE_EXEC_PLSQL", line 304 ORA-06512: at "APEX_230200.WWV_FLOW_DYNAMIC_EXEC", line 2647 ORA-06512: at line 7 ORA-06512: at line 7 ORA-06512: at line 11 ORA-06512: at "SYS.DBMS_SYS_SQL", line 2120 ORA-06512: at "SYS.WWV_DBMS_SQL_APEX_230200", line 810 ORA-06512: at "APEX_230200.WWV_FLOW_DYNAMIC_EXEC", line 2607 ORA-06512: at "APEX_230200.WWV_FLOW_CODE_EXEC_PLSQL", line 304 ORA-06512: at "APEX_230200.WWV_FLOW_CODE_EXEC", line 376
  • component.type: APEX_APPLICATION_PAGE_ITEMS
  • component.id: 2916431099637622
  • component.name: P61_NEW_1
  • error_backtrace:ORA-06512: at line 7 ORA-06512: at line 7 ORA-06512: at line 11 ORA-06512: at "SYS.DBMS_SYS_SQL", line 2120 ORA-06512: at "SYS.WWV_DBMS_SQL_APEX_230200", line 810 ORA-06512: at "APEX_230200.WWV_FLOW_DYNAMIC_EXEC", line 2607 ORA-06512: at "APEX_230200.WWV_FLOW_CODE_EXEC_PLSQL", line 304 ORA-06512: at "APEX_230200.WWV_FLOW_DYNAMIC_EXEC", line 2647 ORA-06512: at line 7 ORA-06512: at line 7 ORA-06512: at line 11 ORA-06512: at "SYS.DBMS_SYS_SQL", line 2120 ORA-06512: at "SYS.WWV_DBMS_SQL_APEX_230200", line 810 ORA-06512: at "APEX_230200.WWV_FLOW_DYNAMIC_EXEC", line 2607 ORA-06512: at "APEX_230200.WWV_FLOW_CODE_EXEC_PLSQL", line 304 ORA-06512: at "APEX_230200.WWV_FLOW_CODE_EXEC", line 376 ORA-06512: at "APEX_230200.WWV_FLOW_FORMS", line 404
  • error_statement:declare function x return varchar2 is begin DECLARE l_html CLOB; l_mime_type VARCHAR2(100) := 'image/jpeg'; BEGIN l_html := ''; FOR r IN (SELECT FILE_BLOB FROM AWR_PLOTS_HTML WHERE OPP_ID = 1) LOOP l_html := l_html || '<img src="data:' || l_mime_type || ';base64,' || utl_encode.base64_encode(r.FILE_BLOB) || '">'; END LOOP; return l_html; END; return null; end; begin wwv_flow.g_computation_result_vc := x; end;

Comments

Processing

Post Details

Added on Apr 27 2024
0 comments
291 views