ora-01422

Reason for geting ORA-01422: exact fetch returns more than requested number of rows

折月煮酒 提交于 2019-12-11 06:09:18
问题 So i am working on an installer where the installer connects to a database and creates tables and populates them. Every aspect of this works correctly except when i attempt to add rows to a certian table. declare retVal INTEGER; rptID INTEGER; catID INTEGER; wsID INTEGER; paramID INTEGER; dtID INTEGER; begin select PK into catID from RPT_CATEGORY where KEYVALUE = 'ProductivityReportsCategory'; select PK into rptID from RPT_REPORT where KEYVALUE = 'ProductivitySummaryReport2'; select PK into

Using bind variables in SQL Plus with more than one row returned?

强颜欢笑 提交于 2019-12-11 03:22:40
问题 This is a stupid problem, but I can't seem to get around it. I have a query that's causing trouble in an OCI program, so I want to run it manually in SQL*Plus to check if there is any difference there. This is the query: select e.label as doc_name, e.url, i.item_id, 'multi' as form_type from cr_items i, cr_extlinks e where i.parent_id = :comment_id and e.extlink_id = i.item_id UNION select null as doc_name, utl_raw.cast_to_varchar2(DBMS_LOB.SUBSTR(r.content, 2000, 1)) as url, r.item_id,