Thread: Using sql statements in file

Using sql statements in file

From
"Suresh Basandra"
Date:
<div class="Section1"><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">Hi,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">I would like to do the following using files:</span></font><p class="MsoNormal"><font face="Arial"
size="2"><spanstyle="font-size:10.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">1. <span class="GramE">put</span> create database, create tables sql statements in a file and
executethrough prompt</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial">2. <span class="GramE">insert</span> or update data that is put in a file</span></font><p
class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">Please let me know if there are any examples that lists how sql statements can <span
class="GramE">be<spanstyle="mso-spacerun:yes">  </span>put</span> in a file and used.</span></font><p
class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">Thanks</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">Suresh Basandra</span></font></div>

Re: Using sql statements in file

From
Wei Weng
Date:
try psql -f filename


On Mon, 22 Sep 2003, Suresh Basandra wrote:

> Hi,
>  
> I would like to do the following using files:
>  
> 1. put create database, create tables sql statements in a file and
> execute through prompt
> 2. insert or update data that is put in a file
>  
> Please let me know if there are any examples that lists how sql
> statements can be  put in a file and used.
>  
> Thanks
> Suresh Basandra
>