ASP/OO4O Problem: Unexpect result from package

Discussion in 'ASP General' started by CJM, Aug 31, 2006.

  1. CJM

    CJM Guest

    I'm working on my first Oracle DB, so bear with me...

    I have a couple of validation routines which are both returning the same
    result regardless of the inputs. One checks if a Serial No already exists,
    the other checks if a Part No is valid.

    Currently there are no Serial Nos in the system, so this check shouldnt
    fail. And I get a response to indicate that the Part No is valid regardless
    of whether it is or not.

    I strongly suspect that I'm made the same mistake in each case, but since
    I'm not getting any errors, I can't see where.

    In both cases, the PL/SQL procedures return a value of 1, whereas if I run
    the PL/SQL in SQL Developer with suitable values inserted I get the expected
    results


    >>>>>>>>>>>>>>>>>>>>>>>>

    ASP Snippets:
    >>>>>>>>>>>>>>>>>>>>>>>>

    Function SerialExists (sSerialNo, sPartNo)
    Dim iResult, bResult

    With oDB
    .Parameters.Add "sSerialNo", sSerialNo, ORAPARM_INPUT
    .Parameters ("sSerialNo").ServerType = ORATYPE_VARCHAR2

    .Parameters.Add "sPartNo", sPartNo, ORAPARM_INPUT
    .Parameters ("sPartNo").ServerType = ORATYPE_VARCHAR2

    .Parameters.Add "iResult", 0, ORAPARM_OUTPUT
    .Parameters ("iResult").ServerType = ORATYPE_NUMBER

    iResult = oDB.ExecuteSQL("Begin VALIDATION_PKG.SerialExists:)sSerialNo,
    :sPartNo, :iResult); end;")

    If iResult > 0 then bResult = true Else bResult = false
    response.Write bResult & "<BR>"

    SerialExists = bResult

    .Parameters.Remove "sSerialNo"
    .Parameters.Remove "sPartNo"
    .Parameters.Remove "iResult"

    End With
    End Function


    'check that SerialNo/PartNo not used
    If SerialExists(sSerialNo, sPartNo) then iError = iError + 2

    'check for valid partnos
    If Not IsValidPartNo(sPartNo) then iError = iError + 4


    >>>>>>>>>>>>>>>>>>>>>>

    Package Specification:
    >>>>>>>>>>>>>>>>>>>>>>
     
    CJM, Aug 31, 2006
    #1
    1. Advertising

  2. CJM

    CJM Guest

    Ignore this - prematurely posted.

    Will repost (fully) soon....

    CJM
     
    CJM, Aug 31, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. J.Ram
    Replies:
    7
    Views:
    654
  2. CJM
    Replies:
    0
    Views:
    141
  3. CJM
    Replies:
    2
    Views:
    136
  4. CJM
    Replies:
    7
    Views:
    570
  5. Michael Tan
    Replies:
    32
    Views:
    996
    Ara.T.Howard
    Jul 21, 2005
Loading...

Share This Page