Subject | Procedur In Select |
---|---|
Author | wiyono |
Post date | 2011-07-27T03:06:19Z |
Deal All, Please Help me
My SQL is
SELECT a.indate,
a.cuscd,
F_GetCustNm(a.CusCd) custname,
a.Indate,
a.qty
FROM takein
With Table Name
1. Customer (CusCd, CusNm, Addr, Telp)
2. Takein (Indate, CusCd, Qty)
3. Procedur F_GetCustNm
Procedur F_GetCustNm is
SET TERM ^ ;
CREATE OR ALTER PROCEDURE F_GetCustNm (
sCusCd varchar(10))
returns (
sCusNm varchar(50))
as
begin
SELECT TRIM(coalesce(CusNm,'')) CusNm
FROM Customer
WHERE CusCd = :sCusCd
INTO sCusNm;
suspend;
end^
SET TERM ; ^
GRANT SELECT ON Customer TO PROCEDURE F_GetCustNm;
GRANT EXECUTE ON PROCEDURE F_GetCustNm TO SYSDBA;
Thanks
===============================================================================================
This e-mail transmission is intended solely for the ordinary user of the e-mail address
to which it was addressed. It may contain legally privileged and/or confidential information.
If you have received this e-mail in error or are not an intended recipient please inform
the sender with-out delay and delete this e-mail, attachments and possible copies immediately.
The unauthorized use, disclosure, distribution and/or copying of this e-mail or any information
it contains is prohibited
[Non-text portions of this message have been removed]
My SQL is
SELECT a.indate,
a.cuscd,
F_GetCustNm(a.CusCd) custname,
a.Indate,
a.qty
FROM takein
With Table Name
1. Customer (CusCd, CusNm, Addr, Telp)
2. Takein (Indate, CusCd, Qty)
3. Procedur F_GetCustNm
Procedur F_GetCustNm is
SET TERM ^ ;
CREATE OR ALTER PROCEDURE F_GetCustNm (
sCusCd varchar(10))
returns (
sCusNm varchar(50))
as
begin
SELECT TRIM(coalesce(CusNm,'')) CusNm
FROM Customer
WHERE CusCd = :sCusCd
INTO sCusNm;
suspend;
end^
SET TERM ; ^
GRANT SELECT ON Customer TO PROCEDURE F_GetCustNm;
GRANT EXECUTE ON PROCEDURE F_GetCustNm TO SYSDBA;
Thanks
===============================================================================================
This e-mail transmission is intended solely for the ordinary user of the e-mail address
to which it was addressed. It may contain legally privileged and/or confidential information.
If you have received this e-mail in error or are not an intended recipient please inform
the sender with-out delay and delete this e-mail, attachments and possible copies immediately.
The unauthorized use, disclosure, distribution and/or copying of this e-mail or any information
it contains is prohibited
[Non-text portions of this message have been removed]