在不知道文件有多少行的情况下,如何读取整个文件的内容?
scott@DB> !cat /home/oracle/load.sh
#!/bin/bash
export ORACLE_SID=db
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/sqlplus/admin:$PATH
export NLS_LANG=AMERICAN_AMERICA.UTF8
sqlldr userid=scott/tiger@db control=/home/oracle/test_ds.ctl
scott@DB> l
1 DECLARE
2 V1 VARCHAR2(32767);
3 F1 UTL_FILE.FILE_TYPE;
4 BEGIN
5 F1 := UTL_FILE.FOPEN('/home/oracle','load.sh','R');
6 UTL_FILE.GET_LINE(F1,V1);
7 dbms_output.put_line('v1: ' || v1);
8 UTL_FILE.FCLOSE(F1);
9* END;
scott@DB> /
v1: #!/bin/bash
PL/SQL procedure successfully completed.
sco