Well ... this is for yet another DBIx module. Something that'd make calling MS SQL stored procedures (since that's all I want from my data access layer, thank you very much) very easy. I have finding the parameters of stored procedures and handling output parameters done, but I can't find a way to handle the optional parameters or even how to find which ones are optional :-(

The code currently goes somewhat like this:

package MyDB; use DBIx::LazyMethod::MSSQL; use vars qw(@ISA); @ISA = qw(DBIx::LazyMethod::MSSQL); sub new { my $class = shift; my $db = $class->SUPER::new( data_source => 'dbi:ODBC:jobodbc2', user => 'xxx', pass => 'xxx', attr => { PrintError => 0, RaiseError => 0, LongReadLen => 655 +36, 'AutoCommit' => 1 }, methods => { FetchUserInfo => { def => { adminid => 1 }, ret => '%', }, GetServerMailAddress => '$', GetFieldTitle => { def => {siteid => undef}, ret => '$' } }, ); return $db; } 1;
and then
use MyDB; my $db = MyDB->new(); print Dumper($db->FetchUserInfo(userid => '577')); my $email; $db->GetServerMailAddress(email => $email); print "\$email = $email\n"; my $title; $db->GetFieldTitle( fieldtype => 'I', fieldid => 11, fieldtitle => $ti +tle); print "\$title = $title\n";

If I could at least find out what parameters are optional and what are the default values I could just call the procedures with all parameters and pass those defaults, but I can't find a way to do that apart from parsing the SQL :-(

Jenda
XML sucks. Badly. SOAP on the other hand is the most powerfull vacuum pump ever invented.


In reply to Re^2: DBI->MS SQL, optional parameters to stored procedures by Jenda
in thread DBI->MS SQL, optional parameters to stored procedures by Jenda

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.