converting varchar datatypes to text datatype 
Author Message
 converting varchar datatypes to text datatype
Does anyone have scripts (or stored procedures) to convert a varchar datatype
to a text datatype - such as appending several varchar fields to one text
field. Sybase support for these blobs and text fields is weak.  Even the ASE
instructor told me I should not be using them.  I see terrific advantages -
does anyone else?

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.***.com/ ;     Search, Read, Discuss, or Start Your Own    



Mon, 30 Jul 2001 03:00:00 GMT
 converting varchar datatypes to text datatype


Quote:

> Does anyone have scripts (or stored procedures) to convert a varchar datatype
> to a text datatype - such as appending several varchar fields to one text
> field. Sybase support for these blobs and text fields is weak.  Even the ASE
> instructor told me I should not be using them.  I see terrific advantages -
> does anyone else?

It is generally far easier to do work with blobs on the client side.

I have written a procedure that can concatenate multiple varchar values into
a text field, but it is something of a hack.  If there are any quote marks in
the char values, you will have to make extensive additions.

Here is my example from a previous post:

Quote:
> I've had limited success doing it through sp_remotesql against the
> "local" server.  Note that embedded quotation characters really
> complicate matters.
> sp_remotesql was introduced in the ASE 11.5 release.

> This relies on a hack that allows the server to send an rpc to
> itself, something that is not normally allowed.

> Here goes:

> -- THE FOLLOWING STEPS ARE THE GENERAL SETUP SECTION
> -- you will need to go through these steps only once to enable your
> -- server to send rpcs to itself.

> -- If server has not been named within sysservers, name it.
> -- You can use any name here, but it is customary to use the
> -- DSQUERY name this server is usally known by.
> -- My servername is REL115_BRET
> -- [we will have to reboot later to cause change to take effect.]


> begin
> exec sp_addserver REL115_BRET, local
> end

> -- ensure the cis layer is enabled:
> -- [this is also a static change that requires a later reboot]

> sp_configure "enable cis", 1

> -- configure cis remote connections
> -- If already configured for a higher number, don't set it lower.
> -- "5" here is arbitrary

> sp_configure "max cis remote connections", 5

> -- add a remote server entry alias "THIS" for the local server
> -- The choice of "THIS" is arbitrary, but has a neat parallel
> -- in object oriented programming.  "REL115_BRET" is the name of my
> -- server, substitute the name of your server.

> sp_addserver "THIS", "sql_server", "REL115_BRET"
> go

> -- allow the remote login.  Normally you would do this through
> -- sp_addremotelogin, but that does not allow you to do so for
> -- the local server, so do it by direct insert.

> insert sysremotelogins values (0,null,-1,0)
> go

> -- reboot server if necessary
> shutdown

> -- after restarting sql server, you should be able to
> -- send an rpc to yourself using the "THIS" alias:

> exec THIS...sp_who

> -- THIS FINISHES THE GENERAL SETUP SECTION

> use pubs3
> go

> declare









> -- I've used a handful of parameters, some with over a hundred
> -- characters each, to demonstrate that we can get over the 255
> --character limit.




"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"

Quote:





--
Bret Halford
Sybase, Inc.
3665 Discovery Drive
Boulder, CO 80303

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    



Tue, 31 Jul 2001 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Converting datatype varchar to datatype datetime in SQL trigger

2. convert image datatype to text datatype

3. Convert Column Datatype From varchar(8000) to text

4. Converting Text datatype to Varchar

5. Converting varchar to text datatype, including update of table

6. Is there a driver which will convert oracle datatype into sybase datatype ...when using with jdbc

7. Converting Varchar2 datatype into Clob datatype

8. convert column.datatype from VarChar to nVarChar

9. How to convert alias varchar datatype to int

10. converting varchar to datetime datatypes in existing table

11. Conversion of Text datatype to Image datatype

12. All text datatypes vs. more specific datatypes


 
Powered by phpBB® Forum Software