Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Selecting Array data??

Quote Reply
Selecting Array data??
I have the following function in a DbMan SQL "custom.pm" file:

sub GetClaimData {
#--------------------------------------------------------------------
# Fetch a row of data in the Claims database.
#
my $tags = GT::Template->tags;
my $id = $tags->{ClaimID};
my $info = $tags->{home}->{sql}->table('Claims')->get ($id);

# I'm just playing here.
# if($info->{'InsuredID'} eq '') { my $info->{'InsuredID'} = $tags->{'InsuredID'}; }
# if I try this... this is what I get:
# Can't use an undefined value as a HASH reference at /home/www/html/code/admin/Dbsql/custom.pm line 65.

return $info;
}

The purpose of it is to grab an entire row of data for an SQL source.

Problem:

I want to evaluate one of the columns (InsuredID) in that row and see if it is blank (eg. equal to ''), if it is, then I want to replace it with an existing variable (eg. in this case $tags->InsuredID) My problem lies in that I do not know how to break apart $info and evaluate that column and the other part is how do I replace the new variable back into the $info data array?

Am I close with the playing around above??
Subject Author Views Date
Thread Selecting Array data?? LanceWilson2 2528 Feb 6, 2004, 11:23 AM
Thread Re: [LanceWilson2] Selecting Array data??
604 2456 Feb 6, 2004, 2:29 PM
Thread Re: [TheStone] Selecting Array data??
LanceWilson2 2459 Feb 6, 2004, 3:49 PM
Thread Re: [LanceWilson2] Selecting Array data??
604 2454 Feb 6, 2004, 4:34 PM
Post Re: [TheStone] Selecting Array data??
LanceWilson2 2449 Feb 7, 2004, 8:48 AM