Re: Run SQL Statement with temp table from prompt
Posted in 2000
Ilhan,
I'll be suprised if this works, but what about something like this ?
YESTERDAY=`dbaccess dcs <<X 2>/dev/null | awk '/[0-9]/ {print $2}'
select mod(year(today-1),100) || month(today-1) || day(today-1)
from systables
where tabid = 1
X`
dbaccess dcs <<X 2>/dev/null
unload to "gunluk_rapor"
select <stuff>
from eds_exception
where shipmentdate = "${YESTERDAY}"X
> Ilhan Erden wrote:
>
> > select *, "20"|| shipmentdate[1,2] yil,shipmentdate[3,4]
> > ay,
> > shipmentdate[5,6]> > gun
> > from
> > esd_exception
> > into temp tarih_ayrilmis with no
> > log;
> > unload to
> > gunluk_rapor
> > select
> > gun,ay,yil,shipperaccount,airwaybill,consignee_code,cons_iata,
> > cons_zipcode,cons_countrycode,exception_msg from
> > tarih_ayrilmis
> > where yil=year(current) and ay=month(current) and
> > gun=day(current)-1
>
> Do you want to find out the date of the gun shipment ?
>
> (sorry, couldn't miss that one !)