You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Bob M <rg...@orcon.net.nz> on 2013/10/13 20:39:19 UTC
explanation of errors please
Hi
I am getting the following two errors................
(1)
---- SQL Exception --------
SQL State: 42X01
Error Code: 20000
Message: Syntax error: Encountered"\', 0, 2, \" at line 1, column 43
Now this refers to data in the first record I am trying to add to my table
the record starts like this-
('06-01-2009', 0, 2, 'Tuesday',...............)
where the fields are
VARCHR, INT, INT, VARCHR,.......
(2)
---- SQL Exception --------
SQL State: 25001
Error Code: 20000
Message: Cannot close a connection while a transaction is still active
Any help in understanding either of these errors - much appreciated
Bob M
--
View this message in context: http://apache-database.10148.n7.nabble.com/explanation-of-errors-please-tp134695.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.
Re: explanation of errors please
Posted by Rick Hillegas <ri...@oracle.com>.
On 10/13/13 8:36 PM, Bob M wrote:
> Hi Kristian
>
> Error 2)
>
> I am new to derby :)
> autocommit is turned off a few lines of code above.
> I am working off an example piece of code
> Should I turn autocommit ON ?
Hi Bob,
That will ensure that your attempts to close connections won't be
blocked by in-flight transactional work. Another solution would be to
rollback (or commit) the in-flight transaction before you try to close
the connection.
> Error 1)
>
> I am running thru JDBC
> s.execute ("INSERT INTO TABLENAME VALUES ('06-01-2009', 0, 2, 'Tuesday', 0,
> 'Midnight', etc....");
> where fields are VARCHR(10), INT, INT, VARCHAR(9), INT, VARCHAR(8),
> etc......
I can't reproduce the problem you're seeing. The following ij script
runs fine for me:
connect 'jdbc:derby:memory:db;create=true';
create table tablename
(
a VARCHAR(10), b INT, c INT, d VARCHAR(9), e INT, f VARCHAR(8)
);
INSERT INTO TABLENAME VALUES ('06-01-2009', 0, 2, 'Tuesday', 0,
'Midnight' );
select * from tablename;
Hope this helps,
-Rick
> Bob M
>
>
>
> --
> View this message in context: http://apache-database.10148.n7.nabble.com/explanation-of-errors-please-tp134695p134703.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>
Re: explanation of errors please
Posted by Bob M <rg...@orcon.net.nz>.
Hi Kristian
Error 2)
I am new to derby :)
autocommit is turned off a few lines of code above.
I am working off an example piece of code
Should I turn autocommit ON ?
Error 1)
I am running thru JDBC
s.execute ("INSERT INTO TABLENAME VALUES ('06-01-2009', 0, 2, 'Tuesday', 0,
'Midnight', etc....");
where fields are VARCHR(10), INT, INT, VARCHAR(9), INT, VARCHAR(8),
etc......
Bob M
--
View this message in context: http://apache-database.10148.n7.nabble.com/explanation-of-errors-please-tp134695p134703.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.
Re: explanation of errors please
Posted by Kristian Waagan <kr...@gmail.com>.
On 13.10.13 20:39, Bob M wrote:
> Hi
>
> I am getting the following two errors................
>
> (1)
> ---- SQL Exception --------
> SQL State: 42X01
> Error Code: 20000
> Message: Syntax error: Encountered"\', 0, 2, \" at line 1, column 43
>
> Now this refers to data in the first record I am trying to add to my table
> the record starts like this-
> ('06-01-2009', 0, 2, 'Tuesday',...............)
> where the fields are
> VARCHR, INT, INT, VARCHR,.......
>
> (2)
> ---- SQL Exception --------
> SQL State: 25001
> Error Code: 20000
> Message: Cannot close a connection while a transaction is still active
Hi Bob,
The second error means that you have neither committed nor rolled back
the transaction on the connection before you attempt to close it. I
presume you are running with auto-commit off?
Maybe you have a place in the code where you're not committing/aborting
in certain cases? Remember that this applies to read-transactions too.
Regarding the first error, can you include more of the query? Also, are
you running it in ij, through JDBC, or with some other tool?
Regards,
--
Kristian
>
> Any help in understanding either of these errors - much appreciated
>
> Bob M
>
>
>
>
> --
> View this message in context: http://apache-database.10148.n7.nabble.com/explanation-of-errors-please-tp134695.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.