- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is Fixed-list SELECT? Give the syntax and explain with help of an example
The EXECUTE IMMEDIATE and EXECUTE with PREPARE could not be used for SELECT query. For the SELECT query, we have a fixed list SELECT in which the column to be fetched remains fixed and it cannot be changed.
For example, if we want to select the orders placed on 14-08-2020. Then we can use dynamic SQL as given below:
MOVE ‘SELECT ORDER_ID FROM ORDERS WHERE ORDER_DATE=?’ TO WS-SQL-QUERY EXEC SQL DECLARE ORDER-CUR CURSOR FOR SELQUERY END-EXEC EXEC SQL PREPARE SELQUERY FROM :WS-SQL-QUERY END-EXEC MOVE ‘14-08-2020’ TO WS-ORDER-DATE EXEC SQL OPEN ORDER-CUR USING :WS-ORDER-DATE END-EXEC PERFORM UNTIL SQLCODE = +100 EXEC SQL FETCH ORDER-CUR INTO :WS-ORDER-ID END-EXEC END-PERFORM EXEC SQL CLOSE ORDER-CUR END-EXEC
- What is the purpose of COALESCE function? Explain with the help of an example.
- What is the difference between DB2 JOIN and UNION? Explain with the help of an example
- Explain SHARED, UPDATE and EXCLUSIVE locks with the help of an example
- Explain the concept of LOCK PROMOTION with the help of an example
- What are COLUMN functions in DB2? Explain with the help of an example
- Explain join operations with the help of an example in DBMS
- What is CLUSTERED INDEX in DB2? Explain with the help of practical example.
- What is the use of the VALUE function in a DB2? Explain with the help of an example
- What is NON CLUSTERED INDEX in DB2? Explain with the help of practical example
- Explain the concept of DYNAMIC SQL in DB2 with the help of an example
- What is the character count? Explain with an example?
- What is a use of SQLWARN3 in a SQLCA? Explain with the help of a practical example?
- What is an anonymous array and explain with an example in Java?
- What is Inheritance in Java? Explain with an example
- What is CheckBoxTreeItem in JavaFX explain with an example?