Home » SQL & PL/SQL » SQL & PL/SQL » Executing SQL Statement on ASP
Executing SQL Statement on ASP [message #19469] Wed, 20 March 2002 23:06 Go to next message
Julez
Messages: 6
Registered: March 2002
Junior Member
Hi there,
have you ever been in this kind of problem ?

I have this simple query.. (i categorized it as simple cause it don't nest)

the query is like this : select a, b, c, d from sometable where id=id

when executed on SQLPlus .. it only takes 3 seconds
but, when executed from ASP .. it takes 3 minutes..

if somebody ever been in the same problem.. and have solved it.. please let me know..
or if somebody would give any suggestions for me what to do .. please.. let me know too..
any replies would be appreciated..

thank you
Re: Executing SQL Statement on ASP [message #19475 is a reply to message #19469] Thu, 21 March 2002 01:17 Go to previous messageGo to next message
Srihari
Messages: 22
Registered: October 2000
Junior Member
Can U Provide ASP script?

Srihari
Re: Executing SQL Statement on ASP [message #19492 is a reply to message #19469] Thu, 21 March 2002 18:46 Go to previous messageGo to next message
Julez
Messages: 6
Registered: March 2002
Junior Member
Hi, thanks for the reply

here's my ASP Script

<%
dim code
dim id
dim query
dim rs

id = rtrim (id)

query = "select msisdn,name,businessregion,contractstatus,paymenttype,address1,"
query = query & "address2,customergroup from aktivasi, where msisdn=" & id

set rs = conn.execute (query)

if rs.eof = true then
response.write "

<center>"
response.write "[b]" & id & " Not Register"
else
code = get_codearea(rs("businessregion"))
end if

the function get_codearea is like this :

function get_codearea (area)
dim kode

area = rtrim(area)

select case area
case "J Area" kode="01"
case "B Area" kode="02"
case "A Area" kode="03"
case "S Area" kode="04"
end select

get_codearea = kode
end function

i'm still confuse, could it be caused by other technical problems ? connection to Oracle ? the Server ??

any replies would be appreciated...

thank you
Re: Executing SQL Statement on ASP [message #19494 is a reply to message #19469] Thu, 21 March 2002 18:52 Go to previous messageGo to next message
Julez
Messages: 6
Registered: March 2002
Junior Member
Hi, thanks for the reply

here's my ASP Script

dim code
dim id
dim query
dim rs

id = rtrim (id)

query = "select msisdn,name,businessregion,contractstatus,paymenttype,address1,"
query = query & "address2,customergroup from aktivasi, where msisdn=" & id

set rs = conn.execute (query)

if rs.eof = true then
response.write id & " Not Register"
else
code = get_codearea(rs("businessregion"))
end if

the function get_codearea is like this :

function get_codearea (area)
dim kode

area = rtrim(area)

select case area
case "J Area" kode="01"
case "B Area" kode="02"
case "A Area" kode="03"
case "S Area" kode="04"
end select

get_codearea = kode
end function

i'm still confuse, could it be caused by other technical problems ? connection to Oracle ? the Server ??

any replies would be appreciated...

thank you
Re: Executing SQL Statement on ASP [message #19502 is a reply to message #19469] Fri, 22 March 2002 02:37 Go to previous messageGo to next message
Srihari
Messages: 22
Registered: October 2000
Junior Member
Hi..

I dont find any problem in Ur code.
As U have guessed it might me a problem with the connection object,the OLEDB/Odbc U might be using etc.,

Are U getting the correct output thru this script no matter whether it takes time or not.

Becos if id field is varchar datatype in database it has to be enclosed within single quotes.

query = "select msisdn,name,businessregion,contractstatus,paymenttype,address1,"
query = query & "address2,customergroup from aktivasi, where msisdn= ' " & id & "'"

set rs = conn.execute (query)

Anyway If u find the solution would be thankful if U let me know

Thanks..

Srihari
Re: Executing SQL Statement on ASP [message #19528 is a reply to message #19469] Sun, 24 March 2002 23:20 Go to previous message
Julez
Messages: 6
Registered: March 2002
Junior Member
Hi,
the problem is..
why does it work on other codes .. ?
i think the connection is fine..
after some while.. the result came out..

thanks again Sri..
but i haven't find the solution..
Previous Topic: Loading Excel spreadsheet into Oracle
Next Topic: advice on lock
Goto Forum:
  


Current Time: Fri Apr 26 03:37:27 CDT 2024