Platform.dbExecuteSQL( "select inr,smhinr from spt where objref like ? and relcur=? and relamt=? and objtyp=? and msgtyp in ('202','910') and delflg=' '", ref103 + "%", $\spt\relcur.getValue(), $\spt\relamt.getValue(), $\spt\objtyp.getValue() );
Platform.dbExecuteSQL( "select sta from clr where srctyp='SPT' and srcinr=?", sptinr );
err = Platform.errorCode();
Platform.dbFetchFields( "", sta );
Argument<String> staBox = new Argument<>();
Platform.dbFetchFields( "", staBox );
sta = staBox.value;
Platform.dbCloseCursor();
err = Platform.errorCode();
if( Platform.compareTo( sta , "E" ) == 0 )
...
...
@@ -33,7 +35,9 @@ void deleteClearMsg()
relflg = "";
Platform.dbExecuteSQL( "select relflg from (select relflg from trn where objtyp = 'CLR' and objinr = (select inr from clr where srctyp = 'SPT' and srcinr = ? ) order by inr desc ) where rownum = 1 ", sptinr );
sql = "select smhinr from spt where inr = '" + sptinr + "'";
Platform.dbExecuteSql( sql );
Platform.dbFetchFields( "", smhinr );
Argument<String> smhinrBox = new Argument<>();
Platform.dbFetchFields( "", smhinrBox );
smhinr = smhinrBox.value;
err = Platform.errorCode();
if( err != 0 || err != tdOdbcNotFound )
{
...
...
@@ -110,7 +112,9 @@ event $bakbut order 1000
// $sql = "select FPSSID from smh where inr='RG000525
sql = "select FPSSID from fps where tranid='RECIEVE' and trim(filnam)=(select trim(docfil) || '.' || trim(docfxt) from smh where inr='" + smhinr + "')";
@@ -113,7 +113,15 @@ void doHandle(Argument<String> rc,Argument<String> errmsg,String subnam,String t
sql = "select adr.tel3 , adr.adr1 , adr.fax3 , led.amenbr from adr , pts , led where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='LED' aND pts.OBJINR='" + objinr + "' and pts.rol='BEN' and led.inr=pts.OBJINR ";
@@ -128,7 +136,11 @@ void doHandle(Argument<String> rc,Argument<String> errmsg,String subnam,String t
sql = "select cbe.amt,cbe.cur from trn , cbe where trn.inifrm='LETOPN' and trn.ownref='" + ownref + "' and trn.relflg in('F','R') and cbe.trninr=trn.inr and cbe.extid='AMT1' AND cbe.CBT='NOMAMT' ";
Platform.sqlSetDirtyRead();
Platform.dbExecuteSql( sql );
Platform.dbFetchFields( "", amt, "", cur );
Argument<String> amtBox = new Argument<>();
Argument<String> curBox = new Argument<>();
Platform.dbFetchFields( "", amtBox, "", curBox );
amt = amtBox.value;
cur = curBox.value;
error = Platform.errorCode();
Platform.dbCloseCursor();
Platform.sqlSetCommittedRead();
...
...
@@ -141,7 +153,9 @@ void doHandle(Argument<String> rc,Argument<String> errmsg,String subnam,String t
sqltrd = "select count(*) from TRD where pnttyp='BED' and pntinr='" + objinr + "'";
Platform.sqlSetDirtyRead();
Platform.dbExecuteSql( sqltrd );
Platform.dbFetchFields( "", count );
Argument<Integer> countBox = new Argument<>();
Platform.dbFetchFields( "", countBox );
count = countBox.value;
error = Platform.errorCode();
Platform.dbCloseCursor();
Platform.sqlSetCommittedRead();
...
...
@@ -150,7 +164,15 @@ void doHandle(Argument<String> rc,Argument<String> errmsg,String subnam,String t
sql = "select adr.tel4 , adr.adr1 , adr.fax4 ,PTS.REF from adr , pts , BED where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BED' aND pts.OBJINR='" + objinr + "' and pts.rol='BEN' and BED.inr=pts.OBJINR ";
@@ -170,7 +192,9 @@ void doHandle(Argument<String> rc,Argument<String> errmsg,String subnam,String t
sqltrd = "select count(*) from TRD where PNTtyp='BTD' and pntinr='" + objinr + "'";
Platform.sqlSetDirtyRead();
Platform.dbExecuteSql( sqltrd );
Platform.dbFetchFields( "", count );
Argument<Integer> countBox = new Argument<>();
Platform.dbFetchFields( "", countBox );
count = countBox.value;
error = Platform.errorCode();
Platform.dbCloseCursor();
Platform.sqlSetCommittedRead();
...
...
@@ -179,14 +203,24 @@ void doHandle(Argument<String> rc,Argument<String> errmsg,String subnam,String t
sql = "select adr.tel4 , adr.adr1 , adr.fax4 ,PTS.REF from adr , pts , BTD where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BTD' aND pts.OBJINR='" + objinr + "' and pts.rol='BE1' and BTD.inr=pts.OBJINR ";
@@ -199,7 +233,9 @@ void doHandle(Argument<String> rc,Argument<String> errmsg,String subnam,String t
sqltrd = "select count(*) from TRD where PNTtyp='BOD' and pntinr='" + objinr + "'";
Platform.sqlSetDirtyRead();
Platform.dbExecuteSql( sqltrd );
Platform.dbFetchFields( "", count );
Argument<Integer> countBox = new Argument<>();
Platform.dbFetchFields( "", countBox );
count = countBox.value;
error = Platform.errorCode();
Platform.dbCloseCursor();
Platform.sqlSetCommittedRead();
...
...
@@ -208,7 +244,15 @@ void doHandle(Argument<String> rc,Argument<String> errmsg,String subnam,String t
sql = "select adr.tel5 , adr.adr1 , adr.fax5 ,PTS.REF from adr , pts , BOD where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BOD' aND pts.OBJINR='" + objinr + "' and pts.rol='DRR' and BOD.inr=pts.OBJINR";
@@ -228,7 +272,16 @@ void doHandle(Argument<String> rc,Argument<String> errmsg,String subnam,String t
sql = "select adr.tel6 , adr.adr1 , adr.fax6 ,LID.ownref,BRD.ORDPAYDAT from adr , pts , LID,BRD where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BRD' aND pts.OBJINR=BRD.inr and pts.rol='APL' and BRD.inr=pts.OBJINR and BRD.inr='" + objinr + "'" + " and LID.inr=BRD.PNTINR and BRD.PNTTYP='LID'";
//DBExecuteSQL( "SELECT REF FROM PTS WHERE PTYINR IN (SELECT INR FROM PTY WHERE EXTKEY ='R0000216
Platform.dbExecuteSql( "SELECT REF FROM PTS WHERE PTYINR IN (SELECT INR FROM PTY WHERE EXTKEY LIKE '" + Platform.mid( cliextkey, 1, 10 ) + "%') AND objtyp='" + objtyp + "' AND OBJINR='" + objinr + "' " );
Platform.dbExecuteSQL( "Select distinct STA from SPT where DELFLG = ' ' and OBJTYP = ? and OBJINR = ? and INR <> ?", objTyp, objInr, $\sysmod\spt\inr.getValue() );
sqlSmh = "SELECT MSGTYP FROM SMH WHERE OBJTYP ='CPD' AND TRNTYP = 'TRN' AND TRNINR <> ' ' AND F21 <> ' ' AND MSGTYP = 'T23' AND OBJINR = " + Platform.sqlLit( texts );