Akasha Posted July 2, 2014 Share Posted July 2, 2014 (edited) Hello, I use asp to retrieve data from a sql database. One of the fields to display has the data type LONG. But for some reason only the first 70 karakters are shown. if ticket <> "" then set rs1 = Server.CreateObject("ADODB.recordset") rs1.Open "select case_history ........etc , conn,1,1 if rs1.RecordCount > 0 then do until rs1.EOF Response.write(rs1.fields("case_history")) rs1.MoveNext loop else response.write("No data Found") end if rs1.closeend if Is there a possibilty so that the full text from the field case_history is shown? thnx Akasha Edited July 2, 2014 by Akasha Link to comment Share on other sites More sharing options...
justsomeguy Posted July 2, 2014 Share Posted July 2, 2014 The fields collection contains field object. You probably want to use the value property of the field object instead of printing the object directly. You should be using rs1.fields.item("case_history").value. Link to comment Share on other sites More sharing options...
Akasha Posted July 4, 2014 Author Share Posted July 4, 2014 Thanks for the reply, unfortunately it gives the same result I just replaced rs1.fields("case_history") with rs1.fields.item("case_history").value, but stil the first 70 characters are shown. I have the same problem if i go to sqlpus with cmd. In that case I use Set Long 2000. Isn't there some kind solution in asp? Link to comment Share on other sites More sharing options...
justsomeguy Posted July 7, 2014 Share Posted July 7, 2014 Are you sure the database has the correct data? If you browse through the database directly do you see more than 70 characters? Link to comment Share on other sites More sharing options...
Akasha Posted July 8, 2014 Author Share Posted July 8, 2014 (edited) Yes, pretty sure. Here is the data from the database. The first query shows only a few characters, then i set long to 2000 and then you see all data. https://www.dropbox.com/s/hq899w71tzsg8bn/data.PNG Second is what asp is showing me. https://www.dropbox.com/s/ope3aehesg2roju/asp.PNG Maybe my query is wrong? set rs1 = Server.CreateObject("ADODB.recordset")rs1.Open "select tc.id_number, tc.x_cust_ref_num, tc.title as tct, tg.title as tcg, login_name, case_history from table_case tc, table_site ts, table_gbst_elm tg, table_user tu where (ts.objid = tc.case_reporter2site) and (ts.name like 'blabla%') and (tg.objid = tc.casests2gbst_elm) and (tu.objid = tc.case_owner2user) and tc.x_cust_ref_num like '%" + ticket + "%'", conn,1,1 regards Leandra Edited July 8, 2014 by Akasha Link to comment Share on other sites More sharing options...
justsomeguy Posted July 8, 2014 Share Posted July 8, 2014 Is this an Oracle database? I haven't seen "set long" before, that looks like it is specific to Oracle.It sounds like long columns are a pain in the ###### to work with. There's some information here:http://www.oracle-developer.net/display.php?id=430One suggestion is to change the data type to something that is better to work with. Otherwise, you might have to use set long any time you query that data:http://www.dba-oracle.com/t_select_long_table_column_sql.htm Link to comment Share on other sites More sharing options...
Akasha Posted July 9, 2014 Author Share Posted July 9, 2014 Yes is an oracle database. Unfortunately not mine, so I’m not able to change the datatype. I will take a look at the articles thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now