Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 545
  • Last Modified:

query a view using vb

llo

i have an  oracle  database that has a view that i need to query in my vb application can anyone help
0
Chris Jones
Asked:
Chris Jones
  • 7
  • 4
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
querying a view is the same as querying a table.
assuming that you did already query some tables with vb, there should be no problem?
otherwise, what is the problem, exactly?
0
 
Chris JonesAuthor Commented:
i get this error in my vb code

 character string buffer too small
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
what is the view/vb code, what are the data types, what is the connection string ...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Chris JonesAuthor Commented:

there are a lot of types in my view but i am trying to query a field called PIDM_KEY


here si my vb code
Partial Class _Default
    Inherits System.Web.UI.Page
    Dim rs As ADODB.Recordset ' recorde set for the connection 
    Dim sqlstmt As String
    Dim ConnPortal As ADODB.Connection
    Private Sub localDBConnectionOpen()
        ConnPortal = DBConnectionOpenOracle(ConnPortal, "PROD.TAMU-COMMERCE.EDU", "joneschris", "cjones_1")
    End Sub
 
    Private Sub localDBConnectionClose()
        ConnPortal = DBConnectionClose(ConnPortal)
    End Sub
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
    End Sub
 
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim PIDM As String
        Call localDBConnectionOpen()
 
        sqlstmt = "SELECT * FROM BANINST1.AS_STUDENT_ENROLLMENT_SUMMARY WHERE PIDM_KEY = '" & txtCWID.Text & "'"
        rs = DBRecordSetNewFast(ConnPortal, sqlstmt)
 
        While Not rs.EOF
 
            PIDM = DBGetField(rs, "CNAME")
            '   PNAME = DBGetField(rs, "PNAME")
 
            rs.MoveNext()
        End While
        '   PageBody.Controls.Add(t)
        rs = DBRecordSetDestroy(rs)
        Call localDBConnectionClose()
    End Sub
End Class

Open in new window

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
please try to limit the problem, by putting a list of columns instead of SELECT *.

now, anything "large" or "special" in those columns returned?
timestamp, blob, clob, ... ?
0
 
Chris JonesAuthor Commented:
pidm_key,
 term_code_key,
 enrolled_ind,
 registered_ind,
 id,
 ssn,
 last_name,
 first_name,
 middle_initial,
 name_prefix,
 name_suffix,
 birth_date,
 age,
 gender,


is that what you mean ?
0
 
Chris JonesAuthor Commented:
buta all i am trying to get is the first field the PIDM_KEY
0
 
Chris JonesAuthor Commented:
i am not sure if this will help here is my full error

ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "BANINST1.G$_DATE_PKG", line 628
ORA-06512: at "BANINST1.GOKSELS", line 660
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>but all i am trying to get is the first field the PIDM_KEY
you do a WHERE against that field, but you return all the fields, at least right now..

>ORA-06502: PL/SQL: numeric or value error: character string buffer too small
what is the data type of PIDM_KEY?
is it numerical?
        sqlstmt = "SELECT * FROM BANINST1.AS_STUDENT_ENROLLMENT_SUMMARY WHERE PIDM_KEY = " & txtCWID.Text & " "

Open in new window

0
 
Chris JonesAuthor Commented:
ok i fixed the problem i just did not select all of the fields i dont need all the fields and it worked

thanks
0
 
Chris JonesAuthor Commented:
great expert
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now