Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Vivek.

Asked: November 11, 2020 - 7:59 pm UTC

Last updated: November 12, 2020 - 12:41 am UTC

Version: 12c

Viewed 1000+ times

You Asked

Hi,

I have a select into query in stored procedure which uses a column group_id in where clause. But it is not filtering the data as the column name is same as oracle function name group_id. I cannot change the column name. How to use it in plsql where clause.

Select lmt_id into l_lmt_id
from table1 t
where t.group_id = p_grp_id;

and Connor said...

I'll think you'll need to elaborate more

SQL> create table table1 ( lmt_id int, group_id int );

Table created.

SQL> insert into table1 values (1,1);

1 row created.

SQL>
SQL> declare
  2    l_lmt_id int;
  3    p_grp_id int := 1;
  4  begin
  5    Select lmt_id into l_lmt_id
  6    from table1 t
  7    where t.group_id = p_grp_id;
  8  end;
  9  /

PL/SQL procedure successfully completed.




Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library