Hi all,
I am basically an Oracle Developer trying to migrate oracle procedures to DB2 procedures. I am having a problem checking the result set of the cursor. in oracle we use cursor attributes such as cursor-name NOT FOUND etc...., but how do I check the same in DB2 if the cursor retrived any...
Can anyone plz tell me what is worng in the following statement? I am trying to declare a LONG varable to hold a very large string.
DECLARE str LONG VARCHAR(8000);
THX:)
can anyone plz tell me how to display the error messages in DB2 stored procedures? I need to catch the error message and insert into a status table to check the success of the program(stored procedure).
Thanks!!!
Does anyone know how to 'truncate' a table in DB2? Truncate in Oracle and SQL server is used to completely delete all rows in a table without any logging. But this doesn't seem to work in DB2.
Please Help!!
Thanks!
I am completely new to DB2. Can anyone plz tell me the command in DB2 to print a string? And also any refernce to DB2 books would be great!!!
Thanks in advance!
Hi,
I am trying to insert data from a temperory table to an permanent table based on some business rules in T-sql procedure using dyanmic t-sql. The temperory and the permanent tables has the same columns. When i am doing the following Insert, it is only working if the temperory table has all...
This code works but do i have to put this in each section of code?? Is there any other way to put this in a genralized block and call it like when we check the error exist :
"if @e <> 0 then go to the error block"
declare @e int
set @e = @@error
if @e <> 0
begin...
Hi,
Can anyone plz. tell me how to print the error number and the error message and insert them into a log table. And also do I need to check for errors after every DML statement or can I just handle them at the end of each block??
Thanks in advance.
Hi,
I am trying to create dynamic tables but I want to check if they already exists in the database. Can anyone please tell me how to check if a table already exists in a sql server database??
Thanks in advance.
I have to check some conditions and load data from all these temperory tables into their respective permanent tables. so i have to loop thorugh each table and update their permanent table. I have done the same thing in oracle using REF Cursor, but i don't know if t-sql has ths concept.
I get the follwoing error:
Server: Msg 137, Level 15, State 2, Line 31
Must declare the variable '@temp_tab'.
Can u suggest me as to how to loop through the table that comes from the variable temp_tab?
Hi guys,
I think this a simple error but i haven't been able to figure out what's wrong with the code below:
Declare temp_cur CURSOR FOR
select table_name from INFORMATION_SCHEMA.TABLES where table_name like 'SAMP_TMP_%'
OPEN temp_cur
FETCH NEXT FROM temp_cur into @temp_tab
WHILE...
Hi All,
I have a requirement that the STORED PROCEDURE should return
records same like storedprocedure in sqlserver. In oracle ref cursors are used to return multiple values, is there anything in t-sql that can perform this.
I get an error message for the foll. dynamic sql code:
********************************************************
Declare temp_cur CURSOR FOR
select table_name from INFORMATION_SCHEMA.TABLES where table_name like 'SAMP_TMP_%'
OPEN temp_cur
FETCH NEXT FROM temp_cur into @temp_tab
PRINT 'Record...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.