pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedAsking GO on SQL SERVER
5+ messages / 4 participants
[nested] [flat]
* Asking GO on SQL SERVER
@ 2008-04-03 01:44 Otniel Michael <otnieltera@gmail.com>
2008-04-03 01:55 ` Re: Asking GO on SQL SERVER paul rivers <rivers.paul@gmail.com>
2008-04-03 02:09 ` Re: Asking GO on SQL SERVER Gurjeet Singh <singh.gurjeet@gmail.com>
0 siblings, 2 replies; 5+ messages in thread
From: Otniel Michael @ 2008-04-03 01:44 UTC (permalink / raw)
To: pgsql-sql
Hi All..
Anybody knows what is "GO" (SQL Server) on Postgres?
Thanks.
--
-------------------------------------------------------------------
"He who is quick to become angry will commit folly, and a crafty man is
hated"
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Asking GO on SQL SERVER
2008-04-03 01:44 Asking GO on SQL SERVER Otniel Michael <otnieltera@gmail.com>
@ 2008-04-03 01:55 ` paul rivers <rivers.paul@gmail.com>
2008-04-03 02:12 ` Re: Asking GO on SQL SERVER Otniel Michael <otnieltera@gmail.com>
1 sibling, 1 reply; 5+ messages in thread
From: paul rivers @ 2008-04-03 01:55 UTC (permalink / raw)
To: Otniel Michael <otnieltera@gmail.com>; +Cc: pgsql-sql
Otniel Michael wrote:
> Hi All..
>
> Anybody knows what is "GO" (SQL Server) on Postgres?
>
> Thanks.
>
> --
> -------------------------------------------------------------------
> "He who is quick to become angry will commit folly, and a crafty man
> is hated"
semi-colon.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Asking GO on SQL SERVER
2008-04-03 01:44 Asking GO on SQL SERVER Otniel Michael <otnieltera@gmail.com>
2008-04-03 01:55 ` Re: Asking GO on SQL SERVER paul rivers <rivers.paul@gmail.com>
@ 2008-04-03 02:12 ` Otniel Michael <otnieltera@gmail.com>
2008-04-03 03:06 ` Re: Asking GO on SQL SERVER Phillip Smith <phillip.smith@weatherbeeta.com.au>
0 siblings, 1 reply; 5+ messages in thread
From: Otniel Michael @ 2008-04-03 02:12 UTC (permalink / raw)
To: pgsql-sql
Hem... I think postgresql do not like that.
For this example in function spEAR470.
When "open Phasil for" not yet finishing, postgresql do "Delete from
ear470_02 where sessid = Psess;". And this function becoming ERROR.
But this case happen when this function call from 3 users in same time.
Any solution please?
Thanks before.
Create or Replace Function spEAR470 (refcursor,varchar,char,char,char)
returns refcursor
as '
declare
Phasil alias for $1; Psess alias for $2;
PTglFrom alias for $3; PTglTo alias for $4;
Psbmscd alias for $5;
jumlah integer;
waktu text;
begin
Select '' Begin - spEAR470 = '' || timeofday() into waktu;
Raise Notice ''%'',waktu;
Delete from ear470_01 where sessid = Psess;
Delete from ear470_02 where sessid = Psess;
/* Rekap data transaksi proses produksi untuk bulan dan mesin yang
bersangkutan */
insert into ear470_01(sessid,sbmscd,sbmsnm,wipcod,bjcod,
wasgrpnm,wastcd,wastds,
qtywaste,unit,qtywstbesar,qtywstkecil,qtykonv,
running,runbesar,runkecil,runkonv)
select PSess,B.sbmscd,D.SBMSNM,B.wipcod,'''',
coalesce(C.wasgrpnm,''''),coalesce(A.wastcd,''''),coalesce(C.wastds,''''),
sum(coalesce(A.qtywst,0)),E.brunin,0,0,sum(A.qtywst),
0,0,0,0
from B
left outer join A on B.jentrn=A.jentrn and B.thbltr=A.thbltr and
B.nortrn=A.nortrn
and A.brgcod in (''WST')
left outer join C on C.wastcd=A.wastcd
inner Join D On D.SBMSCD = B.SBMSCD
inner join E On B.wipcod = E.brgcod
where B.TGLTRN between PTglFrom and PTglTo and Trim(B.sbmscd) like
(PSbmscd)
and B.gdskcd = ''S'' and B.sbskcd <> ''P''
group by
B.sbmscd,B.wipcod,A.wastcd,C.wastds,E.brunin,D.SBMSNM,C.wasgrpnm;
Select '' spEAR470 - 9 = '' || timeofday() into waktu;
Raise Notice ''%'',waktu;
insert into
ear470_02(sessid,sbmscd,sbmsnm,wasgrpnm,wastcd,wastds,qtywaste,unit,qtykonv,running,runkonv,activetime)
select
sessid,sbmscd,sbmsnm,wasgrpnm,wastcd,wastds,sum(qtywaste),unit,sum(qtykonv),0,0,0
from ear470_01
where sessid = Psess
group by sessid,sbmscd,sbmsnm,wasgrpnm,wastcd,wastds,unit;
Select '' spEAR470 - 10 = '' || timeofday() into waktu;
Raise Notice ''%'',waktu;
/* Put the result into hasil variable */
open Phasil for
select
SBMSCD,SBMSNM,WASGRPNM,WASTCD,WASTDS,Qtywaste,Unit,QtyKonv,Running,ActiveTime,RunKonv
from ear470_02
Where SESSID = PSess
Order By SBMSNM,WASGRPNM,WASTDS;
Select '' spEAR470 - 15 = '' || timeofday() into waktu;
Raise Notice ''%'',waktu;
/* Delete unused data */
Delete from ear470_01 where sessid = Psess;
Delete from ear470_02 where sessid = Psess;
Select '' End - spEAR470 = '' || timeofday() into waktu;
Raise Notice ''%'',waktu;
return Phasil;
end;
' language 'plpgsql';
On Thu, Apr 3, 2008 at 8:55 AM, paul rivers <rivers.paul@gmail.com> wrote:
> Otniel Michael wrote:
>
> > Hi All..
> >
> > Anybody knows what is "GO" (SQL Server) on Postgres?
> >
> > Thanks.
> >
> > --
> > -------------------------------------------------------------------
> > "He who is quick to become angry will commit folly, and a crafty man is
> > hated"
> >
>
> semi-colon.
>
>
>
--
-------------------------------------------------------------------
"He who is quick to become angry will commit folly, and a crafty man is
hated"
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Asking GO on SQL SERVER
2008-04-03 01:44 Asking GO on SQL SERVER Otniel Michael <otnieltera@gmail.com>
2008-04-03 01:55 ` Re: Asking GO on SQL SERVER paul rivers <rivers.paul@gmail.com>
2008-04-03 02:12 ` Re: Asking GO on SQL SERVER Otniel Michael <otnieltera@gmail.com>
@ 2008-04-03 03:06 ` Phillip Smith <phillip.smith@weatherbeeta.com.au>
0 siblings, 0 replies; 5+ messages in thread
From: Phillip Smith @ 2008-04-03 03:06 UTC (permalink / raw)
To: 'Otniel Michael' <otnieltera@gmail.com>; pgsql-sql
> Hem... I think postgresql do not like that.
You may need to add a "COMMIT;" in there somewhere...?
THINK BEFORE YOU PRINT - Save paper if you don't really need to print this
*******************Confidentiality and Privilege Notice*******************
The material contained in this message is privileged and confidential to
the addressee. If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.
Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments
e-mail.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Asking GO on SQL SERVER
2008-04-03 01:44 Asking GO on SQL SERVER Otniel Michael <otnieltera@gmail.com>
@ 2008-04-03 02:09 ` Gurjeet Singh <singh.gurjeet@gmail.com>
1 sibling, 0 replies; 5+ messages in thread
From: Gurjeet Singh @ 2008-04-03 02:09 UTC (permalink / raw)
To: Otniel Michael <otnieltera@gmail.com>; +Cc: pgsql-sql
On Thu, Apr 3, 2008 at 7:14 AM, Otniel Michael <otnieltera@gmail.com> wrote:
> Hi All..
>
> Anybody knows what is "GO" (SQL Server) on Postgres?
>
If you are using the interactive terminal psql, then you can use \g meta
command....
select 1+2
\g
---- expect results here.
Remember that this is a feature of psql; so if you are using ODBC, JDBC etc,
it won't work from those interfaces.
Best regards,
--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com
EnterpriseDB http://www.enterprisedb.com
Mail sent from my BlackLaptop device
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2008-04-03 03:06 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-04-03 01:44 Asking GO on SQL SERVER Otniel Michael <otnieltera@gmail.com>
2008-04-03 01:55 ` paul rivers <rivers.paul@gmail.com>
2008-04-03 02:12 ` Otniel Michael <otnieltera@gmail.com>
2008-04-03 03:06 ` Phillip Smith <phillip.smith@weatherbeeta.com.au>
2008-04-03 02:09 ` Gurjeet Singh <singh.gurjeet@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox