What is the purpose of coding FETCH in a SQL SELECT query? Explain with an example in Detail?
4 5103if suppose i am having an ACCOUNT table with 3 coloumns ACC. NO,ACC. NAME,ACC. AMOUNT . If a unique index is also defined on ACC.NO and ACC.NAME then write a query to retrieve account holders records who have more than 1 ACC.
8 68595 rows are inserted to a DB2 Table. Next 3 of those are updated, then a rollback is issued. What would happen when the rollback is issued?
2 4086if there is a table with huge number of records and if i want to extract only first 3 records from the table, what query i have to provide to retreive first 3 records
UST,
4 4992i hav created a program and moved to production but failed to create the table which is been used in the program. the program shows error as soon as it is moved or installed in production or shows error during its runtime. what is the sqlcode for this error
UST,
3 4599a cursor normally gets closed once we provide a commit . If u try to close the same cursor with close cursor command later after providing the commit will there be any sql-error.
3 4959in the CURSOR declare statement, if i am using an where clause and trying to compare the value with a host-varialble. EXEC SQL DECLARE C1 CURSOR FOR SELECT DEPTNO, DEPTNAME, MGRNO FROM DEPARTMENT WHERE ADMRDEPT = :ADM-DEPT Where would i need to provide value to this host-variable in the where clause. how could i pass value to this host-variable to check it.
2 6368
What is runstats and reorg in db2?
How connect db2 database to datastage?
Why db2 is called db2?
What is a buffer in memory?
I am having n number of records in a table which consists of emp-name is one of the field among them. Now i want to change the first letter of every name with capital.
Explain in detail about buffer manager and its functionalities?
i tried to copy some records from microsoft excel to as-400 physical file through "Bosanova" emulation. Out of 14000 records only 12000 records copies and subsequently programe started to hang. Then, i closed the program forcefully. I did' under stand the problem. Also when i try to compile the physical file it is showing as "The file in use". How to overcome this problem?
What is the use of dclgen in db2?
What is cursor with hold option in db2?
What are the full forms of spufi and dclgen and why are they used?
When do you specify the isolation level?
When reorg is used?
Mention a credible reason why select* is never given preference in an sql program that has been embedded.
SET is the ANSI standard for variable assignment, SELECT is not. SET can only assign one variable at a time, SELECT can make multiple assignments at once. If assigning from a query, SET can only assign a scalar value. If the query returns multiple values/rows then SET will raise an error. SELECT will assign one of the values to the variable and hide the fact that multiple values were returned (so you'd likely never know why something was going wrong elsewhere - have fun troubleshooting that one) When assigning from a query if there is no value returned then SET will assign NULL, where SELECT will not make the assignment at all (so the variable will not be changed from it's previous value) As far as speed differences - there are no direct differences between SET and SELECT. However SELECT's ability to make multiple assignments in one shot does give it a slight speed advantage over SET.
What is alias in db2?