I would like to use the result of a query in another query. How do I redirect/add the output to another variable?
$result = odbc_exec($connect, $query);
while ($row = odbc_fetch_array($result)) {
echo $row,"\n";
}
odbc_close($connect);
?>
This will output hostnames:
host1... (0 Replies)
I am trying to query a list of hosts and extract all entries which 'dont' match.
SELECT LOGS.host, GOODLIST.host FROM LOGS,db.GOODLIST WHERE (LOGS.host <> GOODLIST.host)When I use this query, it is very very slow. Matching the host with the GOODLIST.host works great and fast but when I use <>... (1 Reply)
Hi,
I have a requirement as below which needs to be done viz UNIX shell script
(1) I have to connect to an Oracle database
(2) Exexute "SELECT field_status from table 1" query on one of the tables.
(3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
I know little SQL and could really use a hand here. I need to get the fields last_name, first_name and email from the table users and only if the entery with the same pkey in the table addresses, in the city column is Seattle.
So if the city in the addresses table is Seattle, go to the table... (2 Replies)
Hi,
I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database.
For instance:
USER CITY
--------- ----------
A CITY_A
B CITY_B
C ... (2 Replies)
not getting anywhere with this
an xml file contains multiple clients set up with same tags, different values.
I need to parse the file for client foo, and change the value of tag "64bit" from false to true.
cat clients.xml
<Client type"FIX">
<ClientName>foo</ClientName>... (3 Replies)
Hello All,
I have a requirement in which i will be given a sql query as input in a file with dynamic number of columns. For example some times i will get 5 columns, some times 8 columns etc up to 20 columns.
So my requirement is to generate a output query which will have 20 columns all the... (7 Replies)
I am trying to create a cronjob that will run on startup that will look at a list.txt file to see if there is a later version of a database using database.txt as the source. The matching lines are written to output.
$1 in database.txt will be in list.txt as a partial match. $2 of database.txt... (2 Replies)
In the awk below I am trying to output those lines that Match between file1 and file2, those Missing in file1, and those missing in file2. Using each $1,$2,$4,$5 value as a key to match on, that is if those 4 fields are found in both files the match, but if those 4 fields are not found then missing... (0 Replies)
Hi,
i have 2 files , the data i need to match is in masterfile and i need to pull out column 3 from master if column 1 and 2 match and output entire row to new file
I have tried with join and awk and i keep getting blank outputs or same file
is there an easier way than what i am... (4 Replies)
Discussion started by: axis88
4 Replies
LEARN ABOUT DEBIAN
business::tax::vat::validation
Business::Tax::VAT::Validation(3pm) User Contributed Perl Documentation Business::Tax::VAT::Validation(3pm)NAME
Business::Tax::VAT::Validation - A class for european VAT numbers validation.
SYNOPSIS
use Business::Tax::VAT::Validation;
my $hvatn=Business::Tax::VAT::Validation->new();
# Check number
if ($hvatn->check($VAT, [$member_state])){
print "OK
";
} else {
print $hvatn->get_last_error;
}
DESCRIPTION
This class provides an easy api to check european VAT numbers' syntax, and if they has been registered by the competent authorities.
It asks the EU database (VIES) for this, using its SOAP interface methods.
CONSTRUCTOR
new Class constructor.
$hvatn=Business::Tax::VAT::Validation->new();
If your system is located behind a proxy :
$hvatn=Business::Tax::VAT::Validation->new(-proxy => ['http', 'http://example.com:8001/']);
Note : See LWP::UserAgent for proxy options.
PROPERTIES
member_states Returns all member states 2-digit codes as array
@ms=$hvatn->member_states;
regular_expressions - Returns a hash list containing one regular expression for each country
If you want to test a VAT number format ouside this module, e.g. embedded as javascript in a web form.
%re=$hvatn->regular_expressions;
returns
(
AT => 'U[0-9]{8}',
...
SK => '[0-9]{10}',
);
METHODS
check - Checks if a VAT number exists in the VIES database
$ok=$hvatn->check($vatNumber, [$countryCode]);
You may either provide the VAT number under its complete form (e.g. BE-123456789, BE123456789) or specify the VAT and MSC (vatNumber
and countryCode) individually.
Valid MS values are :
AT, BE, BG, CY, CZ, DE, DK, EE, EL, ES,
FI, FR, GB, HU, IE, IT, LU, LT, LV, MT,
NL, PL, PT, RO, SE, SI, SK
local_check - Checks if a VAT number format is valid This method is based on regexps only and DOES NOT ask the VIES database
$ok=$hvatn->local_check($VAT, [$member_state]);
informations - Returns informations related to the last validated VAT number
%infos=$hvatn->informations();
get_last_error_code - Returns the last recorded error code
get_last_error - Returns the last recorded error
my $err = $hvatn->get_last_error_code();
my $txt = $hvatn->get_last_error();
Possible errors are :
o -1 The provided VAT number is valid.
o 0 Unknown MS code : Internal checkup failed (Specified Member State does not exist)
o 1 Invalid VAT number format : Internal checkup failed (bad syntax)
o 2 This VAT number doesn't exist in EU database : distant checkup
o 3 This VAT number contains errors : distant checkup
o 17 Time out connecting to the database : Temporary error when the connection to the database times out
o 18 Member Sevice Unavailable: The EU database is unable to reach the requested member's database.
o 19 The EU database is too busy.
o 20 Connexion to the VIES database failed.
o 21 The VIES interface failed to parse a stream. This error occurs unpredictabely, so you should retry your validation request.
o 257 Invalid response, please contact the author of this module. : This normally only happens if this software doesn't recognize
any valid pattern into the response document: this generally means that the database interface has been modified, and you'll make
the author happy by submitting the returned response !!!
o 500 The VIES server encountered an internal server error. Error 500 : soap:Server TIMEOUT Error 500 : soap:Server MS_UNAVAILABLE
If error_code > 16, you should temporarily accept the provided number, and periodically perform new checks until response is OK or
error < 17 If error_code > 256, you should temporarily accept the provided number, contact the author, and perform a new check when the
software is updated.
SEE ALSO
LWP::UserAgent
http://ec.europa.eu/taxation_customs/vies/faqvies.do for the FAQs related to the VIES service.
FEEDBACK
If you find this module useful, or have any comments, suggestions or improvements, feel free to let me know.
AUTHOR
Bernard Nauwelaerts <bpgn@cpan.org>
CREDITS
Many thanks to the following people, actively involved in the development of this software by submitting patches, bug reports, new members
regexps, VIES interface changes,... (sorted by last intervention) :
o Bart Heupers, Netherlands.
o Martin H. Sluka, noris network AG, Germany.
o Simon Williams, UK2 Limited, United Kingdom & BenoA~XAXt Galy, Greenacres, France & Raluca Boboia, Evozon, Romania
o Dave O., POBox, U.S.A.
o Kaloyan Iliev, Digital Systems, Bulgaria.
o Tom Kirkpatrick, Virus Bulletin, United Kingdom.
o Andy Wardley, individual, United Kingdom.
o Robert Alloway, Service Centre, United Kingdom.
o Torsten Mueller, Archesoft, Germany
LICENSE
GPL. Enjoy! See COPYING for further information on the GPL.
DISCLAIMER
See http://ec.europa.eu/taxation_customs/vies/viesdisc.do to known the limitations of the EU validation service.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
perl v5.14.2 2012-03-26 Business::Tax::VAT::Validation(3pm)