>
> Hai! Ari Kaplan,
>
> I am P.R.K.V. SARMA and I work with ORACLE7 WORKGROUP SERVER (7.3.X) on WINDOWS NT 4.
> I recently visited your web site. I found lot of interesting stuff on ORACLE.
> Thanks for maintaining it.
>
> Can U please send me all the FAQ U have and any interesting stuff which
> will help me to upgrade to ORACLE8.
I do not have any FAQs, but check out www.ioug.org or www.oracle.com for some.
>
> Presently I have few problems :
>
> 1. May be this is foolish, but how to query the ROLLBACK SEGMENTS ?
>
> Let us say I delete from EMP table :
>
> delete from emp where sal > 5000;
>
> and let us say 5 rows got deleted.
>
> I didn't ROLLBACK or COMMIT. So the deleted rows still exist in
> ROLLBACK SEGMENTS. Now how do I query the deleted rows ?
There is no way to do this. The rollback segments are in internal Oracle
format. The only thing I can think of is to open another session. Since you
have not COMMITted yet, the other sessions will be able to see the
deleted rows. In the other session, type:
SELECT FROM emp WHERE sal > 5000;
This will show the 5 rows.
>
> 2. In MS SQL SERVER, I can create a temporary table and do all the
> operations with the temporary table by just prefixing # to the
> tablename
>
> CREATE TABLE #MY_TABLE ( FIRST_COLUMN ....
>
> so the above table #MY_TABLE is a temporary one stored in TEMPDB and later when
> we disconnect, will be droped.
>
> IS THIS AVAILABLE IN ORACLE ? IF YES THEN HOW TO DO IT ?
This is available in PL/SQL, but not in regular SQL. An explanation of PL/SQL
can be had in many books. My favorite is O'Reilly's "PL/SQL Programming"
by Steve Feuerstein. You can create a CURSOR which exists until you either
close the cursor or disconnect from the database.
>
> 3. Using PRO*C, when I connect, I write :
>
> EXEC SQL CONNECT :UID IDENTIFIED BY :PWD;
>
> where UID & PWD are host variables declared and accepted.
> but how do I specify the CONNECT STRING ?
I hope I am answering ths correctly. Try:
EXEC SQL CONNECT :UID@HOST_STRING IDENTIFIED BY :PWD;
>
> 4. How do I count number of rows available in a table without using COUNT function.
> Can I use DECODE function ? If yes, then please show me how.
>
There are two ways to determine the number of records:
1) SELECT COUNT(*) FROM table_name;
2) ANALYZE TABLE the_table_name ESTIMATE STATISTICS;
SELECT NUM_ROWS FROM ALL_TABLES
WHERE TABLE_NAME = 'the_table_name';
> Thanks again.
No problem.
-Ari
Back to Ari Kaplan's Home Page