Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to write query
#1
Solved: 11 Years, 4 Months ago
hi,
i proved to do this code:

Code:
Dim rs, conn, customerid
set conn=createobject("adodb.connection")
set rs=createobject("adodb.recordset")
conn.ConnectionString = "Provider=OraOLEDB.Oracle; Data Source=<SOURCE>; User ID=<USER>; Password=<PWD>; PLSQLRSet=1;"
conn.open
customerid="select 'ciao' from dual"
rs.open customerid, conn
rs.close
set rs=nothing
conn.close
set conn=nothing
msgbox customerid

But in the msgbox i see "select 'ciao' from dual" and not "ciao"... how can to save the query result in a variable?

thx,
ste
Reply
#2
Solved: 11 Years, 4 Months ago
ok, i have found the solution.. thx howewer :-)

Code:
Dim rs, conn, query, customerid
set conn=createobject("adodb.connection")
set rs=createobject("adodb.recordset")
conn.ConnectionString = "Provider=OraOLEDB.Oracle; Data Source=<SOURCE>; User ID=<USER>; Password=<PWD>; PLSQLRSet=1;"
conn.open
query="select 'ciao' as pippo from dual"

Set rs= conn1.Execute(query)
var   = rs.fields("pippo")

rs.close
set rs=nothing
conn.close
set conn=nothing

msgbox var
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Query regarding "Call" statement anupam4j 1 2,048 09-26-2014, 01:46 PM
Last Post: vinod123
  Data Table Query Suma Parimal 4 4,790 01-21-2014, 12:50 PM
Last Post: Suma Parimal
  UFT Query invisible786 0 1,905 01-15-2014, 09:41 PM
Last Post: invisible786
  Query about checkpoints pkdhake 5 3,706 07-11-2013, 03:17 PM
Last Post: vinod123
  query on test results look in qtp 11 madhulika99 1 2,734 02-25-2012, 07:28 AM
Last Post: inborntester

Forum Jump:


Users browsing this thread: 1 Guest(s)