Effective procedure to get data

Hi
In the below procedure
i am using a temporary table for collecting data from 4 tables.
i am using cursor recordset to return results by
group by room_cat,resort_id, VDESC, RATE_CODE, vDAY1, vDAY2, vDAY3, vDAY4,
vDAY5, vDAY6, vDAY7, vWEEKEND1, vWEEKEND2, vWEEKEND3, vWEEKEND4, vWEEKEND5,
vWEEKEND6, vWEEKEND7
i feel this is not correct method and i want to rewrite the procedure in a efficient way.
help please.
create or replace procedure rateq2
ARRDT DATE,
DEPDT DATE,
MY_RATE_CODE IN varchar2,
RESORT_ID IN varchar2,
R_recordset out types.cursor_type
as
ARR_TEMPDT DATE;
DEP_TEMPDT DATE;
ALL_RATECODES varchar2(100);
V_RESORTID varchar2(100);
cursor cur1 is
select RH.resort as RH_RESORT,
RH.rate_code as RH_RATE_CODE,
RD.rate_detail_id as RD_RATE_DETAIL_ID,
RD.rate1 as RD_RATE1,
RD.rate2 as RD_RATE2,
RD.rate3 as RD_RATE3,
RD.rate4 as RD_RATE4,
RD.rate5 as RD_RATE5,
RD.children_charge as RD_CHILD,
RRC.room_category as RM_CAT,
initcap(RRMCAT.long_description) as RM_DESC,
RH.DAY1 as rh_day1,
RH.DAY2 as rh_day2,
RH.DAY3 as rh_day3,
RH.DAY4 as rh_day4,
RH.DAY5 as rh_day5,
RH.DAY6 as rh_day6,
RH.DAY7 as rh_day7,
RH.WEEKEND1 as rh_weekend1,
RH.WEEKEND2 as rh_weekend2,
RH.WEEKEND3 as rh_weekend3,
RH.WEEKEND4 as rh_weekend4,
RH.WEEKEND5 as rh_weekend5,
RH.WEEKEND6 as rh_weekend6,
RH.WEEKEND7 as rh_weekend7
from pms_rate_header RH,
pms_rate_detail RD,
     pms_rate_room_cat RRC,
     resort_room_category RRMCAT,
(select ARR_TEMPDT b_date, DEP_TEMPDT e_date from dual) p
where
RH.inactive_date is NULL
and RH.RESORT=V_RESORTID
and RH.RATE_CODE =ALL_RATECODES
and rh.begin_date <= p.e_date and rh.end_date >= p.b_date
and RD.rate_header_id=RH.rate_header_id
and RD.inactive_date is NULL
and rd.begin_date <= p.e_date and rd.end_date >= p.b_date
and RRC.rate_detail_id=RD.rate_detail_id
and RRC.resort=RH.resort
and RRMCAT.resort=RH.resort
and RRMCAT.room_category=RRC.room_category
and RRC.inactive_date is NULL
and RRMCAT.inactive_date IS NULL
ORDER BY RM_CAT ;
vrec cur1%rowtype;
begin
delete from TEMP_Rate;
ARR_TEMPDT:=ARRDT;
DEP_TEMPDT:=DEPDT;
ALL_RATECODES:=MY_RATE_CODE;
V_RESORTID := RESORT_ID;
open cur1;
loop
fetch cur1 into vrec;
exit when cur1%notfound;
Insert into TEMP_RATE (RESORT_ID, ROOM_CAT, VDESC, AVGRATE1, AVGRATE2, AVGRATE3,
AVGRATE4, AVGRATE5, AVGCHILD, RATEDETID, RATE_CODE, vDAY1, vDAY2, vDAY3, vDAY4,
vDAY5, vDAY6, vDAY7, vWEEKEND1, vWEEKEND2, vWEEKEND3, vWEEKEND4, vWEEKEND5,
vWEEKEND6, vWEEKEND7)
values (vrec.rh_resort, vrec.rm_cat ,vrec.rm_desc, vrec.rd_rate1, vrec.rd_rate2, vrec.rd_rate3,
vrec.rd_rate4, vrec.rd_rate5, vrec.rd_child, vrec.rd_rate_detail_id,vrec.rh_rate_code,vrec.rh_day1,vrec.rh_day2,vrec.rh_day3,vrec.rh_day4,
vrec.rh_day5,vrec.rh_day6,vrec.rh_day7,vrec.rh_weekend1,vrec.rh_weekend2,vrec.rh_weekend3,vrec.rh_weekend4,vrec.rh_weekend5,
vrec.rh_weekend6,vrec.rh_weekend7);
end loop;
OPEN R_recordset FOR
select RESORT_ID, ROOM_CAT, VDESC, AVG(AVGRATE1) , AVG(AVGRATE2), RATE_CODE, vDAY1, vDAY2, vDAY3, vDAY4,
vDAY5, vDAY6, vDAY7, vWEEKEND1, vWEEKEND2, vWEEKEND3, vWEEKEND4, vWEEKEND5,
vWEEKEND6, vWEEKEND7
from temp_rate
group by room_cat,resort_id, VDESC, RATE_CODE, vDAY1, vDAY2, vDAY3, vDAY4,
vDAY5, vDAY6, vDAY7, vWEEKEND1, vWEEKEND2, vWEEKEND3, vWEEKEND4, vWEEKEND5,
vWEEKEND6, vWEEKEND7;
close cur1;
end rateq2;
lee1212

Hi,
No need to use the temp table.
No need for the explicit cursor.
This will be a much faster may to do it:
create or replace procedure rateq2 (
   p_arrdt in date
   , p_depdt in date
   , p_rate_code in varchar2
   , p_resort_id in varchar2
   , p_recordset out types.cursor_type
as
begin
   open p_recordset for
      select rh.resort as rh_resort
      , rrc.room_category as rm_cat
      , initcap(rrmcat.long_description) as rm_desc
      , avg(rd.rate1) as rd_rate1
      , avg(rd.rate2) as rd_rate2
      , rh.rate_code as rh_rate_code
      , rh.day1 as rh_day1
      , rh.day2 as rh_day2
      , rh.day3 as rh_day3
      , rh.day4 as rh_day4
      , rh.day5 as rh_day5
      , rh.day6 as rh_day6
      , rh.day7 as rh_day7
      , rh.weekend1 as rh_weekend1
      , rh.weekend2 as rh_weekend2
      , rh.weekend3 as rh_weekend3
      , rh.weekend4 as rh_weekend4
      , rh.weekend5 as rh_weekend5
      , rh.weekend6 as rh_weekend6
      , rh.weekend7 as rh_weekend7
      from pms_rate_header rh
      , pms_rate_detail rd
      , pms_rate_room_cat rrc
      , resort_room_category rrmcat
      where rd.rate_header_id = rh.rate_header_id
      and rrc.rate_detail_id = rd.rate_detail_id
      and rrc.resort = rh.resort
      and rrmcat.resort = rh.resort
      and rrmcat.room_category = rrc.room_category
      and rh.inactive_date is null
      and rd.inactive_date is null
      and rrc.inactive_date is null
      and rrmcat.inactive_date is null
      and rh.begin_date <= p_depdt
      and rh.end_date >= p_arrdt
      and rd.begin_date <= p_depdt
      and rd.end_date >= p_arrdt
      and rh.resort = p_resort_id
      and rh.rate_code = p_rate_code
      group by rrc.room_category
      , rh.resort
      , initcap(rrmcat.long_description)
      , rh.rate_code
      , rh.day1
      , rh.day2
      , rh.day3
      , rh.day4
      , rh.day5
      , rh.day6
      , rh.day7
      , rh.weekend1
      , rh.weekend2
      , rh.weekend3
      , rh.weekend4
      , rh.weekend5
      , rh.weekend6
      , rh.weekend7
end rateq2;cheers,
Anthony
Message was edited by:
Anthony Wilson
Posted the wrong version...

Similar Messages

  • Help needed with variable - trying to get data from Oracle using linked svr

    Sorry if I posted this in the wrong forum - I just didn't know where to post it.
    I'm trying to write a simple stored procedure to get data from an oracle database via a linked server in SQL Enterprise manager. I have no idea how to pass a variable to oracle.
    Here's how I would get the variable in SQL:
    declare @maxkey INTEGER
    select @maxkey= MAX(keyfield) from [server].Data_Warehouse.dbo.mytable
    select * from [server].Data_Warehouse.dbo.mydetailtable where keyfield=@maxkey
    the select statement I need to do in oracle would use that variable like this:
    select * from OPENQUERY(OracleLinkedServer,'select
    * from ORACLEDB.TABLE where keyfield > @maxkey')
    and I get this message: OLE DB provider "OraOLEDB.Oracle" for linked server "OracleLinkedServer" returned message "ORA-00936: missing expression".
    I realize that I can't pass the @maxkey variable to oracle - so how do I accomplish this?

    Please refer the example in this link which deals with Oracle date format.
    You can finnd a command DECODE which is used for date formats. If you have a look at whole theory then you will get an idea.
    Link:[Bulk insert SQL command to transfer data from SAP to Oracle|http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bulk-insert-sql-command-to-transfer-data-from-sap-to-oracle-cl_sql_connection-3780804]

  • How to get data from PostgresSQL to Oracle 11g

    I have a general idea on the topic but need more information on the procedure to get data from Postgres (version 8.2 on Linux) database to Oracle 11g (on AIX Unix). Thanks very much in advance!

    You need to configure DG4ODBC (=Database Gateway for ODBC). When you install it on a 64bit OS (for example on the same machine as your Oracle database), then it requires a 64bit Postgres ODBC driver. If you install it on a 32bit machine (for example on a 32bit Linux), then you need a 32bit Postgres ODBC driver. Commonly on Unix you also need to install a matching ODBC Dreiver Manager (for example you can get it from www.unixodbc.org) when Postgres doesn't ship one with their driver.
    A note describing the DG4ODBC configuration can be found on My Oracle Support:
    How to Setup DG4ODBC on Linux x86 32bit          (Doc ID 466228.1)
    and
    How to Setup DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX)          (Doc ID 561033.1)

  • What are the procedures for getting Apple to remotely wipe all my data off my ipad that was stolen? I have no hope of recovering it. Please advise asap...thanks!

    What are the procedures for getting Apple to wipe the data off my original ipad I bought two years ago. I had it stolen from a hotel room over the weekend and it is not password protected and no I did not download app to find it.
    Any hwlp would be greting appreciated!

    Apple can't do it, only you could potentially do it if you had enabled Find My iPad on it before it was stolen.
    If it was stolen then you should report it to the police. As a safety precaution you should also change your iTunes account password, your email account passwords, and any passwords that you'd stored on websites/emails/notes etc.

  • Front-End Service Starup Error: Store procedure to GET progress vector failed.

    Hi,
    We have a two front end servers in our Lync deployment and I'm getting an interesting error message on one of the servers when the "Lync Server Front-End Service" is starting up. All the services on that server will eventually start but I'm pretty
    sure it's affecting users in some way.
    Here is the error message in the Event Viewer:
    Log Name:      Lync Server
    Source:        LS User Services
    Date:          2013-09-17 8:00:32 AM
    Event ID:      32194
    Task Category: (1006)
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      BGC-VAN-LYNC2.domain.ca
    Description:
    Store procedure to GET progress vector failed.
    Execution Error: 0x00000000(ERROR_SUCCESS).
    Native Error: 8144.
    Error Details: [# [Microsoft][SQL Server Native Client 11.0][SQL Server]Procedure or function SyncReplicationGetProgressVector has too many arguments specified. #].
    Cause: This may indicate a problem with connectivity to local database or some unknown product issue.
    Resolution:
    Ensure that connectivity to local database is proper. If the error persists, please contact product support with server traces.
    Event Xml:
    <Event xmlns=>
      <System>
        <Provider Name="LS User Services" />
        <EventID Qualifiers="50158">32194</EventID>
        <Level>2</Level>
        <Task>1006</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2013-09-17T15:00:32.000000000Z" />
        <EventRecordID>16971</EventRecordID>
        <Channel>Lync Server</Channel>
        <Computer>BGC-VAN-LYNC2.domain.ca</Computer>
        <Security />
      </System>
      <EventData>
        <Data>0x00000000(ERROR_SUCCESS)</Data>
        <Data>8144</Data>
        <Data>[# [Microsoft][SQL Server Native Client 11.0][SQL Server]Procedure or function SyncReplicationGetProgressVector has too many arguments specified. #]</Data>
      </EventData>
    </Event>
    The error happens 15 times every minute, following with this event:
    Name:      Lync Server
    Source:        LS User Services
    Date:          2013-09-17 8:23:46 AM
    Event ID:      32189
    Task Category: (1006)
    Level:         Information
    Keywords:      Classic
    User:          N/A
    Description:
    The following Fabric service for routing groups have been closed:
    {F515134C-71B7-52FD-B0C3-6A9DB39CF750}
    {8A5D6B36-2A01-53DB-BC4E-3286C05E0836}
    {B35AAFC9-F6BF-5FFE-8C31-4AA5C36B2065}
    {69223418-78DC-5066-81A8-78E05914EC7B}
    {80414C96-1137-5DDC-8387-C3EA7A54B078}
    {641E6ABD-B862-55A1-B1B1-C83BC92D2F85}
    {1EA68EA4-77F7-5CFC-B781-0093CBC18403}
    {2FDE333D-FF7F-5D6A-B85B-93ADC1EAC12A}
    {A43BBA3A-8963-51C4-BD7A-19E1EC3DDFDB}
    {D3F4532F-61C8-5072-9B3B-3E2CCF15442F}
    {4449243E-5E96-56AC-AB6B-C5E785543542}
    {58B30261-65B6-5F6A-BC50-60F85782D052}
    {DB4B76B0-2510-5BF8-A7B1-8B37BD3AA7B9}
    {917CC217-966B-56AC-A912-97BA64BA13EB}
    Anyone knows what this is about and how to resolve this?
    Thanks,
    VH.

    Hi,
    Please try to reset registrar state:
    http://tsoorad.blogspot.in/2013/04/lync-2013-ee-pool-wont-start.html
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make
    sure that you completely understand the risk before retrieving any suggestions from the above link.
    Kent Huang
    TechNet Community Support

  • SSRS - Oracle Stored procedure returns no data but does in SQL Developer Sudio

    HI there,
    Stored procedure returns no data when executed on the report but when i execute the stored procedure in Sql Developer it returns required rows.
    Thanks for your help!

    Hi Simon,
    When i test with simple query, i get the data.
    For your convenience, my stored proc looks lyk :
    PROCEDURE pr_REPORT_data(P_STARTDATE IN DATE, P_ENDDATE IN DATE, data_rows OUT T_CURSOR) AS 
    OPEN completed_Reinstatement FOR
      SELECT 
                 value1,.......value5
      FROM table1
    WHERE
        To_Date(createdDate, 'YYYY/MM/DD') BETWEEN To_Date(P_STARTDATE, 'YYY/MM/DD') AND To_Date(P_ENDDATE, 'YYYY/MM/DD');
    END pr_REPORT_data;          
    T_CURSOR is of type cursor which is declared on the package.
    I'm assuming the problem is with date parameters, however i converted the date before passing to
    WHERE clause. 

  • PL/SQL procedure to insert data doesn't work and unable to find reason.

    Sorry that I couldn't find the best place to post this question. It seems that the forum does not deal with this kind of question. I post here for help.
    I have a stored procedure to insert data into one table. SP was compiled without error and executed without error (from log table to get information). But the data was not inserted into
    the target table. I have tried different way to figure out the reason. But I failed to get any idea. Please help me to find possible reasons. The smple SP looks like this:
    CREATE OR REPLACE PROCEDURE my.sp_insert( P_DATE IN VARCHAR2)
    IS
    declare section
    begin
    insert into target_table (column1, column2, column3, column4)
    select record1, record2, record3, record4 from table1, table2, table3, table4
    where clause;
    commit;
    exception section
    UPDATE PROCESS_LOG_TABLE CLAUSE;
    html_email section;
    rollback;
    end my.sp_insert
    I have tested that "select record1, record2, record3, record4 from table1, table2, table3, table4" really fetch the 7,000 records. and if I only run part of SQL from SQLPLUS as
    insert into target_table (column1, column2, column3, column4)
    select record1, record2, record3, record4 from table1, table2, table3, table4
    where clause;
    It will work and insert 7,000 records into target table. Why did it not insert into target_table when execiting as stored procedure? Please help with your input. Thanks.
    Edited by: citicbj on Feb 12, 2013 4:15 PM

    Dear Friend,
    Is the user from which you created database procedure and sqlplus that you tested the code successfully is same?
    Regards
    Ahamed Rafeeque Cherkala

  • TS3579 I found this useful because I did not know about the effect of typing in data and that you could only drag to rearrange the data.  I had typed in data before and this had caused problems but restoring defaults did not cause correct dates to show up

    I found this  (TS3579: If the wrong date or time is displayed in some apps on your Mac Learn about If the wrong date or time is displayed in some apps on your Mac) useful because I did not know about the effect of typing in data and that you could only drag to rearrange the data.  I had typed in data before and this had caused problems but restoring defaults did not cause correct dates to show up in Finder. 

    It sounds like there are a couple things going on here.  First check if you have a successful install of SQL Server, then we'll figure out the connection issues.
    Can you launch SQL Server Configuration Manager and check for SQL Server (MSSQLSERVER) if default instance or SQL Server (other name) if you've configured your instance as a named instance.  Once you find this, make sure the service is started. 
    If not started, try to start it and see if it throws an error.  If you get an error, post the error message your hitting.  If the service starts, you can then launch SSMS and try to connect.  If you have a default instance, you can use the machine
    name in the connection dialog.  Ex:  "COWBOYS" where Cowboys is the machine name.  However, if you named the SQL Server instance during install, you'll need to connect using the machine\instance format.  Ex:  COWBOYS\Romo (where Romo
    is the instance name you set during install).
    You can also look at the summary.txt file in the SQL Server setup error logs to see what happened on the most recent install.  Past install history is archived in the log folder if you need to dig those up to help troubleshoot, but the most
    recent one may help get to the bottom of it if there is an issue with setup detecting a prior instance that needs to be repaired.
    Thanks,
    Sam Lester (MSFT)
    http://blogs.msdn.com/b/samlester
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
    "Mark as Answer" and
    "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

  • Using sharepoint designer 2013 - connected to sharepoint online - but getting " data source file cannot be saved" after making a new linked datasource

    using sharepoint designer 2013 - connected to sharepoint online - but getting " data source file cannot be saved" after making a new linked datasource

    Hi,
    Based on your description, I have done a test and I can’t reproduce your issue.
    I have used SharePoint Designer 2013 to open a SharePoint Online site and there are no issues.
    I’d like to clarify whether you encounter any issues when accessing SharePoint Online sites. If there are no issues during the accessing procedure, SharePoint Online service should be working fine at your side. The issue may be caused by specific SharePoint
    Designer client or network. I suggest you refer to the following steps to troubleshoot the issue.
    1. Use SharePoint Designer to open another site and check whether it is successful.
    2. When you are prompted to enter Office 365 account and password, try other users’ accounts and select the remembering the credential.
    3. Perform the connection procedure under another environment and verify whether the issue is resolved.
    If the issue persists, can you provide related screenshots for further troubleshooting?
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • Getting data stored in ref cursor ( got from store proc in oracle) to excel sheet)

    Hey, I am trying to Get data stored in ref cursor ( got from store proc in oracle) to excel sheet in a virtual folder using ssis. 
    I am getting errors and cant do it. If anyone can help me

    Hi Nabin000,
    The Oracle stored procedure doesn't work with SSIS source adapters such as OLE DB Source because the data provider doesn't provide metadata for the source adapter. To achieve your goal, you can use a Script Component as source to call
    the Oracle stored procedure by using System.Data.OracleClient OracleDataReader, and get the rows and add them to the pipeline buffer. For more information, please see:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/1d0b3a1b-8792-469c-b0d1-f2fbb9e9ff20/dump-oracle-ref-cursor-into-ms-sql-staging-table-using-ssis
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/fcdaa97e-8415-4c3e-8ffd-1ad45b590d57/executing-an-oracle-stored-procedure-from-ssis?forum=sqlintegrationservices 
    http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oracledatareader(VS.90).aspx 
    Regards,
    Mike Yin
    TechNet Community Support

  • Cannot get data of the row from OLE DB provider "OraOLEDB.Oracle" for linked server

    I have created a stored procedure in SQL Server for a report that uses parameters.  In the report I am linking an Oracle table.  I use a subquery like this to query the Oracle table:  (select * from openquery(oracle_linked_server, 'select
    partno, description from oracletable')).  If I run the subquery it works fine every time.  The linked server uses an oracle account which has access to the oracle table.  When I first created the Stored Procedure it worked fine for me.  When
    I test the report, it worked fine.  Then I asked another user to test it and it broke with the below error message.  
    OLE DB provider "OraOLEDB.Oracle" for linked server "XXXX_ORACLE" returned message "ORA-01403: no data found".
    Msg 7346, Level 16, State 2, Procedure usp_report_XXXXXX, Line 15
    Cannot get the data of the row from the OLE DB provider "OraOLEDB.Oracle" for linked server "XXXX_ORACLE".
    Now when I try the report or the stored procedure, I get the same error.  I tested the oracle subquery in the stored procedure and it still works.  The report uses a service account to execute the stored procedure.
    I am using SQL Server 2012 Developer Edition 64 bit (11.0.5058) Management Studio to develop the stored procedure.  The SQL Server I am accessing and running the stored procedure is SQL Server 2008R2 Developer Edition 64bit (10.50.2550).  The user
    that tested the report for me has SQL Server 2008R2 but that shouldn't matter since he is running the report in Internet Explorer.
    What is changing that it works for a while and then stops?
    Fred
    Fred Schmid

    I found the answer.  It was in the query.  I put the TRIM statement on the part# field in the Oracle subquery and took the LTRIM function out of the ON clause that joined my SQL Server table with the Oracle linked server table.  Now everything
    works.  The query looks like this:
    SQL_Server_Table sst
    LEFT OUTER JOIN
    (SELECT * FROM OPENQUERY(OracleLinkedServer, 'SELECT TRIM(partNo) AS partNo, partDesc FROM OracleTable')) ols
    ON sst.partNo = ols.partNo
    Thanks for pointing me in the right direction.
    Fred Schmid

  • How to GET data from external secure website?

    We are trying to get data from a secure website. It is something like I try to get my bank statement online, where I have a user id and password to the secure website and try to get the data from XI.
    Does anybody have any idea how we could do it? What adapter should be used.
    I would really appreciate your help and award points.
    Thank,
    Arjun.

    Hi,
    Depends on how u are connecting to the website and getting the data.
    But you can do this using HTTP/Java Proxies. You can use HTTP if you are connecting via a URL. thats the most standard procedure.
    Regards
    vijaya

  • BEx Get Data Issue

    Hi everyone,
    The basic issue is workbook is not retrieving the data back from the cube.we want to know how to check like why it is not retrieving data .
    Is their any settings for this in back end, how to check and any procedure to find out?
    There are two formulas here BEx Get Data and BEx Set Data.
    BEx Set Data is used to push the data into the cube from workbook.
    Bex Get Data is for getting the data from cube into workbook.
    so when users enter some values ,it is going into the real time cube in the backend but next time when user cums into the workbook he is not finding the last inputted data.it is supposed to go to the cube and then *** to workbook again because next time when user enters the workbook he should see last inputted data.when he enters some values in cube and saving it ,it is going into the cube but it is not coming back to workbook again.
    Can anyone throw some light on how should I proceesd and find where the issue is. I want to know the Flow from Workbook using BEx Get Data , how does this formula interact with BI REal Time Cube.
    Regards,
    Ak

    Hi,
       I'm not sure what do you mean by these.
    Is their any settings for this in back end, how to check and any procedure to find out?
    There are two formulas here BEx Get Data and BEx Set Data.
    BEx Set Data is used to push the data into the cube from workbook.
    Bex Get Data is for getting the data from cube into workbook.
    Are you trying to write data back into cube through input ready Query?  Are you using Web or BEx analyzer?
    could you please provide more details on your requirements..
    Balaji

  • Getting data from 7 tables

    I am converting a servlet based application to struts framework.I have a screen which gets data from 7 tables.I cannot use a stored procedure so has to manage using SQL queries.I thought i will query each table and set it to my struts form.The screen has lot of drop down boxes .
    I have heard of composite design pattern .Please let me know the best way to query the tables.Here are the queries.
    Select a.proj_id , a.proj_nm
    From stn_proj_et a, stn_proj b
    Where a.proj_id = b.proj_id
    And a.sftwr_id = 24
    And b.stn_id = 56602;
    Select round(utm_x,3) utm_x, round(utm_y,3) utm_y, stn_id
    From stn_loc_hist
    Where stn_id ='56602'
    And cur_use_cd = 1
    select data_tp_cd
    from data_coll_summ
    where stn_id ='56002'
    And rownum < 2;
    select lat_no,long_no,pnt_loc_dsc,srce_id,mthd_dtrmn_cd,ctrl_dtm_cd
    from stn_et
    where stn_id = '56002';
    select
    distinct sjr_utils.getcatalogvalue(mthd_dtrmn_cd)
    from stn_et;
    select
    distinct sjr_utils.getcatalogvalue(ctrl_dtm_cd)
    from stn_et;
    select distinct PROJ_NM from stn_proj_et where sftwr_id=24;
    Select a.stn_alias_nm stn_alias_nm, b.alias_orgn_nm alias_orgn_nm
    From stn_alias_nm a, alias_orgn_et b
    Where a.alias_orgn_id = b.alias_orgn_id
    And b.alias_orgn_tp = 0
    And stn_id = '56002';

    adithiananya wrote:
    I am converting a servlet based application to struts framework.How well do you know Struts?
    I have a screen which gets data from 7 tables.I cannot use a stored procedure so has to manage using SQL queries.I thought i will query each table and set it to my struts form.The screen has lot of drop down boxes .You don't need a stored procedure to query a database.
    I have heard of composite design pattern .This ain't it.
    Please let me know the best way to query the tables.Here are the queries.
    Select a.proj_id , a.proj_nm
    From stn_proj_et a, stn_proj b
    Where a.proj_id = b.proj_id
    And a.sftwr_id = 24
    And b.stn_id = 56602;What are those hard-wired magic numbers in the WHERE clause?
    >
    Select round(utm_x,3) utm_x, round(utm_y,3) utm_y, stn_id
    From stn_loc_hist
    Where stn_id ='56602'
    And cur_use_cd = 1What are those hard-wired magic numbers in the WHERE clause?
    >
    select data_tp_cd
    from data_coll_summ
    where stn_id ='56002'
    And rownum < 2;What are those hard-wired magic numbers in the WHERE clause?
    >
    select lat_no,long_no,pnt_loc_dsc,srce_id,mthd_dtrmn_cd,ctrl_dtm_cd
    from stn_et
    where stn_id = '56002';
    select
    distinct sjr_utils.getcatalogvalue(mthd_dtrmn_cd)
    from stn_et;
    select
    distinct sjr_utils.getcatalogvalue(ctrl_dtm_cd)
    from stn_et;
    select distinct PROJ_NM from stn_proj_et where sftwr_id=24;What are those hard-wired magic numbers in the WHERE clause?
    Select a.stn_alias_nm stn_alias_nm, b.alias_orgn_nm alias_orgn_nm
    From stn_alias_nm a, alias_orgn_et b
    Where a.alias_orgn_id = b.alias_orgn_id
    And b.alias_orgn_tp = 0
    And stn_id = '56002';What are those hard-wired magic numbers in the WHERE clause?
    Do you really want to execute different requests given input from the users? (e.g., enter a value in a text box and see the drop down list boxes change)
    %

  • List of Customer having information about dunning procedure in M.Data

    Hi all,
    Could any one tell me hoe to get list of customer/vendor having information about the dunning procedure in Master Data..
    thanks in advance..

    For customers check table KNB5 and for Vendor LFB5 at SE16
    Srinivas

Maybe you are looking for