reuben12 has asked for the wisdom of the Perl Monks concerning the following question:
For i=0 to 5
do
Get row of ouput from isql
$lname$i=<extract first column>
$fname$i=<extract second column>
Go to next row of output from isql
done
These variables i use to query database in later part of the script.
Is it possible? I have done it in ksh but am very new to perl.I know how to open a file,write query to it and execute using isql through perl. I just dont know how to implement the above pseudo code.
Can somebody please help??Thanks..
I'm afraid i have no idea what DBI is but i guess its sort of extension to perl that i need to install. I cant be sure that i can get it installed in customer place. But normal isql seems to solve my problem.
After getting these data i need to create a view on sybase server and then bcp out the data. I have written the perl script for it and it is working fine but for a fixed number of inputs.
The fname,lname form part of the WHERE clause of the query. How can i write SQL statement to create view with variable number of conditions in WHERE clause
CREATE VIEW cust_view AS select * from customer where fname='AAAA' AND fname='BBBB' AND ...
How do i handle this assuming i have all the 'fnames' in an array and so know the count of array elements.??
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to parse output from isql utility
by Joost (Canon) on Jul 26, 2004 at 22:36 UTC | |
|
Re: how to parse output from isql utility
by graff (Chancellor) on Jul 27, 2004 at 01:33 UTC | |
|
Re: how to parse output from isql utility
by mpeppler (Vicar) on Jul 27, 2004 at 06:28 UTC | |
|
Re: how to parse output from isql utility
by Plankton (Vicar) on Jul 26, 2004 at 22:39 UTC | |
|
Re: how to parse output from isql utility
by naChoZ (Curate) on Jul 27, 2004 at 00:34 UTC | |
|
Re: how to parse output from isql utility
by periapt (Hermit) on Jul 27, 2004 at 12:17 UTC |