All Forums Teradata Studio
29 Jun 2013
Unable To Create Stored Procedure Using JDBC !!

Hi All,
I have downloaded and installed the TD-13 express version using VM player
I am able to query the database and everything looks fine, however when i try to create a stored procedure it just doesnt allow
I have tried creating it using both studio express as well as Bteq, Bteq at least points to the BEGIN keyword as  the place its having difficulty, studio express just keeps throwing the error TeraJDBC error: 5526
The statement is very simple
create procedure DB_1.proc1 ()
insert into DB_1.tcols ('first');
please help me and let me know if i am doing anything wrong

dnoeth 4628 posts Joined 11/04
01 Jul 2013

Hi Rajeev,
in BTEQ you have to put the source code of the SP in a file and then use .COMPILE
But in Studio this should run as-is, 5526 indicates there were errors or warnings during compilation, check the error text for details.


fgrimmer 553 posts Joined 04/09
01 Jul 2013

rajeev, try executing the insert statement, ouside the stored procedure, in a SQL Editor window to see what the problem is.

Chuckbert 78 posts Joined 07/09
01 Jul 2013

I am able to run the DDL you posted (after changing the database name to a valid name). It got created even though the table being inserted into doesn't exist. Running the SP results in the error saying the table isn't there.
I get the 5526 message when trying to run the CREATE PROCEDURE statement if my user doesn't have CREATE PROCEDURE privileges on the database. The full message being returned in that case is:
Failed [5526 : HY000] Stored Procedure is not created/replaced due to error(s).{Nested Failure Msg [5526 : HY000] SPL1040:E(L2), Invalid definition for stored procedure 'E(3524):The user does not have CREATE PROCEDURE access to database dbname.'.}{Nested Failure Msg [5526 : HY000] SPL5000:W(L3), E(3807):Object 'dbman.tcols' does not exist.}
Could your problem be a result of not having permission to create the procedure in the database?

02 Jul 2013

Hi All,
Thanks for the responses
Charles you were right , i tried after granting the create procedure access on the database DB_1 to the user
DBC and it worked !!
I had created DB_1 and the table tcols in it

You must sign in to leave a comment.