Using store procedure within sql statement?

I have the following sample tables:
project id project_name
====== ===============
1          project one
2          project two
3           project three
employee_id     fname          lname
=========== =============     =====
100          amy          A
200          better          B
300          carrie          C
project_id     employee_id
===========     ===========
1          200
2          300
3          100
there is a procedure getFullname(empployee_id) in place that combines the fname with lname to full name
what i need to accomplish is the following.
project is created by employee
==============================
project one is created by better b
project two is created by carrie C
project three is created by amy A
but the rule is: you have to call the procedure getFullName(employee_id) to accomplish the task above, and don't use the join tables to get the full employee name

CREATE OR REPLACE FUNCTION YOUR_FUNCTION(i_nEmpId IN NUMBER)
RETURN VARCHAR2 IS
BEGIN
  RETURN 'Lastname ' || TO_CHAR(i_nEmpId) || ' Firstname';
END;
WITH PROJECTS AS (SELECT 1 PROJECT_id, 'project one' PROJECT_NAME FROM DUAL
                  UNION ALL
                  SELECT 2 PROJECT_id, 'project two' PROJECT_NAME FROM DUAL
                  UNION ALL
                  SELECT 3 PROJECT_id, 'project three' PROJECT_NAME FROM DUAL
  PROJ_TO_EMP AS (SELECT 1 PROJ_ID, 100 EMP_ID FROM DUAL
                  UNION ALL
                  SELECT 2 PROJ_ID, 200 EMP_ID FROM DUAL
                  UNION ALL
                  SELECT 3 PROJ_ID, 300 EMP_ID FROM DUAL
SELECT PROJECT_ID,
       PROJECT_NAME,
       EMP_ID,
       YOUR_FUNCTION(EMP_ID),
       PROJECT_NAME || ' is created by ' || YOUR_FUNCTION(EMP_ID)
  FROM PROJECTS,
       PROJ_TO_EMP
WHERE PROJECT_ID=PROJ_ID;

Similar Messages

  • How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000

    Post Author: ltkin
    CA Forum: WebIntelligence Reporting
    Hi,
    How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000 ?
    Regards,

    Hi ltkin,
    Unfortunately, it is not possible in Xir2 to create Webi reports from stored procedures.
    Webi reports can only be created from Universe. So in Business Objects XIR3 we can create a special universe that enables Web Intelligence user's to access stored procedures residing in the database. This is the only way that Web Intelligence user's can access stored procedures.
    Please let me know if the above information helps.
    Regards,
    Pavan

  • Using Procedure in SQL statement

    Dear Sir,
    As you know, I can use any function in SQL statement. For example:
    SELECT systimestamp,
    Function_Name(variable1, variable2,...)
    FROM anytable;
    So the previous function could only retrieve one value -as functions concepts-. Anyhow, Can I, in someway, use Procedure that take multiple in parameters and return multiple out parameters in SQL statement.
    Thank you in advance.

    Sir,
    I got a way in order to use the benefit of procedure in function. It's trough your idea in using TYPE OBJECT as the following:
    ===================================================================
    create or replace type Missed_Txn_type AS OBJECT
    (Txn_Timestamp_obj timestamp,
    Txn_Type_Obj Number(12));
    ===================================================================
    Then I created function and used this type as returned value:
    FUNCTION Get_Shift_Missed_Txn_Obj(F_Date_In     Date,
                        F_Time_In Timestamp,
                        F_Employee_Id     number)
    RETURN Missed_Txn_type;
    The issue is: I want send the variables of the function through SELECT statement which they come from another table like:
    SELECT
    EMP.ID,
    sd.date_value,
    shf.Time_In,
    T.OBJ.Txn_Timestamp_obj,
    T.OBJ.Txn_Type_Obj
    FROM
    EMPLOYEE EMP,
    Stored_Date SD,
    Shifts shf,
    (select Get_Shift_Missed_Txn_Obj(sd.date_value,
    shf.time_in,
    EMP.Id) OBJ from dual) T
    WHERE
    [where clause]
    But the previous statement returned an error shows that it couldn't determine the (EMP.ID, shf.time_in, sd.date_value...)...
    And the same if I use it in the select list!
    So sir, there is any way in order to solve this issue?
    Thank you in advance.

  • How to set client within SQL statement without using another pl/sql stmt.

    I have a following select statement
    SELECT SUM (w.prior_forecasted_costs + w.prior_committed_costs)
    FROM xxsuf.job_cost_summary_table w,
    apps.pa_periods p,
    pa.pa_resources bz,
    pa.pa_resource_list_members cz,
    pa.pa_tasks dz
    WHERE w.project_id = z.project_id
    AND w.task_id = dz.task_id
    AND dz.task_number '98000'
    AND w.resource_list_member_id = cz.resource_list_member_id
    AND cz.resource_id = bz.resource_id
    AND NOT EXISTS (SELECT NULL
    FROM pa.pa_tasks zz
    WHERE zz.parent_task_id = dz.task_id)
    AND w.resource_list_member_id != 1000
    AND p.period_name = w.pa_period
    AND p.current_pa_period_flag = 'Y'
    Above select statement uses pa_periods view which only works when I set my client using "exec DBMS_Application_Info.set_client_info(83);" in Toad or SQL*Plus session.
    I was wondering how can I achieve it within select statement. so that I don't have to use another PL/SQL statement to set my client. Is there anyway to set client with my org id within above select statement ?
    Please advise.
    --Rakesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    You can simply create a function which calls dbms_application_info and use that in your sql statement as in
    SQL> create or replace function set_client_info (i_info varchar2)
       return varchar2
    as
    begin
       dbms_application_info.set_client_info (i_info);
       return i_info;
    end set_client_info;
    Function created.
    SQL> create or replace view v_emp
    as
      select * from emp where empno = to_number(sys_context('userenv','client_info'))
    View created.
    SQL> select ename from v_emp where set_client_info(7788) is not null
    ENAME    
    SCOTT    
    1 row selected.
    SQL> select ename from v_emp where set_client_info(7900) is not null
    ENAME    
    JAMES    
    1 row selected.

  • CALL PROCEDURE IN SQL STATEMENT

    Why we cant call a procedure inside SQL statement?

    Hitesh Nirkhey wrote:
    Hi Karthick_Arp
    as you said
    The procedure that is used inside a function cannot contain DDL or DML statements or COMMIT/ROLLBACK.
    Said that it does not make much sence to use a procedure within a function.IT make sense if we DECLARE FUNCTION AS PRAGMA AUTONOMUS_TRANSACTION
    then we can execute DDL or DML statements or COMMIT/ROLLBACK in that function.
    Regards
    HiteshBut why would you do that?

  • Which is better to use Store Procedure or Views in Crystal Reports ?

    Hi,
    which one is more better to use Store Procedure or Views in Crystal Reports ?
    Thanks.

    It depeneds on the requirement. Well, but from performance point of view as u know that stored procedures are already compiled on DB side, they would be more efficient. Views are handled differently. Here CR has nothing to do with it.
    But if the stored procedure u r using is having 2 Select statements, CR will only display the results from the first select statement. In that case you need to use Views as one can use more than one views in the report and join them.
    Using a Generic view which is created by the DBA for a larger audience will result in performance issues meaning if a View "V" has 25 fields and View is based on 5 tables  and ur report is using only 5 fields which are coming only from 2 tables inside the view,in this case u will end up in joining 3 more tables unnecessarily.
    Hope this helps!

  • Using Collection in a sql statement.

    Hi I want to perform the following statement:
    DELETE FROM ALLOCATION_ELEC_MATRIX
    WHERE dgo_ean_id in (lt_inter_dgos);
    The collection lt_inter_dgos holds my dgo_ean_id's(varchars).
    I can't find a way to get it to work.
    The collection is declared as follows:
    TYPE Interface_param_dgos IS TABLE OF VARCHAR2(20);
    lt_inter_dgos Interface_param_dgos := Interface_param_dgos();
    then later on the collection gets filled. But how can i get it to work to use it in my sql statement?
    I don't won't to use a for loop around it since it would give me problems if I use more collections with a different amount of values in it.

    The standard approach is to use SQL collection type and table function,
    for example
    SQL> create TYPE Interface_param_dgos IS TABLE OF VARCHAR2(20);
      2  /
    Type created.
    SQL> create or replace package my_pkg
      2  is
      3   lt_inter_dgos Interface_param_dgos := Interface_param_dgos();
      4   function get_coll return Interface_param_dgos;
      5  end;
      6  /
    Package created.
    SQL> create or replace package body my_pkg
      2  is
      3   function get_coll return Interface_param_dgos
      4   is
      5   begin
      6    return lt_inter_dgos;
      7   end;
      8  end;
      9  /
    Package body created.
    SQL> begin
      2   my_pkg.lt_inter_dgos.extend(3);
      3   my_pkg.lt_inter_dgos(1) := 'SMITH';
      4   my_pkg.lt_inter_dgos(2) := 'KING';
      5   my_pkg.lt_inter_dgos(3) := 'ALLEN';
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SQL> select ename from emp;
    ENAME
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    JAMES
    FORD
    MILLER
    14 rows selected.
    SQL> delete from emp where ename in (select column_value from table(my_pkg.get_coll));
    3 rows deleted.
    SQL> select ename from emp;
    ENAME
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    TURNER
    ADAMS
    JAMES
    FORD
    MILLER
    11 rows selected.Rgds.

  • ALDSP 3.0 -- schema owner for stored procedure or SQL Statement

    Using ALDSP, I have a need to create a physical service based on a stored procedure or a SQL statement. I am wondering what will happen when I move to another deployment environment where the schema owner changes. In our QA and Prod environments, we have a different schema owner for all tables in the application (the DBAs believe this prevents unwanted updates to a prod environment). DSP elegantly supports this for normal table- and view-based physical services by mapping schemas through the DSP console after deployment. Will I get the same type of mapping capability for stored procedures and SQL statements? I noticed that I can add a SQL-based function to a physical service...is there a way to pass in the physical table name from that data service to the procedure or SQL statement?
    Thanks,
    Jeff

    Schema name substitution should work for stored procedures just like it does for tables. If it doesn't - report a bug.
    You don't get any help for sql-statement based data services - dsp doesn't parse the sql provided. One thing you could do is use the default schema (following the user of your connection pool), and not specify the schema in your sql-statement.

  • JDBC - Pl/SQL-Procedure or SQL-Statement???

    Hi,
    we have got the following problem:
    Our program is entirely written in Java. It has to communicate with an ORACLE 8i database (Version 8.1.7). The big question is whether to call pl/sql-procedures which include the sql-statement (select/ insert/update) or to write the sql-statements in the Java-code directly.
    We messure the time in our test-database. The procedure took twice the time of the direct statement, althoug the sql-statement had to be parsed each time.
    What is the better way: pl/sql-procedure or sql-statements? On which conditions depend the choose?
    (For your information: our statements aren't difficult. In our testdatabase aren't much datasources.)
    Here is a snippet of our code:
    1. PL/SQL-Prozedure:
    CallableStatement cs = conn.prepareCall("begin dbrb_test_pkg.test(?,?,?); end;");
    cs.registerOutParameter(1, OracleTypes.CURSOR);
    cs.registerOutParameter(2, OracleTypes.CURSOR);
    cs.registerOutParameter(3, OracleTypes.CURSOR);
    cs.execute();
    ResultSet rs1 = ((OracleCallableStatement)cs).getCursor(1);
    ResultSet rs2 = ((OracleCallableStatement)cs).getCursor(2);
    ResultSet rs3 = ((OracleCallableStatement)cs).getCursor(3);
    2. SQL-Statements directly in Java-Code:
    String statement1b = "SELECT bva_id, bva_datva FROM bva";
    ResultSet rs1b = stmt.executeQuery(statement1b);
    String statement2b = "SELECT brb_id, brb_datein FROM brb";
    ResultSet rs2b = stmt.executeQuery(statement2b);
    String statement3b = "SELECT bper_id, bper_nz1 FROM bper";
    ResultSet rs3b = stmt.executeQuery(statement3b);
    Thanks a lot.
    Claudia and Nicole

    this is a case-to-case basis.
    it's ok to use the Statement/PreparedStatement if you're constructing your SQL or DML (insert/update/delete) statements. like when you're WHERE condition is dynamically created. this can be done also in PL/SQL (CallabeStatement) but passing of data is very tedious for you.
    the PL/SQL is much better to use if all your SQL or DML statements are fixed. besides, this is easier to maintain. when you need to change a statement, you don't need to check the statement in SQL prompt then make the necessary changes in your java codes, then compile the class. when you're using PLSQL, you just need to change and recompile the PL you made. then presto! it's done. as long as you don't change the parameters the PL receives and sends, it should perfectly work with your java code. =)

  • Using store procedures with SQLJ - please help!

    I have two questions:
    1.I wrote simple test appllication that uses SQLJ to run store
    procedures from SQL package. It compiles and work fine from
    JDeveloper 3 if I use java version JDK1.2.2_JDeveloper.
    It compiles OK in regular JDK1.2.2 but raise the following
    exception when running:
    profile
    com.itrade.trserver.truser.dbqueries.ItrHistorian_SJProfile0 not
    found: java.io.InvalidClassException: [Ljava.lang.Object;;
    Serializable is incompatible with Externalizable
    Does it mean that I have to use JDeveloper JDK?
    2.When I give other then default package for *.sqlj file the
    *.sqlj file is added to project but I cannot see it in specified
    package (the *.sqlj file is created in the its directory).
    After I compile the project the I can see *.java file in the
    specified package, but compiler gives errors about redefined
    symbols. If I remove *.sqlj file from the project it compiles OK.
    What I am doing wrong?
    Yakov Becker
    null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Thank you for the response.
    I don't create jar file. I run it from JDeveloper environment.
    What do you mean by "I made sure to also copy over the
    : the .ser file"? What purpose of the *.ser file in this case?
    Yakov
    JDeveloper Team (guest) wrote:
    : I have come across this error before..
    : I'm assuming that your jar file is in the classpath as
    : specified in the Jserv configuration?
    : When I had the error, I made sure to also copy over the
    : the .ser file.
    : In my case, I happened to have both my class files and
    : the .ser file outside of a jar file and it worked..
    : Hope this helps!
    : Yakov Becker (guest) wrote:
    : : I have two questions:
    : : 1.I wrote simple test appllication that uses SQLJ to run
    store
    : : procedures from SQL package. It compiles and work fine from
    : : JDeveloper 3 if I use java version JDK1.2.2_JDeveloper.
    : : It compiles OK in regular JDK1.2.2 but raise the following
    : : exception when running:
    : : profile
    : : com.itrade.trserver.truser.dbqueries.ItrHistorian_SJProfile0
    : not
    : : found: java.io.InvalidClassException: [Ljava.lang.Object;;
    : : Serializable is incompatible with Externalizable
    : : Does it mean that I have to use JDeveloper JDK?
    : : 2.When I give other then default package for *.sqlj file the
    : : *.sqlj file is added to project but I cannot see it in
    : specified
    : : package (the *.sqlj file is created in the its directory).
    : : After I compile the project the I can see *.java file in the
    : : specified package, but compiler gives errors about redefined
    : : symbols. If I remove *.sqlj file from the project it
    compiles
    : OK.
    : : What I am doing wrong?
    : : Yakov Becker
    null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Need to update multiple records using store procedure

    Hi i am trying to update multiple records using store procedure but failed to achieve pls help me with this
    for example my source is
    emp_name sal
    abhi 2000
    arti 1500
    priya 1700
    i want to increase salary of emp whose salary is less than 2000 it means rest two salary should get update..using stored procedure only
    i have tried following code
    create or replace procedure upt_sal(p_sal out emp.sal%type, p_cursor out sys_refcursor)
    is
    begin
    open p_cursor for
    select sal into p_sal from emp;
    if sal<2000 then
    update emp set sal= sal+200;
    end i;f
    end;
    and i have called the procedure using following codes
    set serveroutput on
    declare
    p_sal emp.sal%type;
    v_cursor sys_refcursor;
    begin
    upt_sal(p_sal,v_cursor);
    fetch v_cursor into p_sal;
    dbms_output.put_line(p_sal);
    end;
    the program is executing but i should get o/p like this after updating
    1700
    1900
    but i am getting first row only
    2000
    and record is not upsating...please help me with this
    thanks

    Hi Alberto,
    thanx for your valuable suggestion. but still i have doubt. the code which i have mentioned above might be simple but what if i have big requirement where i need update the data by using loops and conditional statement.
    and i have similar kind of requirement where i need to deal with procedure which returns more than one row
    my source is
    empno ename salary
    111,abhi,300
    112,arti,200
    111,naveen,600
    here i need to write a store procedure which accepts the empno (111) as input para and display ename and salary
    here i have written store procedure like this
    create or replace procedure show_emp_det(p_empno in emp.empno%type, p_ename out emp.ename%type,p_salary out emp.salary%type, p_cursor out sys_refcursor)
    is
    begin
    open p_cursor for
    select ename,salary into p_ename,p_salary from emp where empno=p_empno;
    end;
    and i have called this by using
    declare
    p_salary emp.salary%type;
    p_ename emp.ename%type
    v_cursor sys_refcursor;
    begin
    show_emp_det(111,p_ename,p_salary,v_cursor);
    fetch v_cursor into p_ename,p_salary;
    dbms_output.put_line(p_ename);
    dbms_output.put_line(p_salary);
    end;
    here i should get
    abhi,300
    naveen,600
    but i am getting first row only
    abhi,300
    but i want to fetch both rows...pls help me to find the solution

  • Error by using database procedure in select statement

    hi ,
    I have built a database procedure having one parameter with in out varchar type. that return value with some addition.
    i am using it with some column in select statement only for display purpuses but i am facing error by doing that in select statement. that procedure is working well with bind variable but not with select statement.
    plz help me how i can use a procedure in select statement. or can i do it or not.

    plz help me how i can use a procedure in select statement. or can i do it or not.A workaround could be to create a wrapper function for your procedure. One that only passes the input parameters and returns the output parameter.
    The simply call this function in your select which internally calls the procedure.

  • How to pass xml data as objects into Database using store procedures

    Hi All,
         I don't have much knowledge on store procedure,can anybody help how to pass the xml as objects in Database using store procedure.
    My Requirement is I have a table with three fields EMPLOYEE is table name and the fields are EMP_ID,EMP_TYPE AND EMP_DET,I have to insert the employees xml data into corresponding fields in the table.
    Input Data
    <ROWSET>
       <ROW>
         <EMP_ID>7000</EMP_ID>
          <EMP_TYPE>TYPE1</EMP_TYPE>
         <EMP_DET>DEP</EMP_DET>
      <ROW>
      <ROW>
         <EMP_ID>7000</EMP_ID>
         <EMP_TYPE>TYPE2</EMP_TYPE>
        <EMP_DET>DEP2</EMP_DET>
    <ROW>
    <ROW>
         <EMP_ID>7000</EMP_ID>
         <EMP_TYPE>TYPE3</EMP_TYPE>
        <EMP_DET>DEP3</EMP_DET>
    <ROW>
    <ROWSET>
    So each row values has to inserted into resp fields in the table.
    Regards
    Mani

    Do you have a similar structure in your stored procedure ?
    In that case you can simply call the procedure from soa using db adapter and do a mapping to assign the values.

  • Benefit of using store procedure instead of select statement to pull data into biztalk

    I was wondering why store procedure is more beneficial than using select statement to pull data into biztalk?

    In addition to the above two points, in case if there is a change in logic of stored procedure, you only need to modify the stored proc and the applications calling/using it may be left intact.
    Also, stored procedures are complied code so performance is better and safe too.
    Thanks,
    Prashant
    Please mark this post accordingly if it answers your query or is helpful.

  • Using stored procedures within Crystal Reports

    Hello all,
    Background Information:
    I am trying to teach myself how to execute a stored procedure within Crystal Reports.  This is an aspect of Crystal that my work group has not utilized before and we're trying to gather information on the subject.  We use Oracle to create and execute functions and procedures all the time, but I've never tried this within Crystal.
    I use the "Add Command" functionality within Crystal on most of my reports so that I can taylor the sql to the report.  I find this easier to do versus using the ODBC connection to the tables and writing the code through the Crystal Reports wizard.  I also frequently use functions within these sql statements that are inserted in the Add Command.
    What I'm trying to achieve:
    I have a report that needs to run as a "trial", and then later as a committed "run".  This is for a monthly billing system.  Essentially, the user will run the report as the "trial", preview the data, make any necessay corrections, and then later, run the actual billing run.  Within my application, the bills are not actually marked as "billed" until they are actually "billed', if that makes sense.  As a result, the "trial" report will need to mark the bills as "billed", generate the report, and then rollback the data (so that the bills are not "billed".  Once the actual billing reports are ran, the same report will run, but with a "commit" at the end of the report so that the bills are now "billed".
    I'm trying simple tests and failing (i.e. taking baby steps to learn what capabilities Crystal has):
    I created as simple of a procedure as I can envision.  This procedure inserts the word "test" in one of my fields for a provided account number.  When I try to run this procedure via Crystal (via New Report ->History->My ODBC Database link->Stored Procedures), Crystal asks for the account number parameter, as it should.  But I then receive the error message:
    Database Connector Error: '42000:[Microsoft][ODBC driver for Oracle]Syntax error or access violation'
    The existing ODBC connection has work great for years and years to retrieve data from tables, but this is the first time I've tried to utilize procedures.  Can anybody help?  And can anybody explain what the Stored Procedures link is supposed to do?  Am I going down the right path?
    thanks,
    Noel

    Hello,
    Make sure the Oracle client install path is in the PATH statement. And also make sure you are using an IN/OUT cursor. CR only reads the last SELECT statement. Search the Documents area on how to create a Stored Procedure.
    Also, if you are using CR XI ( 11.0 ) then upgrade to CR XI R2 and apply all service packs ( SP 6 ). Go to this link: http://www.sdn.sap.com/irj/boc and download the trial version of CR XI R2 and use your XI keycode, then apply the patches which you can get to by clicking on the BusinessObjects tab above, then Downloads.
    Direct link to the Trial version: http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
    It may fix your issue also.
    Thanks again
    Don

Maybe you are looking for

  • Touch, XP, The disk could not be read from or written to error FIXED!!!!

    I tried everything that I found suggested anywhere, including spending two hours with Apple on the phone. In the end, I bought a new Belkin USB 2.0 (high speed) card and installed it, and synced all 1000 songs in one shot. For those of you who are ge

  • Printing problem with 9.4 with Xerox WorkCentre 7435

    I have just upgraded my reader to 9.4.0 and having problem with Xerox WorkCentre 7435 printer. I have no problem with this pointer before the upgrade. I got the following error dialog when I print: Please help. Thanks.

  • Forms Created in Pro 10 cannot be signed in Reader 11

    Hello, I have created forms using Adobe Pro 10 with signature fields.  Users who recently were upgraded to Reader 11 can no longer sign the form.  They can enter data into text fields - but when reviewing the form properties it disallows digital sign

  • Monitor is messed up

    The Monitor for my t61 is not working... It seems to freeze up and show a grey screen at sometimes. The Monitor would react to tapping The side of It. This is what my Monitor looks like sometimes 

  • How to delete PDF files?

    I want to delete 3 pdf files I no longer need.  There is no "delete" on the pre for them; no info in the pre handbook.  How can I delete these pfd files? Post relates to: