PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "marc 'embee' borms" <marc at az dot vub dot ac dot be>
Subject: Re: HELP Dynamic Select
Date: Feb 19 1999 1:58PM

-----Original Message-----
From: Sofienne bahri 
>I use sybperl to connect to a sybase database. I have a form with 36
>fields. The user entrer some or all the fields and i have to make a
>query by example(a dynamic select) based on non null fields. How can i
>do this using sybperl.


Let 'myformfield' be the name of the field in the form that contains your
example data
Using a standard formparser (formparse.pl) you can write :

...
require "formparse.pl";
..
$ENV{SYBASE}="yoursybasepath";
...
$Query=sprintf('select * from mytable where field_entered = "%s"',
$FORM{'myformfield'});

($dbproc = new Sybase::DBlib $user, $passwd, $server ) or
    die "cannot connect to $server \n";
$dbproc->dbcmd($Query);
...

Hope this helps,
marc