Select from more than one table

Results 1 to 2 of 2

Thread: Select from more than one table

  1. #1
    Join Date
    Dec 1969

    Default Select from more than one table

    I have a db connection to Oracle, I need to make a select from more than one table - eg select a.dn_num, a.dn_id, b.co_id,<BR>c.customer_id <BR>from Directory_number a,<BR>contr_services_cap b,<BR>contract_all c<BR>where<BR>a.dn_id = b.dn_id <BR><BR>how do I response.write one of the resulted fields?<BR>my connection looks like this :<BR>Conn.ConnectionString = "DSN=BSCSPROD;uid=system;pwd=pass" <BR>Conn.Open <BR>&#039; SQL<BR>Dim sql<BR> sql = (the part on top) <BR> <BR> Set rs = Server.CreateObject("ADODB.Recordset")<BR><BR> rs.Open sql, conn, 0, 1<BR>

  2. #2
    Join Date
    Dec 1969

    Default You can access your field values a couple differen

    One suggestion is to rename your columns in your SQL like:<BR><BR>select a.dn_num dn_num, a.dn_id dn_id, b.co_id co_id, <BR>c.customer_id customer_id<BR>from Directory_number a, <BR>contr_services_cap b, <BR>contract_all c <BR>where <BR>a.dn_id = b.dn_id <BR><BR>then you can access in recordset by name like:<BR><BR>dn_num = rs("ds_num")<BR>dn_id = rs("dn_id")<BR>etc.<BR><BR>OR if you don&#039;t want to use field name you can simply do something like:<BR><BR>dn_num = rs.fields(0).value<BR>dn_id = rs.fields(1).value<BR><BR>Hope that helps<BR><BR>Pete<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts