Jump to content
Akasha

Retrieve long from query and show in ASP

Recommended Posts

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 by Akasha

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

Are you sure the database has the correct data? If you browse through the database directly do you see more than 70 characters?

Share this post


Link to post
Share on other sites

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 by Akasha

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 :D

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...