Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [TheStone] Table and Functions

Quote Reply
Re: [TheStone] Table and Functions In reply to
Ok... Now it is making a bit more sense. I understand the $info part now... makes sense. What does the "my $tags = GT::Template->tags;" do? I've seen that several places in the script.

Now when I do the script, as told, I get nothing back because It probably doesn't assign the return data to anything: <%Dbsql::custom::GetCarrier('000000')%>. So I modified it to be <%set Carrier = Dbsql::custom::GetCarrier('000000')%> in the template which should lookup the Primary Key (000000) in Table 'Patients' and return the data in the column called Carrier. (by the way, the database data DOES exist... I checked three times) But I just get a "blank" variable for 'Carrier'. I even tried getting the entire $info HASH but it still returns nothing. How do I debug whether there are any errors and or check to see if the database is indeed being accessed?

Original script:

Code:


sub GetCarrier {
#--------------------------------------------------------------------
# Lookup data in another database.
# $id = PK value
my $id = shift;
my $tags = GT::Template->tags;
my $info = $tags->{home}->{sql}->table('Patients')->get ('$id');
return $info->{'Carrier'};
}
Subject Author Views Date
Thread Table and Functions LanceWilson2 2896 Jan 5, 2003, 10:20 PM
Thread Re: [LanceWilson2] Table and Functions
604 2812 Jan 6, 2003, 10:28 AM
Thread Re: [TheStone] Table and Functions
LanceWilson2 2810 Jan 6, 2003, 12:54 PM
Thread Re: [LanceWilson2] Table and Functions
604 2808 Jan 6, 2003, 1:14 PM
Thread Re: [TheStone] Table and Functions
LanceWilson2 2809 Jan 6, 2003, 2:45 PM
Thread Re: [LanceWilson2] Table and Functions
604 2815 Jan 6, 2003, 2:52 PM
Post Re: [TheStone] Table and Functions
LanceWilson2 2803 Jan 6, 2003, 3:24 PM