Executing SQL Statement on ASP [message #19469] |
Wed, 20 March 2002 23:06 |
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 #19492 is a reply to message #19469] |
Thu, 21 March 2002 18:46 |
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 |
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 |
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 |
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..
|
|
|