[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1095
  • Last Modified:

Create Fuction Error PLS-00201: identifier 'T_VARCHAR2_TAB' must be declared

I'm trying to create function received from vendor and it will not compile.  I've googled but can't seem to find out why?

CREATE OR REPLACE FUNCTION CLARITY.tab_to_string_2
(p_varchar2_tab  IN  t_varchar2_tab, p_delimiter     IN  VARCHAR2 DEFAULT ',')
RETURN VARCHAR2 IS l_string VARCHAR2(32767);
l_str varchar2(32767) := ' ';
BEGIN

  if p_varchar2_tab.First is NULL and p_varchar2_tab.Last is NULL then
    return l_string;
  end if;
  FOR i IN p_varchar2_tab.FIRST .. 5 LOOP
    IF i != p_varchar2_tab.FIRST THEN
      l_string := l_string || p_delimiter;
    END IF;
    if i > p_varchar2_tab.LAST then
        l_str := i || ' ';
    else
        l_str := i || p_varchar2_tab(i);
    end if;
    l_string := l_string || l_str;
  END LOOP;
  RETURN l_string;
END tab_to_string_2;
/

Warning: Function created with compilation errors.

>  show errors
Errors for FUNCTION TAB_TO_STRING_2:

LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0      PL/SQL: Compilation unit analysis terminated
2/22     PLS-00201: identifier 'T_VARCHAR2_TAB' must be declared
0
diannagibbs
Asked:
diannagibbs
  • 2
1 Solution
 
sdstuberCommented:
do you have the t_varchar2_tab   object type created?
0
 
sdstuberCommented:
I'm going to guess you probably need something like this..


create or replace type clarity.t_varchar2_tab as table of varchar2(4000);
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now