Oracle/ASP hanging

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • s_gemberling

    Oracle/ASP hanging

    I am connecting to Oracle 9i via an ASP page using the ORacle OLEdB
    driver (OraOLEDB). When I try to execute the following vbscript code
    in ASP my page hangs(no timeouts, no errors, etc.) It just looks like
    it is still retreiving the page. I have run the SQL statement directly
    in SQL plus and it runs run. I executed the package from sql
    plus...it too runs fine. There is only 1 record in the table so too
    much data is not an issue. When I use this exact same format for any
    other table that I select data from, this work. The only difference
    is that I am selecting data from more than 1 table in the sql
    statement. Why just this table, this package, or this ASP vbscript
    function?

    Connection String
    ----------------------
    Public Const cst_Tasks_Conne ctionString =
    "Provider=OraOL EDB.Oracle;Pass word=XXXXX;User ID=XXXXX;Data
    Source=XXXXXX;P LSQLRSet=1;OLED B.NET=false"


    ASP Code
    ------------
    Function b_GetWorkOrders ()

    on error resume next

    dim cmd

    Set conn = Server.CreateOb ject("ADODB.Con nection")
    conn.Open cst_Tasks_Conne ctionString
    conn.cursorloca tion = adUseClient

    set cmd = server.CreateOb ject("ADODB.Com mand")
    Set cmd.ActiveConne ction = conn
    cmd.CommandText = "PRJMGMT.pkgWor kOrders.procGet WorkOrders"

    set rsWorkOrders = Server.CreateOb ject("ADODB.Rec ordset")
    rsWorkOrders.Cu rsorLocation = adUseclient
    rsWorkOrders.lo cktype = adLockReadOnly
    rsWorkOrders.cu rsortype = adOpenForwardOn ly

    set rsWorkOrders = cmd.Execute

    if err.number = 0 then
    if not(rsWorkOrder s.BOF and rsWorkOrders.EO F) then
    b_GetWorkOrders = true
    else
    b_GetWorkOrders = false
    end if
    else
    Response.Write err.Description
    Response.end
    b_GetWorkOrders = false
    end if

    'Cleanup
    set cmd.ActiveConne ction = nothing
    set rsWorkOrders.ac tiveconnection = nothing
    conn.close

    End function


    Package
    ----------------------------------


    CREATE OR REPLACE PACKAGE PRJMGMT.pkgWork Orders AS
    TYPE CURSOR_TYPE IS REF CURSOR;
    PROCEDURE procGetWorkOrde rs(RESULT_SET_1 OUT CURSOR_TYPE);
    END pkgWorkOrders;
    /
    CREATE OR REPLACE PACKAGE BODY PRJMGMT.pkgWork Orders AS

    PROCEDURE procGetWorkOrde rs(RESULT_SET_2 OUT CURSOR_TYPE)
    AS
    BEGIN
    OPEN RESULT_SET_2 FOR
    SELECT wo.work_order_i d, wo.work_order_t ype_cd,
    wo.creation_dat etime, wo.project_id, p.project_name,
    wo.technical_co ntact, wo.requested_co mpletion_date,
    wo.production_d ate, wo.actual_start _date,
    wo.estimated_co mpletion_date, wo.actual_compl etion_date,
    wo.priority_id, pr.priority_nam e, wo.service_leve l_id,
    sl.service_leve l_name, wo.work_type_id , wt.work_type_na me,
    wo.status_id, s.status_name, c.customer_name
    FROM PRJMGMT.WORK_OR DERS wo, PRJMGMT.PROJECT S p,
    PRJMGMT.PRIORIT IES pr, PRJMGMT.SERVICE _LEVELS sl, PRJMGMT.WORK_TY PES
    wt, PRJMGMT.STATUS s, PRJMGMT.CUSTOME RS c
    WHERE p.project_id = wo.project_id and pr.priority_id =
    wo.priority_id and sl.service_leve l_id = wo.service_leve l_id and
    wt.work_type_id = wo.work_type_id and s.status_id = wo.status_id and
    c.customer_id = p.customer_id
    END procGetWorkOrde rs;

    END pkgWorkOrders;

    /
    GRANT EXECUTE ON PRJMGMT.pkgWork Orders TO PRJMGMT;
    /
  • s_gemberling

    #2
    Re: Oracle/ASP hanging

    Ross -

    I did this now I get:

    Unspecified error


    that error's even LESS helpful....uugg ghhhh! Thank you though...

    Comment

    • s_gemberling

      #3
      Re: Oracle/ASP hanging

      I also tried cmd.commandType = adCmdText, that gives the Invalid SQl
      statement error as well.

      Comment

      • Ross McKay

        #4
        Re: Oracle/ASP hanging

        On 26 Aug 2003 06:33:41 -0700, s_gemberling@ya hoo.com (s_gemberling)
        wrote:
        >I did this now I get:
        >
        >Unspecified error
        >
        >that error's even LESS helpful....uugg ghhhh! Thank you though...
        Um, ok, then first:

        When I said "Set ... to" I meant: cmd.CommandType = adCmdStoredProc

        Secondly, why not use a debugger to see which line you get the error on
        now? Or alternatively, comment out "on error resume next" so that IIS
        dumps the error to the output.

        cheers,
        Ross.
        --
        Ross McKay, WebAware Pty Ltd
        "Since when were you so generously inarticulate?" - Elvis Costello

        Comment

        • s_gemberling

          #5
          Re: Oracle/ASP hanging

          Hi Ross -

          Thanks again. (I knew what you meant about that "Set" thing...) I
          commented out the on error resume next and I get the "Invalid SQL
          statement" error on the cmd.Execute line. I put an exception handler
          in my package and it doesn't return anything. I ran the package in
          SQL Plus and it runs fine. I am completely baffled! I even changed the
          package to a more simple select (Select * from PRJMGMT.work_or ders;)
          It still doesn't work. The confusing part is that other thatn the
          table/package/procedure names, I have several other functions that do
          the same exact thing and they all work fine!!! (Scratching head...)

          Comment

          • Ross McKay

            #6
            Re: Oracle/ASP hanging

            On 25 Aug 2003 08:00:22 -0700, s_gemberling@ya hoo.com (s_gemberling)
            wrote:
            >CREATE OR REPLACE PACKAGE PRJMGMT.pkgWork Orders AS
            > TYPE CURSOR_TYPE IS REF CURSOR;
            > PROCEDURE procGetWorkOrde rs(RESULT_SET_1 OUT CURSOR_TYPE);
            >END pkgWorkOrders;
            >/
            >CREATE OR REPLACE PACKAGE BODY PRJMGMT.pkgWork Orders AS
            >
            PROCEDURE procGetWorkOrde rs(RESULT_SET_2 OUT CURSOR_TYPE)
            Nah, it couldn't be that easy, could it? Check out the names of the
            result sets. I didn't think they necessarily had to match, but...
            --
            Ross McKay, WebAware Pty Ltd
            "Since when were you so generously inarticulate?" - Elvis Costello

            Comment

            • Ross McKay

              #7
              Re: Oracle/ASP hanging

              On 25 Aug 2003 08:00:22 -0700, s_gemberling@ya hoo.com (s_gemberling)
              wrote:
              > set rsWorkOrders = Server.CreateOb ject("ADODB.Rec ordset")
              > rsWorkOrders.Cu rsorLocation = adUseclient
              > rsWorkOrders.lo cktype = adLockReadOnly
              > rsWorkOrders.cu rsortype = adOpenForwardOn ly
              >
              > set rsWorkOrders = cmd.Execute
              A subtle point, not connected to your problem, but realise that the last
              line above negates all the other lines above by totally replacing the
              object held by rsWorkOrders. Thus, you can lose those lines totally,
              keeping just the last line.

              If you did want to create a recordset object, finesse the properties,
              and call the stored procedure with results into this recordset, replace
              the last line with:

              rsWordOrders.Op en cmd

              Still looking at your code....
              --
              Ross McKay, WebAware Pty Ltd
              "Since when were you so generously inarticulate?" - Elvis Costello

              Comment

              • s_gemberling

                #8
                Re: Oracle/ASP hanging

                This was a typo on my part, they are actually the same in my code...so
                that's no the problem....hmmm mm
                CREATE OR REPLACE PACKAGE PRJMGMT.pkgWork Orders AS
                TYPE CURSOR_TYPE IS REF CURSOR;
                PROCEDURE procGetWorkOrde rs(RESULT_SET_1 OUT CURSOR_TYPE);
                END pkgWorkOrders;
                /
                CREATE OR REPLACE PACKAGE BODY PRJMGMT.pkgWork Orders AS

                PROCEDURE procGetWorkOrde rs(RESULT_SET_2 OUT CURSOR_TYPE)
                >
                Nah, it couldn't be that easy, could it? Check out the names of the
                result sets. I didn't think they necessarily had to match, but...

                Comment

                • s_gemberling

                  #9
                  Re: Oracle/ASP hanging

                  Never mind...To_Char( creation_dateti me) works....

                  Thanks for all your help!

                  Comment

                  • Ross McKay

                    #10
                    Re: Oracle/ASP hanging

                    On 27 Aug 2003 08:07:13 -0700, s_gemberling@ya hoo.com (s_gemberling)
                    wrote:
                    >Never mind...To_Char( creation_dateti me) works....
                    Thanks for clearing that up. I was starting to wonder if my eyes were
                    working, because I couldn't see any problem!

                    cheers,
                    Ross.
                    --
                    Ross McKay, WebAware Pty Ltd
                    "Since when were you so generously inarticulate?" - Elvis Costello

                    Comment

                    Working...