Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

execute sql from sqlplus or invoke sqlplus from Unix

Status
Not open for further replies.

jennhu

Programmer
Apr 14, 2000
1
US
I have problem run the following sql from sqlplus invoked from Unix(&gt;sqlplus -s connectstring @filename). The error message is:<br><br>ERROR at line 2:<br>ORA-01858: a non-numeric character was found where a numeric was expected<br><br>But if I login to sqlplus directly, it works fine.<br><br><br>The sql code is:<br>CREATE TABLE abc<br>( <br>&nbsp;ValidFrom DATE,<br>&nbsp;ValidTo&nbsp;&nbsp;&nbsp;DATE, <br>&nbsp;Threshold NUMBER<br>);<br><br>INSERT INTO abc<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VALUES (TO_DATE('01-JAN-00'), TO_DATE('31-DEC-00'), 1000);<br><br><br>TIA
 
Try this, slashes instead of semi-colons when you run sql from a file:<br><br>Mike<br><br><b><FONT FACE=monospace><br>CREATE TABLE abc( <br>&nbsp;&nbsp;&nbsp;&nbsp;ValidFrom DATE,<br>&nbsp;&nbsp;&nbsp;&nbsp;ValidTo&nbsp;&nbsp;&nbsp;DATE, <br>&nbsp;&nbsp;&nbsp;&nbsp;Threshold NUMBER<br>)/<br><br>INSERT INTO abc VALUES (<br>&nbsp;&nbsp;&nbsp;&nbsp;TO_DATE('01-JAN-00'),<br>&nbsp;&nbsp;&nbsp;&nbsp;TO_DATE('31-DEC-00'),<br>&nbsp;&nbsp;&nbsp;&nbsp;1000<br>)/<br></b></font><br><br>(and mind those two digit years as well)<br><br>Mike <p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top