sql - Adding two row counts in stored procedure in DB2 with parameters -


I am trying to create a stored procedure that uses to get the amount of rows in two tables And then turns out the result.

 Testator Test (in Tab 1 varchar (20), in Tab varchar (20), in msg msg) Select SQL Req SQL data with the return for COUNT (*) Comment R1 from Coorser Tab 1; DECLARE R2 cursor with return for selection from number (*) to tab 2; Open R1; OpenR2; ---- Add 2 plus ----- Call DBMS_UUPTP Put ('Zeilen ='); Call DBMS_OUTPUT.PUT_LINE (msg); END @   

I updated cursor to entire source code since a selected variable = something does not seem to work like this

  SELECT tableOneCount = (1 (choose from) (*) tab 1);   

But now the problem is that I get an error in creating the process that tab1 is unknown which is obvious because it is a variable and I do not know how to add 2 cursor. / P>

Any thoughts?

Thank you in advance.

The Vagaband

As @Musascio said, you use the variable

  declare qty integer; SET QTY = (SELECT COUNT (*) tab 1);    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -