If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Perl and the DBI > Where does he get the data???

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-09-06, 08:46
sge sge is offline
Registered User
 
Join Date: Jun 2006
Posts: 14
Where does he get the data???

Hello,

I came into an old perl program... I know, what it should do - but I donīt know how it works... (my first contact with perl)

It fills in a query file and the result is a report of a db-table.
Here a part of the prog:

#!/usr/bin/perl
use CGI qw(:standard);
# declaration
my ($sd,$datum,$pa,@sa02,...)
$datum='09.06.2006'
$sd="/sciptdir";
$pa="./pa.cgi";

`"$sd"/ABGL 02 "$datum" > "$sd"/erg02`;
@sa02=`"$pa" "$sd"/erg02`
:
for ($i=0;$i<$laenge;$i++){
foreach $i (@spalte){
print $sa02[$i];
:
:

The file ABGL looks like this:

echo "Number[_arg0,1]="
echo "Type[_arg3,1]="$1
echo "Date[_arg9,0]="$2
echo "_disp=3"
echo "Tour[_arg4,1]="

The output at the end contains columns like
zipcode,number,type,company,name,...

The source must be one of the db-tables, but how can I see, what he really accesses???
Are there any other files for configuration?

Does anyone understand my problem? Can anyone explain this prog to me???

Thanks in advance!
sabine
Reply With Quote
  #2 (permalink)  
Old 06-09-06, 13:50
KevinADC KevinADC is offline
Registered User
 
Join Date: Feb 2006
Posts: 56
looks like this script is doing all the work: pa.cgi

@sa02=`"$pa" "$sd"/erg02`

the backtiks `` are used to run a program and capture the output that is generated.

I'm not sure what this line is doing specifcally:

`"$sd"/ABGL 02 "$datum" > "$sd"/erg02`;

running some type of system command, maybe you know what that line is doing. It has to run first before the above line.
Reply With Quote
  #3 (permalink)  
Old 06-12-06, 03:12
sge sge is offline
Registered User
 
Join Date: Jun 2006
Posts: 14
`"$sd"/ABGL 02 "$datum" > "$sd"/erg02`;

This line seems to start the queryfile ABGL with the parameters 02 and "$datum" and writes the result into the file erg02. But what table or data does this query use? There is no hint (or only I canīt see it...) in the code. Something like table= or db= or ... donīt know, how it must look like in Perl...

@sa02=`pa.cgi "$sd"/erg02`
This line is only to list the result file erg02 into the array sa02 (?)
Reply With Quote
  #4 (permalink)  
Old 06-12-06, 04:13
KevinADC KevinADC is offline
Registered User
 
Join Date: Feb 2006
Posts: 56
Quote:
Originally Posted by sge
`"$sd"/ABGL 02 "$datum" > "$sd"/erg02`;

This line seems to start the queryfile ABGL with the parameters 02 and "$datum" and writes the result into the file erg02. But what table or data does this query use? There is no hint (or only I canīt see it...) in the code. Something like table= or db= or ... donīt know, how it must look like in Perl...

@sa02=`pa.cgi "$sd"/erg02`
This line is only to list the result file erg02 into the array sa02 (?)

I don't even know what ABGL is so I have no clue. Yes the last line appears to do what you think it does.

Do you have access to pa.cgi source code?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On