Question

I have a code in my procedure that looks like this. But when i execute this code, i get the error as mentioned below.

The Error report that i got is:

Error report - ORA-06553: PLS-306: wrong number or types of arguments in call to 'OGC_Y' ORA-06512: at line 20 06553. 00000 - "PLS-%s: %s" *Cause:
*Action:

The error has something to do with primary_flag = "Y" <-- this. How else can i write primary_flag = 'Y' inside a string? The dynamic query is required in my case.

MY CODE IS:

    DECLARE

    p_assignee_id NUMBER := 10153;

    time_stamp timestamp := '12-DEC-2011';

    create_task_view_sql VARCHAR2(4000);

    BEGIN

       create_task_view_sql:=
                                         'select unique cp.sub_last_name 
                                          from cs_sr_contact_points_v cp 
                                          where cp.incident_id = 55500 
                                          and cp.contact_phone is not null 
                                          and primary_flag = "Y"';

       dbms_output.put_line(create_task_view_sql);

       execute immediate create_task_view_sql;


END;
Was it helpful?

Solution

To embed quoted string in a quoted string, use two single quotes:

'...and primary_flag=''Y''';

Or you can use the newer q' syntax to avoid doubling up the embedded quotes:

q'[...and primary_flag='Y']';
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top