0

I want to put this request (SELECT qte FROM table_stock where id_pro = cpt1) into an integer, like that i will be able to check if the product still exist (if quantity >0) so I us

0

2 Answers 2

1
SELECT qte 
   into quantite 
FROM table_stock 
where id_pro = cpt1;

More details in the PL/pgSQL reference

Sign up to request clarification or add additional context in comments.

Comments

1

Try to avoid the loop with a single query like insert into table_result select... where quantity > 0;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.