Sterin, Ilya (I.) [EMAIL PROTECTED] wrote:
> my $sth = $dbh->prepare("select .....");
> $sth->execute();
> 
> my $data = $sth->fetchrow_hashref();
> 
> my $list = $data->{'Col1'};

Just personal preference for naming variables what they
contain, but it might help Krisi understand what's going
on and how this works:

  my $row_hashref = $sth->fetchrow_hashref();
  $list = $row_hashref->{'ListID'}; #ListID is the column name
  $proj = $row_hashref->{'ProjID'}; #ProjID is the column name

HTH.
-- 
Hardy Merrill
Red Hat, Inc.

> 
> Ilya
> 
> -----Original Message-----
> From: Goodman Kristi - kgoodm [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 29, 2003 11:19 AM
> To: '[EMAIL PROTECTED]'
> Subject: New to DBI
> 
> 
> Hello!
> 
> I am a Win32::ODBC user and I am trying to convert to DBI.  However, I am
> having trouble trying to figure out how to do one thing.  How can you return
> a hash where you can assign the values returned to a variable.
> 
> 
> This is the code I have from using the WIN32::ODBC module and I would like
> to do the same thing using DBI.
> 
> $db1->Sql("SELECT * FROM WORKREQUEST WHERE (WRID = '$wrnum' )" );
> $db1->FetchRow();
> %db1hash = $db1->DataHash();
> $list         = $db1hash{'ListID'};  #ListID is the column name
> $proj         = $db1hash{'ProjID'}; #ProjID is the column name
> ect...
> 
> 
> 
> Can anyone help?  Please let me know if this is not a clear explanation on
> what I am trying to do.
> 
> Thanks!
> Kristi
> 
> 
> 
> 
> 
> 
> 
> 
> Kristi Goodman 
> Technical Support Specialist 
> AECMS, O/ITS
> Acxiom Corporation , Conway Campus

Reply via email to