Date logic implementation in store proc

Monthly – 5<sup>th</sup> day of each month including on holidays or weekends   

Hmm..do you mean excluding holidays and weekends? Otherwise 5th day of month is always having date as 5 :-)
If you meant excluding you can use this logic based on calendartable
SELECT MAX(Date) AS [5thDay]
FROM
SELECT TOP 5 [Date]
FROM CalendarTable
WHERE WeekDay = 1
ORDER BY [Date]
)t
If holiday info is in seperate table then use this
SELECT MAX(Date) AS [5thDay]
FROM
SELECT TOP 5 [Date]
FROM CalendarTable c
WHERE WeekDay = 1
AND NOT EXISTS (
SELECT 1
FROM HolidayTable
WHERE [Date] = c.[Date]
ORDER BY [Date]
)t
if you want this to be returned for every month use this
SELECT [Date] AS [5thDay]
FROM
SELECT ROW_NUMBER() OVER (PARTITION BY DATEDIFF(mm,0,[Date]) ORDER BY [Date]) AS Rn,
[Date]
FROM CalendarTable
AND NOT EXISTS (
SELECT 1
FROM HolidayTable
WHERE [Date] = c.[Date]
WHERE WeekDay = 1
ORDER BY [Date]
)t
WHERE Rn = 5
If you dont have a calendartable already you can use this UDF instead
http://visakhm.blogspot.in/2010/02/generating-calendar-table.html
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page

Similar Messages

  • 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

  • Can we use WHO columns in Business Logic implementation

    Hi,
    Can we use WHO columns for business logic implementation..?
    From one table I need to pick up the latest record. I have a ActionDate column in the table which stores the date of the action.
    But on the same day there can be multiple action records. ie Multiple records have same ActionDate.
    Select * from action_table where action_date=(maximum action_date)
    The above query will return more than 1 record.
    Now can I use the Creation_Date which is a WHO column to identify the latest record..?
    Will it introduce any issues if I use creation_date WHO column?
    Usage of WHO column in application logic, Is it against the Standards ?
    Thanks a lot.

    I guess you are talking about populating the value using the history column creation_dt from EO.
    If so, you can use then. We are using them in all our applications to populate WHO columns of our table.
    Infact as far as I know, even Oracle application uses them.
    They generally populate the timestamp, so you may need to format them when doing date comparisons.
    Hope that helps.
    Amit

  • How to do sorting/filtering on custom java data source implementation

    Hi,
    I have an entity driven view object whose data should be retrieved and populated using custom java data source implementation. I've done the same as said in document. I understand that Query mode should be the default one (i.e. database tables) and createRowFromResultSet will be called as many times as it needs based on the no. of data retrieved from service, provided we should write the logic for hasNextForCollection(). Implementation sample code is given below.
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams) {      
    Iterator datumItr = retrieveDataFromService(qc, params);
    setUserDataForCollection(qc, datumItr);
    hasNextForCollection(qc);
    super.executeQueryForCollection(qc, params, noUserParams);
    protected boolean hasNextForCollection(Object qc) {
    Iterator datumItr = (Iterator) getUserDataForCollection(qc);
    if (datumItr != null && datumItr.hasNext()){
    return true;
    setCallService(false);
    setFetchCompleteForCollection(qc, true);
    return false;
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet resultSet) {
    Iterator datumItr = (Iterator) getUserDataForCollection(qc);
    Object datumObj = datumItr.next();
    ViewRowImpl r = createNewRowForCollection(qc);
    return r;
    Everything is working fine include table sorting/filtering. Then i noticed that everytime when user perform sorting/filtering, executeQueryForCollection is called, which in turn calls my service. It is a performance issue. I want to avoid. So i did some modification in the implementation in such a way that, service call will happen only if the callService flag is set to true, followed by executeQuery(). Code is given below.
    private boolean callService = false;
    public void setCallService(boolean callService){
    this.callService = callService;
    public boolean isCallService(){
    return callService;
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams){
    if (callService)
    Iterator datumItr = retrieveDataFromService(qc, params);
    setUserDataForCollection(qc, datumItr);
    hasNextForCollection(qc);
    super.executeQueryForCollection(qc, params, noUserParams);
    Issue i have:
    When user attempts to use table sort/filter, since i skipped the service call and set null as userDataCollection, createRowFromResultSet is not called and data which i retrieved and populated to view object is totally got vanished!!. I've already retrived data and created row from result set. Why it should get vanished? Don't know why.
    Tried solution:
    I came to know that query mode should be set to Scan_Entity_Cache for filtering and Scan_View_Rows for sorting. I din't disturb the implementation (i.e. skipping service call) but overrided the executeQuery and did like the following code.
    @Override
    public void executeQuery(){
    setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
    super.executeQuery();
    By doing this, i could able to do table filtering but when i try to use table sorting or programmatic sorting, sorting is not at all applied.
    I changed the code like beolw*
    @Override
    public void executeQuery(){
    setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
    super.executeQuery();
    Now sorting is working fine but filtering is not working in an expected way because Scan_View_rows will do further filtering of view rows.
    Question:
    I don't know how to achieve both filtering and sorting as well as skipping of service call too.
    Can anyone help on this?? Thanks in advance.
    Raguraman

    Hi,
    I have an entity driven view object whose data should be retrieved and populated using custom java data source implementation. I've done the same as said in document. I understand that Query mode should be the default one (i.e. database tables) and createRowFromResultSet will be called as many times as it needs based on the no. of data retrieved from service, provided we should write the logic for hasNextForCollection(). Implementation sample code is given below.
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams) {
      Iterator datumItr = retrieveDataFromService(qc, params);
      setUserDataForCollection(qc, datumItr);
      hasNextForCollection(qc);
      super.executeQueryForCollection(qc, params, noUserParams);
    protected boolean hasNextForCollection(Object qc) {
      Iterator datumItr = (Iterator) getUserDataForCollection(qc);
      if (datumItr != null && datumItr.hasNext()){
        return true;
      setFetchCompleteForCollection(qc, true);
      return false;
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet resultSet) {
      Iterator datumItr = (Iterator) getUserDataForCollection(qc);
      Object datumObj = datumItr.next();
      ViewRowImpl r = createNewRowForCollection(qc);
      return r;
    }Everything is working fine include table sorting/filtering. Then i noticed that everytime when user perform sorting/filtering, executeQueryForCollection is called, which in turn calls my service. It is a performance issue. I want to avoid. So i did some modification in the implementation in such a way that, service call will happen only if the callService flag is set to true, followed by executeQuery(). Code is given below.
    private boolean callService = false;
    public void setCallService(boolean callService){
      this.callService = callService;
    public boolean isCallService(){
      return callService;
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams){
      if (callService) {
        Iterator datumItr = retrieveDataFromService(qc, params);
        setUserDataForCollection(qc, datumItr);
      hasNextForCollection(qc);
      super.executeQueryForCollection(qc, params, noUserParams);
    }Issue i have:
    When user attempts to use table sort/filter, since i skipped the service call and storing of userDataCollection, createRowFromResultSet is not called and data which i retrieved and populated to view object is totally got vanished!!. I've already retrived data and created row from result set. Why it should get vanished? Don't know why.
    Tried solution:
    I came to know that query mode should be set to Scan_Entity_Cache for filtering and Scan_View_Rows for sorting. I din't disturb the implementation (i.e. skipping service call) but overrided the executeQuery and did like the following code.
    @Override
    public void executeQuery(){
      setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
      super.executeQuery();
    }By doing this, i could able to do table filtering but when i try to use table sorting or programmatic sorting, sorting is not at all getting applied.
    I changed the code like below one (i.e. changed to ViewObject.QUERY_MODE_SCAN_VIEW_ROWS instead of ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS)
    @Override
    public void executeQuery(){
      setQueryMode(callService ? ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES : ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
      super.executeQuery();
    }Now sorting is working fine but filtering is not working in an expected way because Scan_View_rows will do further filtering of view rows.
    If i OR'ed the Query Mode as given below, i am getting duplicate rows. (vewObject.QUERY_MODE_SCAN_ENTITY_ROWS | ViewObject.QUERY_MODE_SCAN_VIEW_ROWS) Question:
    I don't know how to achieve both filtering and sorting as well as skipping of service call too.
    Can anyone help on this?? Thanks in advance.
    Raguraman
    Edited by: Raguraman on Apr 12, 2011 6:53 AM

  • DropDown List Problem for Dynamic Store Proc Parameter in SAP B1 8.8

    I am working with the crystal report 2008 in SAP B1 8.8 and the report is used the Store Proc for retrieving data. As i need to show a list of Documnet No (DOCNUM) from Sales Order (ORDR) and Purchase Order (OPOR) for the users to select, i use the Dynamic Parameter as for the Store Proc parameter (@Contno), However, the drop down list can be shown fine in Crystal Report, but cant be shown in "Report Selection Criteria" while opening the Crystal Report through SAP B1.
    Therefore, can anyone tell me how to add the dynamic drop down list (cause the documnet no list will be changed very frequently) in the  SAP B1 8.8  "Report Selection Criteria" screen.
    Thanks!!

    Classic Crystal Reports and Classic SAP connectivity questions
    Classic Crystal Reports and Classic SAP connectivity questions

  • To convert the "IBM DB2 Store Procs written in C" to Oracle PL-SQL

    Hi, Is it possible to convert the "IBM DB2 Store Procs written in C" to Oracle PL-SQL. If you have any info, PL do let me know. Thanks in advance.
    EG :
    /* SMG Stored Procedures */
    /* DB2 Stored Procedure: OrganisationExists */
    /* Linkage: SIMPLE (no NULLs permitted) */
    /* Load module name: SMGEC00 */
    /* Purpose: DELETE FROM SSE_LOOKUP_MAP */
    /* to run. */
    /* Parameters: argvÝ1¨ short - return error code - OUT */
    /* argvÝ2¨ char - return error message - OUT */
    /* argvÝ3¨ char - BLEID - IN */
    /* Reason for edit Date Who */
    /* Initial version 09/04/03 Arockia */
    #pragma runopts(plist(os))
    #include <stdlib.h>
    #include <string.h>
    void main (int argc, char *argvݨ)                                             
    EXEC SQL INCLUDE SQLCA;
    EXEC SQL BEGIN DECLARE SECTION;
    char bleid??(12??);
    EXEC SQL END DECLARE SECTION;
    /* Set defaults for error code (argvÝ1¨) and error message (argvÝ2¨) */
    strcpy(argv??(2??)," ");
    *(int *)argv??(1??) = 0;
    strcpy(bleid,argv??(3??));
    EXEC SQL
    DELETE FROM SSE_LOOKUP_MAP
    WHERE BLEID = :bleid;
    /* Set error code to record status of last SQL command */
    *(int *)argv??(1??) = SQLCODE;
    return;

    For this program, you could do some thing like:
    SQL> CREATE TABLE sse_lookup_map(BLEID varchar2(10));
    Table created.
    SQL> CREATE or replace PROCEDURE test(p_bleid_in IN varchar2)
      2  AS
      3  BEGIN
      4  DELETE FROM sse_lookup_map
      5  WHERE BLEID = p_bleid_in;
      6  END;
      7  /
    Procedure created.
    SQL> ed
    Wrote file afiedt.buf
      1* INSERT INTO sse_lookup_map values('test1')
    SQL> /
    1 row created.
    SQL> ed
    Wrote file afiedt.buf
      1* INSERT INTO sse_lookup_map values('test2')
    SQL> /
    1 row created.
    SQL> SELECT * FROM sse_lookup_map;
    BLEID
    test1
    test2
    2 rows selected.
    SQL> EXEC test('test1')
    PL/SQL procedure successfully completed.
    SQL>  SELECT * FROM sse_lookup_map;
    BLEID
    test2
    1 row selected.
    SQL>

  • Pass parameters to sql store proc?

    Is it possible to pass parameters from Crystal Report to sql store proc? I know it will prompt for paramters if the report is built based on a parameterized store proc. I am NOT talking about these parameters. I still want user to be able to select parameter values from dropdowns and use them as the procedure parameters.
    Reason for my question is I don't want the store proc to create a table having all records then crystal makes report by filtering. The all-record table could grow huge very quickly as more data is put in.
    Thank you very much.

    Hi Peter
    Follow these steps:
    A. Following steps applies to the main procedure:
    1. Create a main report which accepts the same fields as you want to pass to the stored procedure. (Note that this main report is not based off the procedure that you want to execute. Just get the data that you want to pass to the procedure. We will call the procedure in the subreport.)
    2. Now create the no. of dynamic parameters that you want your user to choose the data from in the main report. (Lets assume that the user will select a single value.)
    B. Following section applies to the subreport:
    1. Add a subreport to the main report. This subreport will be based off your procedure. This will automatically add up the stored procedure parameters to the subreport.
    2. Take care that in the procedure you define the datatype of the parameters same as the field's data type that you want to pass to the procedure. This will show up your stored procedure parameters while subreport linking.
    3. Now link the main report to the subreport with each parameter. Uncheck the "Select data based on" dialog box while linking each parameter.
    Hope this post solves your problem. i am sorry for sounding descriptive.
    Regards
    Nikhil Sabnis

  • Store Proc

    Hi folks, I’m slowly building up my SP, I don’t fully understand the syntax yet.
    I’m trying to retrieve the Customer primary key that has been created for the new customer record, and then assign it to the @CustomerFK parameter, could you give me any pointers on this!
    ALTER PROCEDURE [dbo].[AddCustomerDetails]
    /***********************Declare variables ***********************/
    /******tblCustomer******/
    @CustomerID uniqueidentifier,
    @Forename nvarchar(50),
    @Surname nvarchar(50)
    /******tblOrder******/
    @OrderID uniqueidentifier,
    @CustomerFK nvarchar(50),
    @DateOrdered date,
    @TimeOrdered time,
    @AnyAdditionalInfo nvarchar(Max),
    As
    Begin TRANSACTION
    SET NOCOUNT ON
    INSERT INTO [TyreSannerSQL].[dbo].[Customers]
    (Forename,
    Surname)
    OUTPUT INSERTED.CustomerID INTO @CustomerFK
    VALUES
    (@Forename,
    @Surname)
    INSERT INTO [TyreSannerSQL].[dbo].[Order]
    (OrderID,
    CustomerFK,
    DateOrdered,
    TimeOrdered,
    AnyAdditionalInfo)
    VALUES
    (@OrderID,
    @CustomerFK,
    @DateOrdered,
    @TimeOrdered,
    @AnyAdditionalInfo)
    COMMIT TRANSACTION

    Hi folks, store proc is not working correctly,
    @OrderID uniqueidentifier and @OrderID, keep coming up with under line red
    SET @CustomerFK = SCOPE_IDENTITY()
    USE [TyreSannerSQL]
    GO
    /****** Object: StoredProcedure [dbo].[AddCustomerDetails] Script Date: 10/06/2014 20:49:31 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[AddCustomerDetails]
    /******tblCustomer******/
    @CustomerID uniqueidentifier,
    @Forename nvarchar(50),
    @Surname nvarchar(50)
    As
    Begin TRANSACTION
    SET NOCOUNT ON
    INSERT INTO [TyreSannerSQL].[dbo].[Customer]
    (Forename,
    Surname)
    VALUES
    (@Forename,
    @Surname)
    SET @CustomerFK = SCOPE_IDENTITY()
    /******tblOrder******/
    @OrderID uniqueidentifier,
    @CustomerFK uniqueidentifier,
    @DateOrdered date,
    @TimeOrdered time,
    @AnyAdditionalInfo nvarchar(Max),
    INSERT INTO [TyreSannerSQL].[dbo].[Order]
    (OrderID,
    CustomerFK,
    DateOrdered,
    TimeOrdered,
    AnyAdditionalInfo)
    VALUES
    @OrderID,
    @CustomerFK,
    @DateOrdered,
    @TimeOrdered,
    @AnyAdditionalInfo
    COMMIT TRANSACTIONA

  • Store Proc - Empty Value

    Hi folks, how do you write a store proc to return all tyre Speeds if no Speeds are selected, it won’t work with
    IS NULL!
    I have tried the following
    @Speed = ' ' and kind of works i.e. the first search work perfectly, but when you change one of the other
    dropdown list you get all the same results  regardless of what you have selected, it’s like the other dropdowns lists don’t filter the data after the first search!
    SQL
    WHERE  Width
    = @Width and Product.Profile
    = @Profile and Product.Diamete
    = @Diamete and Product.Speed
    = @Speed or @Speed
    = ' '
    and Suppliers.SupplierDistrict
    = LEFT(@CustPostcode,2)     
    ORDER
    BY Product.ProductUnitSalePrice
    ASC
    ASP
    <asp:DropDownList
    ID="DropDownList1"
    runat="server"
    DataSourceID="SqlDataSource1"
    DataTextField="Width"
    DataValueField="Width"
    Height="27px"
    style="margin-left:
    0px"
    Width="99px"
    AppendDataBoundItems="True">
      <asp:ListItem
    Text="Width"
    Value=""
    />
    </asp:DropDownList>
        <asp:DropDownList
    ID="DropDownList2"
    runat="server"
    DataSourceID="SqlDataSource3"
    DataTextField="Profile"
    DataValueField="Profile"
    Height="27px"
    Width="97px"
    AppendDataBoundItems="True">
    <asp:ListItem
    Text="Profile"
    Value=""
    />
        </asp:DropDownList>
        <asp:DropDownList
    ID="DropDownList3"
    runat="server"
    DataSourceID="SqlDataSource4"
    DataTextField="Diamete"
    DataValueField="Diamete"
    Height="29px"
    Width="97px"
    AppendDataBoundItems="True">
      <asp:ListItem
    Text="Diamete"
    Value
    =""
    />
        </asp:DropDownList>
        <asp:DropDownList
    ID="DropDownList4"
    runat="server"
    DataSourceID="SqlDataSource5"
    DataTextField="Speed"
    DataValueField="Speed"
    Height="29px"
    Width="99px"
    AppendDataBoundItems="True">
        <asp:ListItem
    Text="Select All"
    Value=" "
    />
    </asp:DropDownList>
    Brucey

    this?
    WHERE Width = @Width
    and Product.Profile = @Profile
    and Product.Diamete = @Diamete
    and (Product.Speed = @Speed
    or COALESCE(@Speed,'') = '')
    and Suppliers.SupplierDistrict = LEFT(@CustPostcode,2)
    ORDER BY Product.ProductUnitSalePrice ASC
    and set default value as blank at your front end
    ie
     <asp:DropDownList ID="DropDownList4" runat="server" DataSourceID="SqlDataSource5" DataTextField="Speed"DataValueField="Speed" Height="29px" Width="99px" AppendDataBoundItems="True">
        <asp:ListItem Text="Select
    All" Value="" />
        </asp:DropDownList>
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Store proc error

    i have a store proc writen in oracle, it has a cursor and it is fetching into variables.
    FETCH Jrecord into
    v_projectID,
    v_scounty,
    v_county_pct,
    v_existing_lane_cnt,
    v_proposed_lane_cnt,
    v_comnt,
    v_comnt_typ;
    the store proc works fine from oracle. i get data back as
    john,23,56,67,543 wells way, etc....
    but when i am calling it from the bean i am getting an error back on
    TPRO_J= P_TPRO.executeQuery();
    now do i call the name of the fields as in the database or use the variables to call. help please and i wonder if i should be giving alias for the columns
    ----------here is the bean--------------------------------------------
    public Vector getRecordJ(String ProjectID){
              ResultSet TPRO_J=null;
              try{
         System.out.println("a");
         CallableStatement P_TPRO=conOrcl.prepareCall("{call getJrecord(?)}");
         //assign the ? to the argument passed
         System.out.println("b");
              P_TPRO.setString(1,ProjectID);
         //execute the query
         System.out.println("c");
              TPRO_J= P_TPRO.executeQuery();
         //looping through the resultSet
         System.out.println("d");
         while (TPRO_J.next()){
              System.out.println("e");
         //create an instance of the class
              Conn JItems = new Conn();
         // set it to the Bean
              JItems.setCounty(TPRO_J.getString("county"));
              JItems.setCountyPct(TPRO_J.getInt("county_pct"));
              JItems.setexistingLane(TPRO_J.getInt("existing_lane_cnt"));
              JItems.setproposed_lane(TPRO_J.getInt("proposed_lane_cnt"));
              JItems.setcomnt(TPRO_J.getString("comnt"));
              JItems.setcomntType(TPRO_J.getString("comnt_typ"));
         //add the object to the vector
    V_itemsJ.addElement(JItems);
         }catch(SQLException w){
              System.out.println(w.getMessage());
         //returning the vector
                   return V_itemsJ;
    i am getting a message in the dos prompt
    a
    b
    c
    no resultset was produced
    it stops here
    help and thanx

    Since your output stops at "c", the error is occurring before printing "d". That is your line TPRO_J= P_TPRO.executeQuery();
    Try changing your prepareCall like this:
    CallableStatement P_TPRO = conOrcl.prepareCall("{call getJrecord ? }");
    Note that the ? is not in parenthesis.

  • Why doesn't Aperture use iPhoto's date logic?

    This is how image date logic works in iPhoto. This image date value is used in queries and sorts.
    1. Image date is stored in database.
    2. Initial value taken from image metadata if available.
    3. If image metadata not available, use file date.
    4. User can edit database date (does not change file header).
    This is how it seems to work in Aperture 1.5
    1. Image date is stored in database.
    2. Initial value taken from iPhoto database if import from iPhoto.
    3. If not import from iPhoto, initial value taken from image metadata if available.
    4. If image metadata not available, use file date.
    5. User CANNOT edit database date.
    I was shocked (really, I'm still stunned) that Aperture 1.5 still does not equal iPhoto's date management capabilities. Since Aperture is a Pro application it's reasonable to have several date fields, but one of them should behave like iPhoto. That metadata field should be useable in queries/filters, sorts, display, book printing, etc. It should be the default date metadata element for all date related operations.
    Please note, it's fine that Aperture does not muck with image file (exif) metadata -- that's dangerous. EXIF is a quasi-standard badly implemented.
    So now, my question. Why?
    Aperture 1.5 was a huge update. They fixed much more than I thought was possible. It could have been labeled Aperture 3.0. Offering it free to users was a genuine apology, gratefully accepted I'm sure. It took all my strength of will not to order it immediately, waiting instead for the initial reviews to come in.
    So there had to be a reason Aperture's Product Manager, Joe Schorr, had not to implement iPhoto's image date behavior. Something he'd thought carefully about.
    What was it?

    Perhaps it's just that they don't have infinite resources ?
    The big deal (for me) was that they can "import" files but leave them on the filesystem. In true Apple fashion though, they took the extra steps of allowing management of the images within the application (consolidate and relocate). Perhaps the knock-on effects of all the things they did implement prevented them from doing other things...
    We see Apple as a corporate entity, master of its domain, all-seeing, all-knowing, all-powerful within the confines of an Infinite Loop. In reality it's a bunch of people who only have a fixed number of hours in the day to work. Someone takes the decision that X is more important than Y and Y is dropped for this release - it's that simple IMHO.
    In any event, I'd like to know how many people worked on Aperture 1.5 - the difference between the Aperture update and the Lightroom update was huge! Do they have lots more engineers/QA, or did they just get more done in the same time-frame ?
    -=C=-
    Mac Pro   Mac OS X (10.4.7)  

  • Data Cartridge Implementation - PGA Memory Problem

    Hi,
    I have modified the Data Cartridge implementation explained in the article at http://www.oracle-developer.net/display.php?id=422.
    More precisely I have modified it to create not only the type returned, but also the select statement.
    The problem I have, is that the PGA memory through the execution of my package always increases, and when it ends the execution the PGA doesn't get released.
    I'm wondering if i'm missing something on the ODCITableClose.
    Object spec:
    create or replace type t_conf_obj as object
      atype anytype, --<-- transient record type
      static function ODCITableDescribe(rtype                  out anytype,
                                        p_cz_conf_categoria in     number,
                                        p_id_profilo        in     number   default null,
                                        p_cz_conf_livello   in     number   default null,
                                        p_dt_rif            in     varchar2 default to_char(sysdate,'ddmmyyyy')
                                       ) return number,
      static function ODCITablePrepare(sctx                   out t_conf_obj,
                                       tf_info             in     sys.ODCITabFuncInfo,
                                       p_cz_conf_categoria in     number,
                                       p_id_profilo        in     number   default null,
                                       p_cz_conf_livello   in     number   default null,
                                       p_dt_rif            in     varchar2 default to_char(sysdate,'ddmmyyyy')
                                      ) return number,
      static function ODCITableStart(sctx                in out t_conf_obj,
                                     p_cz_conf_categoria in     number,
                                     p_id_profilo        in     number   default null,
                                     p_cz_conf_livello   in     number   default null,
                                     p_dt_rif            in     varchar2 default to_char(sysdate,'ddmmyyyy')
                                    ) return number,
      member function ODCITableFetch(self  in out t_conf_obj,
                                     nrows in     number,
                                     rws      out anydataset
                                    ) return number,
      member function ODCITableClose(self in t_conf_obj
                                    ) return number
    );Object Body
    create or replace type body t_conf_obj as
      static function ODCITableDescribe(rtype                  out anytype,
                                        p_cz_conf_categoria in     number,
                                        p_id_profilo        in     number   default null,
                                        p_cz_conf_livello   in     number   default null,
                                        p_dt_rif            in     varchar2 default to_char(sysdate,'ddmmyyyy')
                                       ) return number
      is
        r_sql   pck_conf_calcolo.rt_dynamic_sql;
        v_rtype anytype;
        stmt    dbms_sql.varchar2a;
      begin
          HERE I CREATE MY SELECT STATEMENT
        if p_cz_conf_livello is null and p_id_profilo is null then
          stmt := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria
        elsif p_cz_conf_livello is not null then
          stmt (1) := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria,
                                                           p_id_profilo,
                                                           p_cz_conf_livello,
                                                           p_dt_rif
        else
          stmt (1) := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria,
                                                           p_id_profilo
        end if;
        || parse the sql and describe its format and structure.
        r_sql.cursor := dbms_sql.open_cursor;
        dbms_sql.parse(r_sql.cursor, stmt, stmt.first, stmt.last, false, dbms_sql.native);
        dbms_sql.describe_columns2(r_sql.cursor,
                                   r_sql.column_cnt,
                                   r_sql.description);
        dbms_sql.close_cursor(r_sql.cursor);
        || create the anytype record structure from this sql structure.
        anytype.begincreate(dbms_types.typecode_object, v_rtype);
        for i in 1 .. r_sql.column_cnt loop
          v_rtype.addattr(r_sql.description(i).col_name,
                          case
                          --<>--
                            when r_sql.description(i).col_type in (1, 96, 11, 208) then
                             dbms_types.typecode_varchar2
                          --<>--
                            when r_sql.description(i).col_type = 2 then
                             dbms_types.typecode_number
                            when r_sql.description(i).col_type in (112) then
                             dbms_types.typecode_clob
                          --<>--
                            when r_sql.description(i).col_type = 12 then
                             dbms_types.typecode_date
                          --<>--
                            when r_sql.description(i).col_type = 23 then
                             dbms_types.typecode_raw
                          --<>--
                            when r_sql.description(i).col_type = 180 then
                             dbms_types.typecode_timestamp
                          --<>--
                            when r_sql.description(i).col_type = 181 then
                             dbms_types.typecode_timestamp_tz
                          --<>--
                            when r_sql.description(i).col_type = 182 then
                             dbms_types.typecode_interval_ym
                          --<>--
                            when r_sql.description(i).col_type = 183 then
                             dbms_types.typecode_interval_ds
                          --<>--
                            when r_sql.description(i).col_type = 231 then
                             dbms_types.typecode_timestamp_ltz
                          --<>--
                          end,
                          r_sql.description(i).col_precision,
                          r_sql.description(i).col_scale,
                          r_sql.description(i).col_max_len,
                          r_sql.description(i).col_charsetid,
                          r_sql.description(i).col_charsetform);
        end loop;
        v_rtype.endcreate;
        || now we can use this transient record structure to create a table type
        || of the same. this will create a set of types on the database for use
        || by the pipelined function...
        anytype.begincreate(dbms_types.typecode_table, rtype);
        rtype.setinfo(null,
                      null,
                      null,
                      null,
                      null,
                      v_rtype,
                      dbms_types.typecode_object,
                      0);
        rtype.endcreate();
        return odciconst.success;
      exception when others then
        -- indicate that an error has occured somewhere.
        return odciconst.error;
      end odcitabledescribe;
      static function ODCITablePrepare(sctx                   out t_conf_obj,
                                       tf_info             in     sys.ODCITabFuncInfo,
                                       p_cz_conf_categoria in     number,
                                       p_id_profilo        in     number   default null,
                                       p_cz_conf_livello   in     number   default null,
                                       p_dt_rif            in     varchar2 default to_char(sysdate,'ddmmyyyy')
                                      ) return number
      is
        r_meta pck_conf_calcolo.rt_anytype_metadata;
      begin
        || we prepare the dataset that our pipelined function will return by
        || describing the anytype that contains the transient record structure...
        r_meta.typecode := tf_info.rettype.getattreleminfo(1,
                                                           r_meta.precision,
                                                           r_meta.scale,
                                                           r_meta.length,
                                                           r_meta.csid,
                                                           r_meta.csfrm,
                                                           r_meta.type,
                                                           r_meta.name);
        || using this, we initialise the scan context for use in this and
        || subsequent executions of the same dynamic sql cursor...
        sctx := t_conf_obj(r_meta.type);
        return odciconst.success;
      end;
      static function ODCITableStart(sctx                in out t_conf_obj,
                                     p_cz_conf_categoria in     number,
                                     p_id_profilo        in     number   default null,
                                     p_cz_conf_livello   in     number   default null,
                                     p_dt_rif            in     varchar2 default to_char(sysdate,'ddmmyyyy')
                                    ) return number
      is
        r_meta pck_conf_calcolo.rt_anytype_metadata;
        stmt    dbms_sql.varchar2a;
      begin
          HERE I CREATE MY SELECT STATEMENT
        if p_cz_conf_livello is null and p_id_profilo is null then
          stmt := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria
        elsif p_cz_conf_livello is not null then
          stmt(1) := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria,
                                                           p_id_profilo,
                                                           p_cz_conf_livello,
                                                           p_dt_rif
        else
          stmt(1) := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria,
                                                          p_id_profilo
        end if;
        || we now describe the cursor again and use this and the described
        || anytype structure to define and execute the sql statement...
        pck_conf_calcolo.r_sql.cursor := dbms_sql.open_cursor;
        dbms_sql.parse(pck_conf_calcolo.r_sql.cursor, stmt, stmt.first, stmt.last, false, dbms_sql.native);
        dbms_sql.describe_columns2(pck_conf_calcolo.r_sql.cursor,
                                   pck_conf_calcolo.r_sql.column_cnt,
                                   pck_conf_calcolo.r_sql.description);
        for i in 1 .. pck_conf_calcolo.r_sql.column_cnt loop
          || get the anytype attribute at this position...
          r_meta.typecode := sctx.atype.getattreleminfo(i,
                                                        r_meta.precision,
                                                        r_meta.scale,
                                                        r_meta.length,
                                                        r_meta.csid,
                                                        r_meta.csfrm,
                                                        r_meta.type,
                                                        r_meta.name);
          case r_meta.typecode
          --<>--
            when dbms_types.typecode_varchar2 then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor, i, '', 32767);
              --<>--
            when dbms_types.typecode_number then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as number));
              --<>--
            when dbms_types.typecode_date then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as date));
              --<>--
            when dbms_types.typecode_raw then
              dbms_sql.define_column_raw(pck_conf_calcolo.r_sql.cursor,
                                         i,
                                         cast(null as raw),
                                         r_meta.length);
              --<>--
            when dbms_types.typecode_timestamp then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as timestamp));
              --<>--
            when dbms_types.typecode_timestamp_tz then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as timestamp with time zone));
              --<>--
            when dbms_types.typecode_timestamp_ltz then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as timestamp with local time zone));
              --<>--
            when dbms_types.typecode_interval_ym then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as interval year to month));
              --<>--
            when dbms_types.typecode_interval_ds then
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as interval day to second));
              --<>--
            when dbms_types.typecode_clob then
              --<>--
              dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
                                     i,
                                     cast(null as clob));
              --<>--
          end case;
        end loop;
        || the cursor is prepared according to the structure of the type we wish
        || to fetch it into. we can now execute it and we are done for this method...
        pck_conf_calcolo.r_sql.execute := dbms_sql.execute(pck_conf_calcolo.r_sql.cursor);
        return odciconst.success;
      end;
      member function ODCITableFetch(self  in out t_conf_obj,
                                     nrows in     number,
                                     rws      out anydataset
                                    ) return number
      is
        type rt_fetch_attributes is record(
          v2_column    varchar2(32767),
          num_column   number,
          date_column  date,
          clob_column  clob,
          raw_column   raw(32767),
          raw_error    number,
          raw_length   integer,
          ids_column   interval day to second,
          iym_column   interval year to month,
          ts_column    timestamp,
          tstz_column  timestamp with time zone,
          tsltz_column timestamp with local time zone,
          cvl_offset   integer := 0,
          cvl_length   integer);
        r_fetch rt_fetch_attributes;
        r_meta  pck_conf_calcolo.rt_anytype_metadata;
      begin
        rws := null;
        if dbms_sql.fetch_rows(pck_conf_calcolo.r_sql.cursor) > 0 then
          || first we describe our current anytype instance (self.a) to determine
          || the number and types of the attributes...
          r_meta.typecode := self.atype.getinfo(r_meta.precision,
                                                r_meta.scale,
                                                r_meta.length,
                                                r_meta.csid,
                                                r_meta.csfrm,
                                                r_meta.schema,
                                                r_meta.name,
                                                r_meta.version,
                                                r_meta.attr_cnt);
          || we can now begin to piece together our returning dataset. we create an
          || instance of anydataset and then fetch the attributes off the dbms_sql
          || cursor using the metadata from the anytype. longs are converted to clobs...
          anydataset.begincreate(dbms_types.typecode_object, self.atype, rws);
          rws.addinstance();
          rws.piecewise();
          for i in 1 .. pck_conf_calcolo.r_sql.column_cnt loop
            r_meta.typecode := self.atype.getattreleminfo(i,
                                                          r_meta.precision,
                                                          r_meta.scale,
                                                          r_meta.length,
                                                          r_meta.csid,
                                                          r_meta.csfrm,
                                                          r_meta.attr_type,
                                                          r_meta.attr_name);
            case r_meta.typecode
            --<>--
              when dbms_types.typecode_varchar2 then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.v2_column);
                rws.setvarchar2(r_fetch.v2_column);
                --<>--
              when dbms_types.typecode_number then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.num_column);
                rws.setnumber(r_fetch.num_column);
                --<>--
              when dbms_types.typecode_date then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.date_column);
                rws.setdate(r_fetch.date_column);
                --<>--
              when dbms_types.typecode_raw then
                dbms_sql.column_value_raw(pck_conf_calcolo.r_sql.cursor,
                                          i,
                                          r_fetch.raw_column,
                                          r_fetch.raw_error,
                                          r_fetch.raw_length);
                rws.setraw(r_fetch.raw_column);
                --<>--
              when dbms_types.typecode_interval_ds then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.ids_column);
                rws.setintervalds(r_fetch.ids_column);
                --<>--
              when dbms_types.typecode_interval_ym then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.iym_column);
                rws.setintervalym(r_fetch.iym_column);
                --<>--
              when dbms_types.typecode_timestamp then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.ts_column);
                rws.settimestamp(r_fetch.ts_column);
                --<>--
              when dbms_types.typecode_timestamp_tz then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.tstz_column);
                rws.settimestamptz(r_fetch.tstz_column);
                --<>--
              when dbms_types.typecode_timestamp_ltz then
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.tsltz_column);
                rws.settimestampltz(r_fetch.tsltz_column);
                --<>--
              when dbms_types.typecode_clob then
                --<>--
                dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
                                      i,
                                      r_fetch.clob_column);
                rws.setclob(r_fetch.clob_column);
                --<>--
            end case;
          end loop;
          || our anydataset instance is complete. we end our create session...
          rws.endcreate();
        end if;
        return odciconst.success;
      end;
      member function ODCITableClose(self in t_conf_obj
                                    ) return number
      is
      begin
        dbms_sql.close_cursor(pck_conf_calcolo.r_sql.cursor);
        pck_conf_calcolo.r_sql := null;
        return odciconst.success;
      end;
    end;We have an Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 running on Windows 2003 sp2.
    Thanks in advance.
    Riccardo.

    I'm getting confused with so much answers!!!

  • MDX calculation based on date logic for the Jan 1 of current year through the 15th of the previous month

    Hello, 
    We need some help with an SSAS MDX query based on date logic. One of the problems is that I don't have access to the Cube but have been given a query example with the logic needed for the calculation. Here's the scenario; 
    The ETL process will run on the first Tuesday after the 15<sup>th</sup> of a given month. The Analysis Cube data queried should include the current year up to the end of the previous month. For example, on May 19<sup>th</sup>
    (the first Tuesday on or after the 15th) the query should include data from January 1<sup>st</sup> through April 30<sup>th</sup>.
    The 15<sup>th</sup> of the month is not part of the query, it is a factor in when the query is run. The query will always be in terms of complete months.
    SELECT
                    NON EMPTY { [Measures].[Revenue Amount],
                    [Measures].[Utilization],
                    [Measures].[AVG Revenue Rate],
                    [Measures].[Actual Hours] }
    ON
                    COLUMNS,
                    NON EMPTY { ([dimConsultant].[User Id TT].[User Id TT].ALLMEMBERS * [dimConsultant].[Full Name].[Full Name].ALLMEMBERS * [dimConsultant].[Employee
    Type].[Employee Type].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION,
                    MEMBER_UNIQUE_NAME
    ON
                    ROWS
    FROM
                    ( SELECT
    ( { [dimDate].[Week Date].[1/4/2015], [dimDate].[Week Date].[1/11/2015], [dimDate].[Week Date].[1/18/2015], [dimDate].[Week Date].[1/25/2015], [dimDate].[Week Date].[2/1/2015] } )
                    ON
                                    COLUMNS
                    FROM
                                    ( SELECT
    ( { [dimIsBillable].[Is Billable].&[True] } )
                                    ON
    COLUMNS
                                    FROM
    [SSASRBA]
    WHERE
                    ( [dimIsBillable].[Is Billable].&[True], [dimDate].[Week Date].CurrentMember ) CELL PROPERTIES VALUE,
                    BACK_COLOR,
                    FORE_COLOR,
                    FORMATTED_VALUE,
                    FORMAT_STRING,
                    FONT_NAME,
                    FONT_SIZE,
                    FONT_FLAGS

    Hi Hans,
    Thank you for your question.  
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.  
    Thank you for your understanding and support. 
    Regards,
    Simon Hou
    TechNet Community Support

  • Getting an error from calling a store proc

    this is my code calling a store proc. i got all oracle 8i
    drivers imported.
    package FMISBean;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    public class getrecordj
              public static void main(String [] args){
         //global variables
         Connection conOrcl=null;
    String ProjectID ="222700-";
              CallableStatement C_TPRO_J=null;
         ResultSet R_TPRO_J = null;
         try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    conOrcl=DriverManager.getConnection("jdbc:odbc:FMISORCL","FMIS_USER","FMIS123");
              try{
              String SQL ="{ ? = call getJrecord(?) }";
         C_TPRO_J = conOrcl.prepareCall(SQL);
         //assign the ? to the argument passed
              C_TPRO_J.registerOutParameter(1,OracleTypes.CURSOR);
              C_TPRO_J.setString(2,ProjectID);
         //execute the query
              C_TPRO_J.executeQuery();
              R_TPRO_J = (ResultSet) C_TPRO_J.getObject(1);
         //looping through the resultSet
         while (R_TPRO_J.next()){
         //create an instance of the class
              // JavaBeans JItems = new JavaBeans();
         // set it to the Bean
              System.out.println(R_TPRO_J.getString(1));
              System.out.println(R_TPRO_J.getString(2));
              System.out.println(R_TPRO_J.getString(3));
              System.out.println(R_TPRO_J.getString(4));
              System.out.println(R_TPRO_J.getString(5));
              System.out.println(R_TPRO_J.getString(6));
              //JItems.setexistingLane(R_TPRO_J.getInt(3));
              // JItems.setproposed_lane(R_TPRO_J.getInt(4));
              // JItems.setcomnt(R_TPRO_J.getString(5));
              // JItems.setcomntType(R_TPRO_J.getString(6));
         //add the object to the vector
    // V_itemsJ.addElement(JItems);
         }catch(SQLException w){
              System.out.println(w.getMessage());
         }}catch(Exception S){
         //returning the vector
              //     return V_itemsJ;
    //closing bracets
    the store proc works fine if i test it in sql plus but when i call it from the page i get a dos window error
    [oracle][orant]:line 1, colunm 13
    PLS: expression is of wrong type
    line 1 , colunm 7
    PL/SQL: statement ignored
    any ideas please would help?

    Here are some examples to reference:
    http://www.javaalmanac.com/egs/java.sql/CallFunction.html
    http://www.javaalmanac.com/egs/java.sql/CallProcedure.html
    DesQuite

  • How to fetch data from XML and store it in internal table

    Hi All,
    Can anyone help me out, in fetching data from xml and store it in an internal table. Is there any standard function module is there?
    Regards,
    Karthick

    to do this you can either develop a XSLT program and use it with CALL TRNSFORMATION key word to tranform the XML into itab .
    (search the ABAP General forum, i have posted few samples)
    or simply use the following FM which converts your XML into a itab of name value pair (name would holw the element name and value would hold the value of the element) which you can then loop and read it to your itb.
    data:             xmldata type xstring .
    data: result_xml type standard table of smum_xmltb .
    data: return type standard table of bapiret2 .
    CALL FUNCTION 'SMUM_XML_PARSE'
      EXPORTING
        xml_input       = xmldata
      TABLES
        xml_table       = result_xml
        return          = return .
    Regards
    Raja

Maybe you are looking for

  • Disappointing Nokia's responds level

    Dear Nokia, After 4 visit to Nokia care center, 12phone calls to the same center, 3 phone call to Nokia care India. After 20 days of waiting. I am getting the same answers "The contact is not available" or "case has been already forwarded to our back

  • How to reinstall OS 7.5 PM7200/120

    Greetings, Hope someone can help me, I saved a PM 7200/120 system still in it's box from an Ewaste collection event. I have repaired the monitor, and got the system to boot up OS 7.5. There is a lot of garbge (files and applations), and I want to sta

  • Performance of native sql query detoriates

    Dear Experts, The performance of my native SQL query is bad. On the database the query takes less than 5 seconds to process. From my abap program I get a session timeout dump after 10 minutes. What might be the possible reason. Warm Regards, Abdullah

  • Scanner Driver for Microtek 5900 that works with OS 10.6.6

    Is there a driver available for a Microtek 5900 scanner that will work/be compatible with OS 10.6.6???

  • Collecting Email Addresses in Dreamweaver

    I NEED HELP!!!! Can anyone PLEASE tell me specifically how I can create a f orm and collect email addresses. Actually I kinda know how to create the form, but my problem is once I create it, how do I view the email addresses that have been collected?