Unable To Create Stored Procedure Using JDBC !!

Teradata Studio
Enthusiast

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 ()

BEGIN

insert into DB_1.tcols ('first');

END;

please help me and let me know if i am doing anything wrong

Thanks

R.Rajeev

4 REPLIES
Senior Apprentice

Re: Unable To Create Stored Procedure Using JDBC !!

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.

Dieter

Teradata Employee

Re: Unable To Create Stored Procedure Using JDBC !!

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

Teradata Employee

Re: Unable To Create Stored Procedure Using JDBC !!

Rajeev,

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?

Enthusiast

Re: Unable To Create Stored Procedure Using JDBC !!

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

Thanks

Rajeev