Inserting a row using shell

hi all,

In first run,I am inserting a row into an oracle table through shell script,
in the same shell script when I query this table the count comes as 0.

When I run the same script again then the count comes correctly,
Can anyone help how can I get the count of the row correctly in the same run when the row is inserted in table.

Thanks.

use

after inserting row..You will get correct count...

Show us what you have written

     entry_data_control=`sqlplus  ${sysuser}/${syspwd} << EOSQL
                      whenever sqlerror exit sql.sqlcode;
       whenever oserror exit failure;
       INSERT INTO LSHADMIN.STUDY_LEVEL_TABLE(dataload_no,SESSION_SID,SESSION_SERIAL_NO,FILE_NAME,
                                              TIMESTAMP,session_status,STUDY_NAME,BLIND_BREAK,valid_file_naming)
                select  LSHADMIN.seq.nextval,sid,$serial, '$i' ,
                        to_char(to_date($timestamp,'YYYYMMDDHH24MISS'),
                  'YYYY/MM/DD::HH24:MI:SS'),status,'$substring1','$substring3',
                  '$valid_file'
                FROM $table 
                WHERE audsid = userenv('sessionid');
       COMMIT;
       EXIT;
       EOSQL`

this is insert stmt..
 
 

update_study_tab(){
                    echo "inside update_study_tab "
     status="$1"
     name="$2"
     echo "$status"
     echo "$name"
                   update=`nohup sqlplus  ${sysuser}/${syspwd} <<UpdateTab
               whenever sqlerror exit sql.sqlcode;
      whenever oserror exit failure;
      select count(*) from lshadmin.study_level_table where study_name = '$name';
      execute LSHADMIN.update_study_tab('${name}','${status}');
       commit;
      exit;
      UpdateTab`
       echo "update $update"
                 } 

I am getting count as 0 in this update stmt.
[/CODE]