Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

autocommit() and inserting long text into field problems

2 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-07-28 12:05:37.0Z
xiaoyun Bao Posted on 1997-07-27 18:43:33.0Z
Message-ID: <33DB96D5.6763@thunder.ocis.temple.edu>
Date: Sun, 27 Jul 1997 14:43:33 -0400
From: xiaoyun Bao <xbao@thunder.ocis.temple.edu>
Reply-To: xbao@thunder.ocis.temple.edu
Organization: Temple University
X-Mailer: Mozilla 3.01C-SPIKE (WinNT; I)
MIME-Version: 1.0
Subject: autocommit() and inserting long text into field problems
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 22
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:460
Article PK: 252212

Hi,

I am new in database area, please pardon me for these very simple
questions.

1. what data type should a column be if it has to store about 250 chars?
varchar(250) or char(250)?
I tried varchar(250), but when I inserted some text of about
250 chars, the server suggested me to use convert function to
insert TEXT.
How should I do that?

2. How to store "long" value into database field?

3. I have to execute several executeQuery()s and executeUpdate()s
together as a single transaction.

I did the following:
con.setAutoCommit(false);
several executes here
if no error
con.commit();
else
con.rollback();
con.setAutoCommit(true);

I got some error saying that the "Metadata accessor function
is not found..."

Any suggestions are appreciated.

Xiaoyun Bao
xbao@thunder.ocis.temple.edu


Lance Andersen Posted on 1997-07-28 12:05:37.0Z
Message-ID: <33DC8B11.76A3@sybase.com>
Date: Mon, 28 Jul 1997 08:05:37 -0400
From: Lance Andersen <lancea@sybase.com>
X-Mailer: Mozilla 3.01Gold (X11; I; SunOS 5.5.1 sun4m)
MIME-Version: 1.0
To: xbao@thunder.ocis.temple.edu
Subject: Re: autocommit() and inserting long text into field problems
References: <33DB96D5.6763@thunder.ocis.temple.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 49
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:459
Article PK: 252210

Hi,

See below..

xiaoyun Bao wrote:
>
> Hi,
>
> I am new in database area, please pardon me for these very simple
> questions.
>
> 1. what data type should a column be if it has to store about 250 chars?
> varchar(250) or char(250)?
> I tried varchar(250), but when I inserted some text of about
> 250 chars, the server suggested me to use convert function to
> insert TEXT.
> How should I do that?
>

Please post the query and the schema for the table.... There should
not be a problem inserting 250 bytes into a char... How were you
doing the insert in your program.

> 2. How to store "long" value into database field?

Declare the column as text and use set/getAsciiStream() via jConnect
to insert/retrieve the row(s)
>
> 3. I have to execute several executeQuery()s and executeUpdate()s
> together as a single transaction.
>
> I did the following:
> con.setAutoCommit(false);
> several executes here
> if no error
> con.commit();
> else
> con.rollback();
> con.setAutoCommit(true);
>
> I got some error saying that the "Metadata accessor function
> is not found..."
>

You need to run $JDBCV_HOME/sp/sql_server.sql for SQL Server or
sql_anywhere.sql for sql anywhere.

-lance

> Any suggestions are appreciated.
>
> Xiaoyun Bao
> xbao@thunder.ocis.temple.edu

--
===============================================================================
Lance J. Andersen Email: lancea@sybase.com
Sybase Technical Support Phone:(617) 564-6336
77 South Bedford Street Fax: (617) 564-6148
Burlington, MA 01803

The Dark Knight Returns!!! Let's Go Penguins!!!
===============================================================================