procedure nextinvoicenum
( invoicenum out number
) as
nextinvoiceid number;
begin
-- select invoice_seq.currval +1 into nextinvoiceid from dual;
select max(tid) + 1 into invoicenum from invoice;
invoicenum := NVL (invoicenum,1);
DBMS_OUTPUT.PUT_LINE('INVOICENUM = ' || INVOICENUM);
end nextinvoicenum;
==================================================================
connObj = getConnObj
cmdObj = New ADODB.Command
With cmdObj
.let_ActiveConnection(connObj)
.CommandType = ADODB.CommandTypeEnum.adCmdStoredProc
.CommandText = "invoicepackage.nextinvoicenum"
.Parameters.Append(.CreateParameter("invoicenum", ADODB.DataTypeEnum.adInteger, ADODB.ParameterDirectionEnum.adParamOutput, 255, 0))
End With
cmdObj.Execute()
getNextInvoiceIndex = cmdObj.Parameters("invoicenum").Value
MessageBox.Show(getNextInvoiceIndex )
|