Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

store more than 32767 characters

189 views
Skip to first unread message

SNS

unread,
Dec 15, 2009, 4:28:45 PM12/15/09
to
I have the same issue mentioned below by Greg. I am trying
to update a text datatype (sybase 12.5). But the datawindow
treats the column as 32,767 char and truncates the rest of
the data. But I need to enter data much larger than that as
text datatype can hold much more than 32767 char. What is
the solution ?

regards,
SNS

Greg

unread,
Dec 15, 2009, 5:10:17 PM12/15/09
to
Change the data type to long varchar, or adding a new long
varchar column.

Then, if you are using sql statements to retrieve you:
string s_strg
blob b_strg

SELECTBLOB clue
INTO :b_strg
FROM residents
WHERE appid = 1
USING SQLCA;
s_strg = String(b_strg)

Then your variable s_strg will have all the data.

If you are updating the database you:
string s_strg
blob b_strg

s_strg = "a very large string up to 2gb..."
b_strg = Blob(s_strg)
UPDATEBLOB residents
SET clue= :b_strg
WHERE appid = 1
USING SQLCA;

The column will contain all the data up to 2gb

If you are using datawindows see my last posting.

Greg

SNS

unread,
Dec 16, 2009, 11:16:06 AM12/16/09
to
Thanks for your response. But won't the same logic that
works for long varchar not work for text as well ? In my
case, they are using the embedded Sql as well as the
datawindow for update(2 diff scenarios). The solution you
earlier mentioned( importing and exporting) for the
datawindow is already in place. In the DW column
specifications the text column reads (2000000) but it
truncates anything greater than 32767 char during the
update. Just go to the edit properties(after the import into
PBL) and try to set the limit for no of characters to
greater than 32767 and the datawindow wil automatically
reset it back to 32767.I am using PB 10.2(Build 8100) and
database is ASE 12.5.

Regards,
SNS

Brad Wery[TeamSybase]

unread,
Dec 16, 2009, 2:42:32 PM12/16/09
to
You can't use the datawindow for anything greater than 32767. Can you
tell us exactly what it is you need to do. Is a user entering large
amounts of data? Is the system doing it?

In the mean time, this is what I would do...

Each row in the datawindow will have to have an ellipsis button on it
that will open a "text editor". This editor will be responsible for
reading and updating the large amount of text. You will use SELECTBLOB
and UPDATEBLOB to facilitate this.

Not that it's very hard for the user to work with large amounts of text
in a datawindow. Having a separate text editor would make for a better
user experience.

--

*********************************************************************************************************
www.PowerToTheBuilder.com
- Take control of your GUI with a free PB user control library
- Get updates from my blog - blog.PowerToTheBuilder.com
- Get support from - forum.PowerToTheBuilder.com

*********************************************************************************************************
www.Werysoft.com
- Full featured database development tool for ASE, SQL Server, SQL
Anywhere and Oracle

Get productive today!

*********************************************************************************************************

SNS

unread,
Dec 16, 2009, 5:42:48 PM12/16/09
to
Brad,

Basically the column is a text datatype(ASE 12.5) where the
user either types in text or copies and pastes the text and
saves it.The reason it was made so was that it could
accomodate large amount of typed info. In cases where the
text is larger than 32767, it truncates the rest of the txt
and saves. This is because the Datawindow treats it as a
Char datatype and not as a text datatype. We exported the DW
and changed the size to char(2000000) in the editor and
imported it back. After the import, the datawindow displays
the column size as char(2000000).But while saving/updating
it still truncates any characters that exceed the 32767
limit. Is there a workaround ?

Regards,
SNS

SNS

unread,
Dec 16, 2009, 6:11:03 PM12/16/09
to
Also, the datawindow is updated using dw_1.update() and not
through embedded SQL. So, I cannot do an UPDATEBLOB.

Regards

R. Pods

unread,
Dec 17, 2009, 4:55:01 AM12/17/09
to
You might want to code an UpdateStart Event, where you use UPDATEBLOB to
save the Blob data and set the column state to !NotMofied.

Reimer

Brad Wery[TeamSybase]

unread,
Dec 17, 2009, 10:07:25 AM12/17/09
to
The solution is simple. Remove the update property for your Text column.
The datawindow isn't going to help you here so don't allow it to update
anything in that column.

After you do you're update, you will have to do a second pass. For each
row in the database, get the text from the Text column and call
UPDATEBLOB with the appropriate key.

That is the only way around this.

I've asked for this in the past but for some reason it's not a priority.
There should be a Text datatype in the datawindow for this type of thing.

--

*********************************************************************************************************

Brad Wery[TeamSybase]

unread,
Dec 17, 2009, 10:10:26 AM12/17/09
to
Correction... I meant Datawindow not database.

After you do your update, you will have to do a second pass. For each
row in the DATAWINDOW, get the text from the Text column and call

UPDATEBLOB with the appropriate key.

SNS

unread,
Dec 17, 2009, 11:55:04 AM12/17/09
to
Thanks for your response. The good thing is the datawindow
will always have only one row in my case

Regards,
SNS

SNS

unread,
Dec 19, 2009, 4:21:51 PM12/19/09
to
Is it possible to use an UPDATEBLOB against a text datatype
field(ASE 12.5)? I am getting a "Update permission denied on
table..." error. This is misleading. The regular embedded
sql UPDATE statement works fine on the same table. As per
sybase documentation, UPDATEBLOB statement works only on
BLOB datatypes.

Regards,
SNS

0 new messages