| 1 | # ABSTRACT SQL Simple Operations Commands | ||
| 2 | # | ||
| 3 | ## LICENSE AND COPYRIGHT | ||
| 4 | # | ||
| 5 | ## Copyright (C) Carlos Celso | ||
| 6 | # | ||
| 7 | ## This program is free software: you can redistribute it and/or modify | ||
| 8 | ## it under the terms of the GNU General Public License as published by | ||
| 9 | ## the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ## (at your option) any later version. | ||
| 11 | # | ||
| 12 | ## This program is distributed in the hope that it will be useful, | ||
| 13 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ## GNU General Public License for more details. | ||
| 16 | # | ||
| 17 | ## You should have received a copy of the GNU General Public License | ||
| 18 | ## along with this program. If not, see L<http://www.gnu.org/licenses/>. | ||
| 19 | # | ||
| 20 | |||
| 21 | ## THIS FILE IS ALPHA VERSION -- DO NOT USE IN PRODUCTION | ||
| 22 | ## THIS FILE IS ALPHA VERSION -- DO NOT USE IN PRODUCTION | ||
| 23 | ## THIS FILE IS ALPHA VERSION -- DO NOT USE IN PRODUCTION | ||
| 24 | |||
| 25 | package SQL::SimpleOps::DBI::ODBC; | ||
| 26 | |||
| 27 | use 5.006001; | ||
| 28 | use strict; | ||
| 29 | use warnings; | ||
| 30 | use Exporter; | ||
| 31 | |||
| 32 | our @ISA = qw ( Exporter ); | ||
| 33 | |||
| 34 | our @EXPORT = qw(new Open $VERSION); | ||
| 35 | |||
| 36 | our $VERSION = "2023.284.1"; | ||
| 37 | |||
| 38 | our @EXPORT_OK = @EXPORT; | ||
| 39 | |||
| 40 | our %EXPORT_TAGS = ( all => [@EXPORT_OK] ); | ||
| 41 | 1; | ||
| 42 | |||
| 43 | ############################################################################### | ||
| 44 | ## plugin initialization | ||
| 45 | |||
| 46 | sub new() | ||
| 47 | { | ||
| 48 | my $class = shift; $class = ref($class) || $class || 'SQL::SimpleOps::DBI::ODBC'; | ||
| 49 | my $self = {@_}; | ||
| 50 | |||
| 51 | $self->{sql_simple}->{init}{plugin_id} = "ODBC"; | ||
| 52 | $self->{sql_simple}->{init}{schema} = 1; | ||
| 53 | $self->{sql_simple}->{init}{test_server} = 0; | ||
| 54 | $self->{sql_simple}->{init}{alias_with_as} = 0; | ||
| 55 | |||
| 56 | bless($self,$class); | ||
| 57 | } | ||
| 58 | |||
| 59 | ############################################################################### | ||
| 60 | ## initialize here the dsname by: | ||
| 61 | # | ||
| 62 | ## All methods can be executed using the format: | ||
| 63 | # $self_sql_simple->[method_name](); | ||
| 64 | # | ||
| 65 | ## return codes: | ||
| 66 | ## rc=0 ok, continue | ||
| 67 | ## rc<1 syntax, abort | ||
| 68 | ## rc=1 error, abort | ||
| 69 | ## rc=2 ok, ignore caller | ||
| 70 | |||
| 71 | sub Open() | ||
| 72 | { | ||
| 73 | my $self = shift; | ||
| 74 | my $argv = shift; | ||
| 75 | |||
| 76 | ## sets the dsnam here | ||
| 77 | my @options; | ||
| 78 | $self->{sql_simple}->{argv}{dsname} = "DBI:ODBC:DSN=".$self->{sql_simple}->{argv}{db}; | ||
| 79 | |||
| 80 | return 0; | ||
| 81 | } | ||
| 82 | |||
| 83 | __END__ |