Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

READTEXT STATEMENT

Posted on 1999-07-19
8
Medium Priority
?
344 Views
Last Modified: 2008-07-08
greetings.
i have to read a contents of the record with a textfield. i have to write a stored procedure which will retrieve id, last_name, first_name and resume field which can be very large. i understand that i must use readtext statement, but i cant figure out show to combine the readtext with regular select query that returns a complete record. [select id, first_name, last_name from xxx ....]. please help..
0
Comment
Question by:mishab
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 7

Expert Comment

by:simonsabin
ID: 1096537
What are you using as the client. VB/C++ with ADO etc ?

ADO hides the complexity of text fields, you can just issue a normal select/stored procedure and the text field will be returned in a field of type adLongVarChar.

Make sure you have the latest Data Access Components (downloadable from microsoft)  as earlier ones didn't cope as well.
0
 
LVL 4

Expert Comment

by:Gustavo Perez Buenrostro
ID: 1096538
Could you give more information?
A simple example would be good to undestand your request.
0
 
LVL 7

Expert Comment

by:simonsabin
ID: 1096539
Did my suggestion answer your question?


0
Industry Leaders: 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!

 
LVL 4

Expert Comment

by:Gustavo Perez Buenrostro
ID: 1096540
Mishab, please reject or accept simonsabin´s proposed answer. I need to know if I can help you.
0
 
LVL 7

Expert Comment

by:simonsabin
ID: 1096541
gpbuenrostro
Cutomers are often quite slow in responding. you will be informed when he does so just sit back and relax
0
 

Author Comment

by:mishab
ID: 1096542
I use ASP with Java Script. I have to be able to read large amount of test from a text field using stored procedure.
0
 
LVL 4

Accepted Solution

by:
Gustavo Perez Buenrostro earned 400 total points
ID: 1096543
You can not use a select statement to return all
bytes in a text column because the full amount of data
returned depends on the value of TEXTSIZE set option.

You must use SELECT and UPDATETEXT to do it.

Consider next code to write a stored procedure that returns
output parameters for id, last name and first name columns
and a Recordset with the resume information.

use pubs  -- this example works using PUBS database
go

declare
 @tPtr  varbinary(16)
,@chunk varchar(10)   -- supose @@TEXTSIZE = 10
,@bytes int

select pr_info
  into #temp from pub_info
 where pub_id = '1756'

SELECT @tPtr=TEXTPTR(pr_info) FROM #temp

select @bytes = isnull(datalength(pr_info),0) from #temp
if @bytes > 10 select @bytes = 10

while @bytes > 0
  begin
    SELECT @chunk = CONVERT (varchar(10),pr_info) FROM #temp
    SELECT @chunk
    UPDATETEXT #temp.pr_info @tPtr 0 @bytes
    select @bytes = isnull(datalength(pr_info),0) from #temp
    if @bytes > 10 select @bytes = 10
  end


PD: Please let me know if it solves your problem.


0
 
LVL 1

Expert Comment

by:chicabow
ID: 2167465
can you explain how you create the table so uses three regular varchar fields and then one big field for coments and lots of data like this resume example?

I will award points?
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question