pixiBanklineExists
Returns the number of bank lines that match the given bank texts and, optionally, the amount.
Checks whether bank lines (BankLines) with the given values already exist, for example before importing a bank statement.
- Empty strings in
BankText01,BankText02andBankText03are treated asNULL. - At least one of the three text parameters must be filled. If all three are empty or missing, no search is done; the result row has
count= 0 and the columnerrorcontains a message. - Otherwise all bank lines are counted where each given parameter matches the column of the same name exactly (
=comparison, noLIKE). Parameters that are not given do not restrict the search. BankAmountis optional and is compared exactly withBankAmount.
The call always returns exactly one row with the count, a text message and an error text (or NULL).
Notes
- Errors are not raised as SQL errors. Check the column
error: if it is notNULL, the parameters were invalid. In that casemessagestill saysNo bankline was found.. - Pitfall: a parameter that is not given is replaced by the column itself (
ISNULL(@Param, Column)). Bank lines where one of the columnsBankText01,BankText02,BankText03orBankAmountisNULLare therefore never counted, even if that parameter was not passed. - Text comparison uses the collation of the database (usually case-insensitive). Trailing spaces are ignored in the comparison, leading spaces are not.
- The query reads without
NOLOCK. There are no side effects.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
BankText01
|
varchar(1024) string |
NULL |
First bank text to search for (exact match on Example: |
BankText02
|
varchar(1024) string |
NULL |
Second bank text to search for (exact match on Example: |
BankText03
|
varchar(1024) string |
NULL |
Third bank text to search for (exact match on Example: |
BankAmount
|
money decimal |
NULL |
Optional amount of the bank line (exact match on Example: |
Result set 1 · Always, exactly one row
Number of matching bank lines with a message and, if the parameters were invalid, an error text.
| Column | Type | Description |
|---|---|---|
count
|
int |
Number of matching bank lines; 0 if none were found or the parameters were invalid. |
message
|
varchar(22) string |
|
error
Nullable |
varchar(100) string |
Error text if none of the text parameters was given, otherwise |
Response example
<SqlRowSet1>
<row>
<count>1</count>
<message>Bankline/s exist.</message>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| error (column) | One of parameters BankText01, BankText02 or BankText03 is mandatory! | `BankText01`, `BankText02` and `BankText03` are all missing or empty. Pass at least one non-empty bank text. |
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
Authorization: Basic BASE64(USERNAME:PASSWORD)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiBanklineExists>
<!-- <BankText01>Max Mustermann</BankText01> -->
<!-- <BankText02>Rechnung 2024-10045</BankText02> -->
<!-- <BankText03>DE89370400440532013000</BankText03> -->
<!-- <BankAmount>149.90</BankAmount> -->
</ns1:pixiBanklineExists>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
curl -X POST 'https://apigateway.descartes.com/tms/pixi/' \
--user 'USERNAME:PASSWORD' \
--header 'Content-Type: text/xml; charset=utf-8' \
--data-binary @- <<'XML'
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiBanklineExists>
<!-- <BankText01>Max Mustermann</BankText01> -->
<!-- <BankText02>Rechnung 2024-10045</BankText02> -->
<!-- <BankText03>DE89370400440532013000</BankText03> -->
<!-- <BankAmount>149.90</BankAmount> -->
</ns1:pixiBanklineExists>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML
<?php
$soapClient = new SoapClient(null, [
'login' => 'USERNAME',
'password' => 'PASSWORD',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
]);
$arguments = [
// 'BankText01' => 'Max Mustermann',
// 'BankText02' => 'Rechnung 2024-10045',
// 'BankText03' => 'DE89370400440532013000',
// 'BankAmount' => '149.90',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiBanklineExists', $soapArguments);
- SQL object:
- dbo.pipiBanklineExists