Test Data printing (merged) [message #383476] |
Thu, 29 January 2009 00:21 |
raopapa
Messages: 10 Registered: January 2009
|
Junior Member |
|
|
hi guys
i need a test data of each table in the user_tables in the following formart can u pl give solution
for example in a emp table i need data in the following way
EMP,EMPNO 7369
EMP,ENAME SMITH
EMP,JOB CLERK
EMP,MGR 7902
EMP,HIREDATE 12/17/1980
EMP,SAL 800
EMP,COMM
EMP,DEPTNO 20
first records of the emp data.
i made few code can u give further.
DECLARE
BEGIN
FOR i IN (SELECT table_name, column_name
FROM user_tab_columns
WHERE table_name = 'EMP')
LOOP
DBMS_OUTPUT.put_line (i.table_name || ',' || i.column_name);
END LOOP;
END;
/
how to bring first record data of the emp table.
Pl suggest
Paparao
|
|
|
|
Re: Test Data printing [message #383479 is a reply to message #383476] |
Thu, 29 January 2009 00:25 |
|
Littlefoot
Messages: 21821 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Restrict number of records with a little help of the ROWNUM pseudocolumn:SQL> select empno, ename, job, sal
2 from emp
3 where rownum < 5;
EMPNO ENAME JOB SAL
---------- ---------- --------- ----------
7369 SMITH CLERK 1600
7499 ALLEN SALESMAN 2400
7521 WARD SALESMAN 2050
7566 JONES MANAGER 3775
SQL>
[After seeing BlackSwan's reply]
Huh, I understood that ANY number of records (including only one record) would be OK (i.e. that ORDER BY doesn't matter): "i need a test data of each table". I might have got it wrong ...
[Updated on: Thu, 29 January 2009 00:28] Report message to a moderator
|
|
|
|
|
|
|
|
|
|