Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Question; SQL Plus commands and NT Batch file.

Re: Question; SQL Plus commands and NT Batch file.

From: Joe Caporina <spam_at_nospam.com>
Date: Fri, 27 Sep 2002 15:35:54 -0700
Message-ID: <3d94c06f$1_4@news.newsgroups.com>


Ok, Fix the SQL syntax problems. This is working for me now. Any suggestions appreciated:

insert into telecomm.accttable

(username,duration,nasaddress,nasport,bytesin,bytesout,paksin,paksout,framed
ipaddress,nasidentifier,acctlinkcount,connectinfo,shivatypeofservice,calling
stationid,calledstationid,shivadisconnectreason,logoutdatetime,logindatetime
)
select
user_name,acct_session_time,nas_ip_address,nas_port,acct_input_octets,acct_o
utput_octets,acct_input_packets,acct_output_packets,framed_ip_address,nas_id
entifier,acct_link_count,connect_info,service_type,calling_station_id,called
_station_id,acct_terminate_cause,ias_logoutdatetime,ias_logindatetime from telecomm.ias_records
/
commit
;

exit

"Kevin Gillins" <k.gillins_at_verizon.net> wrote in message news:amvjvb$qki$1_at_nntp-m01.news.aol.com...
> Joe, you now have SQL syntax problems.....missing ) also missing 3rd
> column name on the select statement to match the acctt column from the
> insert.
>
> insert into table1
> (col1, col2, col3)
> select
> src1, src2, src3
> from src_table;
>
> exit
>
> Kevin
>
>
>
> "Joe Caporina" <spam_at_nospam.com> wrote in message
> news:3d934aca$1_10_at_news.newsgroups.com...
> > I used the same sql script an get an error message when I used the
> > semicolin.
> >
> > SQL> get insert
> > 1 insert into telecomm.acctt
> > 2 (username,duration,nasaddr
> > 3 select
> > 4 user_name,acct_session_tim
> > 5 from telecomm.ias_record ;
> > 6* exit
> > 7 /
> > from telecomm.ias_record;
> > *
> > ERROR at line 5:
> > ORA-00911: invalid character
> >
> > "Kevin Gillins" <k.gillins_at_verizon.net> wrote in message
> > news:amv7nl$d6o$1_at_nntp-m01.news.aol.com...
> > > If the sql you inserted here is an exact copy then you may be missing
a
> > ";"
> > > at the end of the insert. This would cause the sql processor to keep
> > > waiting for commands until the ; is pressed. Try inserting a ; after
> the
> > > last line of the insert then a blank line then the exit command and a
> > blank
> > > line. This should cause the sqlplus window to close.
> > >
> > > Then at the bat file level you may need to have an exit at the end but
> > > possibly not.
> > >
> > > Kevin
> > >
> > > "Joe Caporina" <spam_at_nospam.com> wrote in message
> > > news:3d921631$1_8_at_news.newsgroups.com...
> > > > Thanks, I did that , but it did not work till someone recommended I
> skip
> > a
> > > > line before typing exit in my sql script.
> > > > "Wells" <wshammou-NoSpam_at_optonline.net> wrote in message
> > > > news:Jaak9.340$Wk.53150_at_news4.srv.hcvlny.cv.net...
> > > > > I put "quit" at the end of my sql scripts. The batch file
> > automatically
> > > > > ends when the last command is executed, provided it regains
control.
> > > The
> > > > > "quit" will exit SqlPlus and return control to the batch file.
> > > > >
> > > > > Cheers,
> > > > > Wells...
> > > > >
> > > > > "Joe Caporina" <spam_at_nospam.com> wrote in message
> > > > > news:3d90e127$1_7_at_news.newsgroups.com...
> > > > > > I'm sure someone seen this before and knows the answere. I
created
> a
> > > > > > scheduled NT batch file to run a SQL Loader and SQL script to
> update
> > > my
> > > > > > Cisco Radius logs into an Oracle database table for an account
> > billing
> > > > > > front end. The Question is how do I get the SQL Plus script to
> exit
> > > and
> > > > > > close the DOS window when the .bat is executed and finished.
Exit
> > does
> > > > > work
> > > > > > without the enter key.
> > > > > > Copy of batch file ;
> > > > > > sqlldr Telecomm/Password_at_pmgd.es.alliance.com
> > > > > > control=e:\radius\sqlldr\loader.ctl log=log23 skip=1
> > > > > > data=e:\radius\sqlldr\iasdata.csv
> > > > > >
> > > > > >
> > > > > > sqlplus Telecomm/Password_at_pmgd.es.alliance.com
> > > @e:\radius\sqlldr\insert
> > > > > >
> > > > > > Copy of SQL script ;
> > > > > > create ias_records2 as select distinct * from ias_records
> > > > > >
> > > > > > drop ias_records
> > > > > >
> > > > > > rename ias_records2 to ias_records
> > > > > >
> > > > > > insert into telecomm.accttable
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

(username,duration,nasaddress,nasport,bytesin,bytesout,paksin,paksout,framed
> > > > > >
> > > > >
> > > >
> > >
> >
>

ipaddress,nasidentifier,acctlinkcount,connectinfo,shivatypeofservice,calling
> > > > > >
> > > > >
> > > >
> > >
> >
>

stationid,calledstationid,shivadisconnectreason,logoutdatetime,logindatetime
> > > > > > )
> > > > > >
> > > > > > select
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

user_name,acct_session_time,nas_ip_address,nas_port,acct_input_octets,acct_o
> > > > > >
> > > > >
> > > >
> > >
> >
>

utput_octets,acct_input_packets,acct_output_packets,framed_ip_address,nas_id
> > > > > >
> > > > >
> > > >
> > >
> >
>

entifier,acct_link_count,connect_info,service_type,calling_station_id,called
> > > > > >
> > _station_id,acct_terminate_cause,ias_logoutdatetime,ias_logindatetime
> > > > > >
> > > > > > from telecomm.ias_records
> > > > > >
> > > > > > exit
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > -----------== Posted via Newsfeed.Com - Uncensored Usenet News
> > > > > ==----------
> > > > > > http://www.newsfeed.com The #1 Newsgroup Service in the
> > > World!
> > > > > > -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19
> > Servers
> > > > > =-----
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > > -----------== Posted via Newsfeed.Com - Uncensored Usenet News
> > > ==----------
> > > > http://www.newsfeed.com The #1 Newsgroup Service in the
> World!
> > > > -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19
Servers
> > > =-----
> > >
> > >
> >
> >
> >
> >
> > -----------== Posted via Newsfeed.Com - Uncensored Usenet News
> ==----------
> > http://www.newsfeed.com The #1 Newsgroup Service in the World!
> > -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers
> =-----
>
>

-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------

   http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =----- Received on Fri Sep 27 2002 - 17:35:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US