1

i am trying create a boolean function in oracle. But i get the following error:

Line: 3 Column: 20
Error: PLS-00103: Encountered the symbol "("

This is the code i want execute:

        CREATE OR REPLACE Function ART.prueba
        (                             
        p_cuser  in varchar(20)
        ) return boolean is

            l_mstat swt500.m_stat%type := null;
            l_factu  swt500.f_actu%type  := null;
        Begin
            Select m_stat , f_actu             
               into l_mstat, l_factu
             from swt500
           where  c_empr = 59
              and  c_user  = p_cuser
              and  c_codi = 401
              and  t_codi = 'PR';                           
        return true;

        End;
        /

Can somebody help me?

1 Answer 1

2

Varchar and varchar2 as a parameter don't need to specify the size, lose the "(20)" in the parameter.

CREATE OR REPLACE Function ART.prueba
        (                             
        p_cuser  in varchar
        ) return boolean is

            l_mstat swt500.m_stat%type := null;
            l_factu  swt500.f_actu%type  := null;
        Begin
            Select m_stat , f_actu             
               into l_mstat, l_factu
             from swt500
           where  c_empr = 59
              and  c_user  = p_cuser
              and  c_codi = 401
              and  t_codi = 'PR';                           
        return true;

        End;
        /
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.