Calling the function from SQL query

Hi,
I am trying to run the below statement,
Select to_number(apps.pay_balance_pkg.get_value( 326, :paa.assignment_action_id,to_date ('31032011','ddmmyyyy'))) from dual;
getting an error as :
ORA-14552 cannot perform a DDL, commit or rollback inside a query or DML
ORA - 06512 at apps.pay_balance_pkg , line 4526.
How can I execute this funciton "apps.pay_balance_pkg.get_value" from sql query?
Thanks in advance.

user1175432 wrote:
Hi,
I am trying to run the below statement,
Select to_number(apps.pay_balance_pkg.get_value( 326, :paa.assignment_action_id,to_date ('31032011','ddmmyyyy'))) from dual;
getting an error as :
ORA-14552 cannot perform a DDL, commit or rollback inside a query or DML
ORA - 06512 at apps.pay_balance_pkg , line 4526.
How can I execute this funciton "apps.pay_balance_pkg.get_value" from sql query?
Thanks in advance.If the function is performing DDL, commit or rollback inside it then you will not be able to call it from an SQL statement.
Either change the function so it doesn't perform DDL, commit or rollback, or use a different means to obtain the information you want (assuming you can't change the function)

Similar Messages

  • Call external function from SQL query

    Hi,
    I am new to PL/SQL programming.I don't think this is possible but please let me know if there is a way to achieve this. I have a function written in VB.net and I would want to call from the query.
    create table temp as select id, callvbfunction(note_text) from temp2
    Here callvbfunction is the vb.net function.I need to pass note_text field value to the function.
    Thanks..

    Yes it is possible.
    No idea how to specifically call a .Net function (from Oracle) as I do not do Windows (except for playing games ;-) ). But external procedures (extproc) and Java stored procs can be wrapped by PL/SQL wrapper functions and used in SQL statements.

  • Calling a function from sql*plus

    I can call my procedure from sql *plus
    by doing
    sql>call Proc_name(x,y);
    How do you call a function?
    null

    John,
    I think moifying the statement
    CREATE OR REPLACE PROCEDURE "OGUSER"."OGX1" (user_county in integer, user_permit in integer )
    TO
    CREATE OR REPLACE FUNCTION "OGUSER"."OGX1" (user_county in integer, user_permit in integer ) return NUMBER is
    AND before end you will have to add a return statement
    (Probably
    return 0;
    exception
    when others then
    return 1;
    end;
    This will change your procedure to a function but I am not sure you'll be able to see your dbms_output's, if you call the function using select ...
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by john saucer ([email protected]):
    I want to turn my procedure into a function.
    So I can call it with a select statement.
    I'm kind of having problems with the return statement at the top and bottom.
    I don't quite understand how to declare the type in the return. My procedure calculates 2 pl/sql tables....
    My procedure looks like.
    CREATE OR REPLACE PROCEDURE "OGUSER"."OGX1" (user_county in integer, user_permit in integer )
    as
    i integer :=0;
    j integer :=0;
    type dept_table_type is table of ogxtest%rowtype
    index by binary_integer;
    type dept2_table_type is table of ogxtest%rowtype
    index by binary_integer;
    my_dept_table dept_table_type;
    my_dept2_table dept2_table_type;
    v_cotemp number := user_county;
    v_permittemp number := user_permit;
    v_origcotemp number := user_county;
    v_origpermittemp number := user_permit;
    v_count number(2) :=1;
    v_count2 number(2) := 1;
    v_oldcount number(2) :=1;
    v_oldcount2 number(2) := 1;
    begin
    select count(*) into v_count from ogxtest where oco=v_cotemp and opermit=v_permittemp;
    select count(*) into v_oldcount from ogxtest where nco=v_cotemp and npermit=v_permittemp;
    while v_count >= 1 LOOP
    i := i+1;
    v_count2 := v_count2 +1;
    select *
    into my_dept_table(i)
    from ogxtest where oco=v_cotemp and opermit=v_permittemp;
    v_cotemp := my_dept_table(i).nco;
    v_permittemp := my_dept_table(i).npermit;
    select count(*) into v_count from ogxtest where oco=v_cotemp and opermit=v_permittemp;
    end loop;
    while v_oldcount >= 1 LOOP
    j := j+1;
    v_oldcount2 := v_oldcount2 +1;
    select *
    into my_dept2_table(j)
    from ogxtest where nco=v_origcotemp and npermit=v_origpermittemp;
    v_origcotemp := my_dept2_table(j).oco;
    v_origpermittemp := my_dept2_table(j).opermit;
    select count(*) into v_oldcount from ogxtest where nco=v_origcotemp and npermit=v_origpermittemp;
    end loop;
    for i in 1..v_count2-1
    loop
    dbms_output.put_line(' reassigned to - orig county ' | |my_dept_table(i).oco | | ' orig permit ' | |my_dept_table(i).opermit| | ' new county ' | |
    my_dept_table(i).nco | | ' new permit ' | |my_dept_table(i).npermit );
    end loop;
    for j in 1..v_oldcount2-1
    loop
    dbms_output.put_line(' reassigned from - orig county ' | |my_dept2_table(j).oco | | ' orig permit ' | |my_dept2_table(j).opermit| | ' new county ' | |
    my_dept2_table(j).nco | | ' new permit ' | |my_dept2_table(j).npermit );
    end loop;
    end;
    <HR></BLOCKQUOTE>
    null

  • Calling a function from SQL prompt that returns a record

    Hi,
    I've been trying to execute a function that is present on a different database. for eg. I am loged on to a database say 'A' and trying to execute a function present in database 'B'. this function is present in a package 'X' which has 2 functions and two procedures. From the packages i am able to execute the two procedures and one of the function.
    So i guess it is not a problem with the access permissions. The function that i am trying to call say function I has got 3 OUT
    parameters and 1 IN parameter. the Function returns a record. When i try to execute this function i get an error. Can you please let me know as to how exactly i need to call this function from the SQL prompt...
    thanx in advance
    null

    Hi Anand,
    As your function has 3 OUT parameters and it returns a record you can not just call it from SQL Plus. You need to write small PL/SQL program and use variables to hold the OUT values and the returned record.
    Good Luck,
    RajKiran
    null

  • Getting session hang When calling Function from SQL query

    Hi All,
    I am using Oracle 8.1.7.4.0. I have a fucntion in a Package and I am calling it from the SQL query. When I am firing the query my oracle session is going to hang position and I am not able to any thing. I have to kill the session.
    But this same thing is working fine in Oracle 9.i.
    There are no out parameter and no DML, DDL and DCL statement in this fucntion.
    Could you please get back me what is the problem on it.
    Regards
    SUN

    Check why your session hangs.
    Just a few ideas:
    * Blocking locks?
    * Endless loop?
    * Performance (maybe it is just slow in orac8i and you have to wait a bit longer). Check the execution plans of the SQL statements in your function.
    * Don't use a function, but direct SQL, it is faster in both versions.

  • Can call a function from SQL COMMAND but can't from the SHUTTLE help please

    I've read this article
    ARTICLE
    I've written the code in a function called SURVEY_USERS that takes one variable
    when I run the following in the SQL builder:
    SELECT SURVEY_USERS('canns') from DUAL;I get
    SELECT smteam.division_manager DS, smteam.division_manager RV from SMTEAM where smteam.division_manager=canns and rownum = 1
    UNION
    SELECT SMTEAM.dept_manager DS, smteam.dept_manager RV from SMTEAM LEFT where smteam.division_manager=canns
    UNION
    SELECT smteam.wdmanagername DS, smteam.wdmanagername RV from SMTEAM where smteam.division_manager=cannswhich is what I want but when I put in into the "list of values definition".
    RETURN SCREPORTS.SURVEY_USERS('canns');I get
    Error     ORA-06550: line 1, column 188: PL/SQL: ORA-00904: "CANNS": invalid identifier ORA-00904: "CANNS": invalid identifier ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored ORA-00904: "CANNS": invalid identifierI'm just confused as to what I'm doing wrong. I'm passing the same thing to the function...and it appears to be working in the SQL workshop and not the actual LOV Shuttle.
    Edited by: bostonmacosx on Sep 12, 2012 3:45 PM

    Here is some of the function
    create or replace function "SURVEY_USERS"
    (app_user in VARCHAR2)
    return VARCHAR2
    is
      vp_exists INTEGER;
      ed_exists INTEGER;
      dr_exists INTEGER;
      mngr_exists INTEGER;
    begin
    SELECT COUNT(*) into vp_exists
      FROM smteam
      WHERE area_manager= app_user
      AND ROWNUM = 1;
      SELECT COUNT(*) INTO ed_exists
      FROM smteam
      WHERE division_manager = app_user
      AND ROWNUM = 1;
      SELECT COUNT(*) INTO dr_exists
      FROM smteam
      WHERE dept_manager = app_user
      AND ROWNUM = 1;
      SELECT COUNT(*) INTO mngr_exists
      FROM smteam
      WHERE wdmanagername = app_user
      AND ROWNUM = 1;
    --dbms_output.put_line (vp_exists);
    --dbms_output.put_line (ed_exists);
    --dbms_output.put_line (dr_exists);
    --dbms_output.put_line (mngr_exists);
    IF (vp_exists = 1) THEN
      RETURN 'SELECT smteam.area_manager DS,smteam.area_manager RV from SMTEAM where smteam.area_manager='''||app_user||''' and ROWNUM = 1
       UNION
       SELECT smteam.division_manager DS, smteam.division_manager RV from SMTEAM where smteam.area_manager='''||app_user||'''
       UNION
         SELECT smteam.dept_manager DS, smteam.dept_manager RV from SMTEAM  where smteam.area_manager='''||app_user||'''
       UNION
        SELECT smteam.wdmanagername DS, smteam.wdmanagername RV from SMTEAM  where smteam.area_manager='''||app_user||'''';
    END IF;
    IF (ed_exists = 1 and vp_exists=0) THEN
        RETURN 'SELECT smteam.division_manager DS, smteam.division_manager RV from SMTEAM  where smteam.division_manager='''||app_user||''' and rownum = 1
       UNION
         SELECT SMTEAM.dept_manager DS, smteam.dept_manager RV from SMTEAM LEFT where smteam.division_manager='''||app_user||'''
       UNION
        SELECT smteam.wdmanagername DS, smteam.wdmanagername RV from SMTEAM where smteam.division_manager='''||app_user||'''';
      END IF;
    IF (dr_exists = 1 and ed_exists=0 and vp_exists=0) THEN
         RETURN 'SELECT smteam.dept_manager DS, smteam.dept_manager RV from SMTEAM  where smteam.dept_manager=:'''||app_user||'''and rownum = 1
       UNION
        SELECT smteam.wdmanagername DS, smteam.wdmanagername RV from SMTEAM  where smteam.dept_manager='''||app_user||'''';
      END IF;
    IF (mngr_exists = 1 and ed_exists=0 and vp_exists=0 and dr_exists=0) THEN
        RETURN  'SELECT smteam.wdmanagername DS, smteam.wdmanagername RV from SMTEAM  where smteam.wdmanagername=:'''||app_user||''' and rownum = 1';
      END IF;
    END;
    Edited by: bostonmacosx on Sep 12, 2012 3:56 PM

  • Calling boolean function from tree query

    Hi all,
    I have placed a tree on my sidebar region from the following query
    select PAGE_NO id,
    PARENT_PAGE_NO pid,
    NAME name,
    'f?p=&APP_ID.:'||page_no||':&SESSION.' link,
    null a1,
    null a2
    from #OWNER#.APEX_PAGES
    WHERE page_no = :APP_PAGE_ID
    AND nvl(navigation,'N') = 'Y'
    Its running perfectly fine. Now i have my custom function "isUserAllowed(app_user, name_of_node, isParent)" which returns a boolean expression is the logged in User has access privilege on that node.
    How can i run my function inside the tree query so that node is visible only for those values in which my function returns "true"? and not on others?
    With Regards,
    Sunil Bhatia

    The "wrapper" function would actually be pretty easy - just another function to call the one returning the boolean and convert it to some other value, numeric or character. something like (untested)
    <pre>
    FUNCTION wrapper_function(P_whatever varchar2) return varchar2 IS
    v_return_value_c varchar2(5);
    BEGIN
    r_return_value_c := case boolean_function(p_whatever)
    when true then 'true'
    else 'false;
    return v_return_value_c;
    END;
    </pre>
    Using the function in the WHERE clause could look something like this (untested, but should work if done correctly)
    <pre>
    select whatever
    from your_table
    where wrapper_function(whatever) = 'true'
    </pre>

  • Calling a function from SQL that has Out Parameters

    Hello folks,
    I am not sure if this is do-able, but here is my scenrio at hand. I have a database function that accepts a few IN parameters and OUT parameters. I want one of the Out parameters to display as part of my select statement. Is this possible?
    Thanks

    No you cannot use a function with out parameters in sql statements.
    If possible make the function return that value, then use it in select.( imean instead of OUT parameter, get that OUT parameter through RETURN)
    G.

  • Can Any one tell me what is the step in calling a function from a *.lib file in Labview application

    Hi, I am working on Labview 8.0.
    I am trying to  communicate to a thrid party HW using the driver file he has provided to me.
    The drive file is a *.lib file.
    I am unable to call the function from the lib file.
    I could get only from a DLL.
    Pls help .
    Regards
    -Patil

    patil wrote:
    When it is possible in Lab Windows, why calling a function from a static library is prohibited?
    I was trying to use Function node, but found that it is only for functions from a DLL file.
    Will CIN be useful.? 
    LabWindows is not the same as LabVIEW. LabVIEW cannot call .lib files. LIB files are intermediary products and you need to use a wrapper DLL that's compatible with the object format of the .lib file. It's as simple as that. LabWindows creates C application and from that perspective is no different than a regular C
    compiler. That's why you can call .lib files because that's how .lib
    files are used.
    A CIN, as pointed out, is something completely different and will not help you.  

  • Using 'Function Returning SQL Query' with Flash charts

    I have created a pl/sql function that returns a SQL query as a varchar2 of this form:
    select null link
    <x value> value
    <Series1 y value> Series 1 Label
    <Series2 y value> Series 2 Label
    <Series3 y value> Series 3 Label
    from tablea a
    join tableb b
    on a.col = b.col
    order by <x value>
    If I now call the function from a Flash Chart Series SQL box with the Query Source Type set to 'Function Returning SQL Query' like this:
    return functionname(to_date('30-sep-2010', 'dd-mon-yyyy'))
    it parses correctly and the page is saved; however, when I run the page I don't get any output - nor any error messages or other indication of a problem.
    Now, if I call the function in a SQL client, capture the SQL query output using dbms_output and paste that into the Flash Chart Series SQL box - changing the Query Source Type to SQL Query - and save the page it works fine when I run it and returns a multi-series flash chart.
    Can anyone suggest either;
    1. What have I might have missed or done wrong?
    2. Any way to usefully diagnose the problem...
    I have tried using the Apex debugger - which is very nice, by the way - but it doesn't provide any info on what my problem might be. I even tried writing my own debug messages from my function using the apex_debug_message package - got nothing...
    Thanks,
    Eric

    Hi Eric,
    Try expressing the source as this:
    begin
       return functionname(to_date('30-sep-2010', 'dd-mon-yyyy'));
    end;That works fine for me, and if I take out the begin-end and the trailing semicolon from the return statement I get the same behavior as you.
    It does mention in the help for the source (only during the wizard though) that this source type has to be expressed that way, but I agree it would be helpful if the tool would validate for this format when 'Function Returning SQL Query' is used or give some sort of indication of the trouble. Anyway, this should get you going again.
    Hope this helps,
    John
    If you find this information useful, please remember to mark the post "helpful" or "correct" so that others may benefit as well.

  • How to call oracle function from ejb3

    i'm trying to call an oracle query-function from ejb3.
    The oracle function:
    create or replace FUNCTION getSecThreadCount(secId in NUMBER,avai in NUMBER)
    RETURN SYS_REFCURSOR is cur SYS_REFCURSOR;
    m_sql VARCHAR2(250);
    BEGIN
    m_sql:='select count(thrId) from thread where secId='|| secid||'
    and thrAvai='|| avai;
    open cur for m_sql;
    return cur;
    END;
    I'v tried several ways to call it,but all failed:
    1. the calling code:
    public Object getSectionThreadCount(int secId,int avai){
              Query query=manager.createNativeQuery("{call getSecThreadCount(?,?) }");     
              query.setParameter(1, secId);
              query.setParameter(2, avai);
              return query.getSingleResult();
    but i got the exception:
    Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    Caused by: java.sql.SQLException: ORA-06550: row 1, col 7:
    PLS-00221: 'GETSECTHREADCOUNT' not procedure or not defined
    ORA-06550: row 1, col 7:
    PL/SQL: Statement ignored
    2. the calling code:
    @SqlResultSetMapping(name = "getSecThreadCount_Mapping")
    @NamedNativeQuery(name = "getSecThreadCount",
    query = "{?=call getSecThreadCount(:secId,:avai)}",
    resultSetMapping = "getSecThreadCount_Mapping",
    hints = {@QueryHint(name = "org.hibernate.callable", value = "true"),
              @QueryHint(name = "org.hibernate.readOnly", value = "true")})
    public Object getSectionThreadCount(int secId,int avai){
              Query query=manager.createNamedQuery("getSecThreadCount");     
              query.setParameter("secId", secId);
              query.setParameter("avai", avai);
              return query.getSingleResult();
    but i run into the exception:
    Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    Caused by: java.sql.SQLException: lost in index IN or OUT parameter:: 3
    By the way, i have successfully called the function from hibernate. And i use oracle 11g, JBoss5 RC1.
    Could anyone tell me how to call the function from EJB3?
    Thanks.

    Here's a working model:
    package.procedure: (created in example schema scott)
    CREATE OR REPLACE package  body data_pkg as
      type c_refcursor is ref cursor;
      -- function that return all emps of a certain dept
      function getEmployees ( p_deptId in number
      return c_refcursor
      is
        l_refcursor c_refcursor;
      begin
         open l_refcursor
        for
              select e.empno as emp_id
              ,        e.ename as emp_name
              ,        e.job   as emp_job
              ,        e.hiredate as emp_hiredate
              from   emp e
              where  e.DEPTNO = p_deptId;
        return l_refcursor;
      end getEmployees;
    end data_pkg;
    /entity class:
    package net.app.entity;
    import java.io.Serializable;
    import java.util.Date;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedNativeQuery;
    import javax.persistence.QueryHint;
    import javax.persistence.SequenceGenerator;
    import javax.persistence.Table;
    @SuppressWarnings("serial")
    @Entity
    @Table (name="emp")
    @SequenceGenerator(name = "EmployeeSequence", sequenceName = "emp_seq")
    @NamedNativeQuery( name = "getEmpsByDeptId"
                   , query = "{ ? = call data_pkg.getEmployees(?)}"
                   , resultClass = Employee.class
                   , hints = { @QueryHint(name = "org.hibernate.callable", value = "true")
                          , @QueryHint(name = "org.hibernate.readOnly", value = "true")
    public class Employee implements Serializable
        @Id
        @Column(name="emp_id")
        @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "EmployeeSequence")
        private int id;
        @Column(name="emp_name")
        private String name;
        @Column(name="emp_job")
        private String job;
        @Column(name="emp_hiredate")
        private Date hiredate;
        // constructor
        public Employee (){}
        // getters and setters
        public int getId()
         return id;
    etc...session bean:
    package net.app.entity;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    import net.app.entity.Employee;
    import net.app.iface.ScottAdmin;
    @Stateless
    public class ScottAdminImpl implements ScottAdmin
        @PersistenceContext
        private EntityManager entityManager;
        @SuppressWarnings("unchecked")
        public List<Employee> getEmployeesByDeptId(int deptId)
         ArrayList<Employee> empList;
         try
             Query query = entityManager.createNamedQuery("getEmpsByDeptId");
             query.setParameter(1, deptId);
             empList = (ArrayList<Employee>) query.getResultList();
             return empList;
         catch (Exception e)
             e.printStackTrace(System.out);
             return null;
    }client:
    package net.app.client;
    import java.util.List;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import net.app.entity.Employee;
    import net.app.iface.ScottAdmin;
    public class ScottClient
        public static void main(String[] args)
         try
             // create local interface
             InitialContext ctx = new InitialContext();
             ScottAdmin adminInterface = (ScottAdmin) ctx.lookup("ScottAdminImpl/remote");
             // select employees by deptno
             int deptno = 20;
             List<Employee> empList = adminInterface.getEmployeesByDeptId(deptno);
             // output
             System.out.println("Listing employees:");
             for (Employee emp : empList)
              System.out.println(emp.getId() + ": " + emp.getName() + ", " + emp.getJob() + ", " + emp.getHiredate());
         catch (NamingException e)
             e.printStackTrace(System.out);
    }Basically you just ignore the refcursor outbound parameter.
    This is a stored function, have yet to try outbound refcursor parameters in stored procedures...
    Edited by: _Locutus on Apr 2, 2009 2:37 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Get Comma separated result from SQL Query

    Hey Everyone
    I have a requirement where i need to get comma separated result of names because there is one to many relationship i.e for every protocol there are mutiple people associated to it , and i created PL/SQL function for that and everything was fine and when it is in production multiple number of cursors were opened because of the logic and leading to RAC fail over and for that we were manually clearing the cursors every weekend and i am looking to create a Materialized view for this logic but i was unable to code the logic using Connect by clause
    Result is like and i want comma separated names for every protocol
    P06065     TESTER13 TESTER13
    P02095     PATRICIA CARMELITANO
    P02095     ANNE MUIR
    P02095     ROBERT HARLOW
    P02095     JANICE ALBERT
    P02095     Jacqueline van Dalen
    P02095     GUENTER HENNIG DR.
    P05209     Olga Xenaki
    P05553     Birgit Limbach-Angele
    P05553     Anja Schulz Dr.
    P05553     CHRISTA HAGENBUCHER
    here is the function which i wrote, i need to get the same logic through SQL Statement .. thanks for your help
    cursor c_GSCR is
    select T565804.FST_NAME||' '||T565804.LAST_NAME
    from
    S_PT_POS_HST_LS T544105 /* S_PT_POS_HST_LS_Protocol_Team */ ,
    S_CONTACT T565804 /* S_CONTACT_Protocol_Team */,
    S_CL_PTCL_LS T541903 /* S_CL_PTCL_LS_Protocol */
    where ( T541903.ROW_ID = T544105.CL_PTCL_ID and
    T544105.POSTN_ID = T565804.PR_HELD_POSTN_ID and
    T544105.ROLE_CD = 'Lead Project Manager' AND
    T541903.ROW_ID = v_PTCL_ID and
    T541903.PAR_PTCL_ID is null and T544105.END_DT is null );
    BEGIN
    l_row_num := 0;
    l_role := '';
    l_role_list := '';
    v_PTCL_ID := PTCL_ID;
    OPEN C_GSCR;
    if C_GSCR%isopen THEN
    LOOP
    FETCH C_GSCR INTO l_role;
    exit when C_GSCR%notfound;
    IF l_role_list IS NULL THEN
    l_role_list:=l_role;
    ELSE
    l_role_list:=l_role_list||', '||l_role;
    END IF;
    END LOOP;
    CLOSE C_GSCR;
    end if;
    ~Srix

    Hi,
    Srix wrote:
    Thanks for the Info .. My database in 10g R 2 i started using COLLECT Function
    select T541903.PTCL_NUM ,
    CAST(COLLECT(T565804.FST_NAME||' '||T565804.LAST_NAME) AS varchar2_ntt) , 7) AS LPM_NAME
    from
    S_PT_POS_HST_LS T544105 /* S_PT_POS_HST_LS_Protocol_Team */ ,
    S_CONTACT T565804 /* S_CONTACT_Protocol_Team */,
    S_CL_PTCL_LS T541903 /* S_CL_PTCL_LS_Protocol */
    where T541903.ROW_ID = T544105.CL_PTCL_ID and
    T544105.POSTN_ID = T565804.PR_HELD_POSTN_ID and
    T544105.ROLE_CD = 'Lead Project Manager' AND
    T541903.PAR_PTCL_ID is null and T544105.END_DT is null
    GROUP BY T541903.PTCL_NUM
    The result i like ...Do you mean "The result *is* like ..."?
    Or do you mean "The result I [would] like [is] ..."?
    The code above has unblanaced parentheses. If you are getting anything other than an error message, then I don't believe you are really running what you posted.
    Whenever you have a problem, post a complete test script that people can use to recreate the problem and test their ideas.
    Please do that. Post CREATE TABLE and INSERT statements to crate the sample data, the code you used to create the carachr2_ntt type and the function, and your best attempt at a query (formatted). Simplify as much as possible. For example, do you really need 3 tables to illustrate the problem? For purposes of asking a question on this forum, can't you pretend you have just one table, with 2 columns?
    I suspect the problem has to do with the user-defined type and function, which you didn't post. I can't even see how you called the function in your query. Without the information I mentioned above, there's not much I can do to help you.

  • How to compare result from sql query with data writen in html input tag?

    how to compare result
    from sql query with data
    writen in html input tag?
    I need to compare
    user and password in html form
    with all user and password in database
    how to do this?
    or put the resulr from sql query
    in array
    please help me?

    Hi dejani
    first get the user name and password enter by the user
    using
    String sUsername=request.getParameter("name of the textfield");
    String sPassword=request.getParameter("name of the textfield");
    after executeQuery() statement
    int exist=0;
    while(rs.next())
    String sUserId= rs.getString("username");
    String sPass_wd= rs.getString("password");
    if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
    exist=1;
    if(exist==1)
    out.println("user exist");
    else
    out.println("not exist");

  • Calling a function from within a movieclip

    How do I do this, and Is it wrong to do it this way?
    I have a movieclip on the timeline and within that movieclip
    it has buttons which I've placed listeners. I'm doing it this way
    rather than putting the code in the document class because the
    buttons don't appear right away in the movieclip (not until around
    frame 10). The function is defined in the document class because it
    is used with other movieclips.
    Anyone have an idea on how to properly do this?

    Well, I'm at least not getting an error - however, nothing is
    happening when I click the button to call the function (which is
    indeed public). Inside the function is a simple trace. I've even
    added a param to the function just for fun, and there's no error
    when calling the function from the button.

  • How do I call a function from another file?

    In MainView.m I have one function -(void)goTell;
    I want to be able to call the function from SecondView.m. How do I do this?
    I have declared the function in the MainView.h and added #include MainView.h to SecondView.m, but it still doesn't work.
    This code crashes my program (for some reason this board takes away my brackets... assume the code is written correctly):
    [[MainView alloc] init];
    MainView *myMainView;
    [myMainView goTell];
    By the way... goTell has nothing in it. It's just a blank function for testing purposes.
    Ethan

    BTW - Wrap your code like this in posts tags so it stay readable.
    put code here
    Your code needs to be:
    MainView *myMainView = [[MainView alloc] init];
    [MyMainView goTell];

Maybe you are looking for