PERL CGI drop down list

2006-06-16 Thread Mark Martin
Hi, does anybody have the correct syntax for using a drop down list. I'm using the object oriented type syntax for CGI. For example my text boxes are printed thus : $cgi = new CGI; print $cgi->input({-type=>"text",-name=>"textbox01",-class=>"textbox"}) drop down list innormal html would be :

regex for date "dd-mmm-yy"

2006-06-06 Thread Mark Martin
Hi, would anybody have to hand a regex for date "dd-mmm-yy". I want to be able to validate dates that should be along the lines of : 06-jan-06 Cheers. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

CGI - Tables and Stylesheet

2006-05-02 Thread Mark Martin
Hi, I'm new to stylesheets - currently my html report picks the style for a table from the stylesheet but I have a number of table printing on my html report and I'd like to format each differently. here's the table code : print table({-border=>undef}, Tr({-align=>CENTER,-valign=>TOP

Comparing an array with hash keys

2005-09-30 Thread Mark Martin
Hi, I want to compare the elements of an array with the keys in a hash. If matches are found, I want to store the values associated with the matched keys in an array for future processing : my @storage_array = (); foreach $item(@original array) {

MIME::Lite HTML email

2005-05-14 Thread Mark Martin
Hi, why do I get the following in the body of my email when I use MIME::Lite to send a html formatted email and how can I get rid of it: Content-type: text/html Content-transfer-encoding: binary Content-disposition: inline Content-length: 155 Thanks, Mark -- To unsubscribe, e-mail: [EMAIL PROTECT

grouping mechanism

2005-05-11 Thread Mark Martin
HI, I want to provide remittance slips to my suppliers. I've extracted data from my payments database and pushed records into an array. Here is a sample of data from that array : 01,supplierA,100.00,1st May 2005 02,supplierB,100.00,3rd May 2005 03,supplierC,100.00,3rd May 2005 04,supplierA,100.0

RE: Different key in 2 hashes

2005-02-01 Thread Mark Martin
Thank you - worked a treat. At 09:00 01/02/2005 -0500, Bob Showalter wrote: Mark Martin wrote: > Hi, > okay - straight out of the coobook : > > my @different = () > foreach (keys %hash1) > { >delete $hash1{$_} unless exists $hash2$_}; >push(@this_not_that,$_) u

Different key in 2 hashes

2005-02-01 Thread Mark Martin
Hi, okay - straight out of the coobook : my @different = () foreach (keys %hash1) { delete $hash1{$_} unless exists $hash2$_}; push(@this_not_that,$_) unless exists $registered{$_}; } easy to remove the different key from hash one and record the removed item in @different. My question is how

no rows selected

2005-01-28 Thread Mark Martin
Hi, I'm running a test to see whether certain criteria in a SELECT statement return record or not. If I get a "no rows selected" from SQL then I want to perform a specific action . But I don't how perform the test for "no rows selected " ? $sql = qq{SELECT RECORD FROM TABLE WHERE FIELD = ? } ;

Re: Array with unique elements only

2004-05-21 Thread Mark Martin
Thanks Ramprasad - that works. At 17:29 20/05/2004 +0530, Ramprasad A Padmanabhan wrote: Wow, unique items is surely an FAQ. But here you dont need to filter the array, just see the answer inline On Thu, 2004-05-20 at 17:07, Mark Martin wrote: > Hi, > I'm moving database data from tab

Array with unique elements only

2004-05-20 Thread Mark Martin
Hi, I'm moving database data from table to table and want to make sure I'm getting only unique records. Only want unique $field1 and was looking at the cookbook code, but for that I have to populate a hash and then re-inspect through before inserting uniques, something like : %ucnt = (); while

Load a CSV / Excel File into a database table

2004-04-15 Thread Mark Martin
Hi I've thrown this query at the mailing list before but I'm still stuck I'm afraid. I have an Excel file with a worksheet that looks like: A BC D - 1¦ STUD_ID GEOG MATH 2¦1

My DBI script wont UPDATE a Table!

2004-04-02 Thread Mark Martin
Hi, I designed my application on a test database and it worked fine without commiting the database handle. But now when I've moved it to the production database my updates wont commit - even when I do issue a commit on the DBH?!?! while(certain condition) { $s

Re: DBI, DBD question

2004-03-16 Thread Mark Martin
Pretty new to PPM myself but I have gotten DBD and DBI working fine on ActiveState for windows through it. PPM does take a bit of tricking around and I've found you are much better off creating local repositories. Here's 'tips n tricks' sheet that may help. - Original Message - From: "Ran

DBI - an easier way??

2004-03-10 Thread Mark Martin
Hi, bin using DBI for a while for data warehousing type stuff and up till now I've had to change data on the fly as it moves from one database to another : my $sql01 = qq{SELECT FIELD01 .FIELDn FROM PRODUCTION_TABLE}; my $sql02 = qq{INSERT INTO ACC_LEDG VALUES (?,?,?); my $sth =

problems parsing web form information into a perl script

2004-03-03 Thread Mark Martin
Hi, I've got a web form that allows a user to browse to an excel file on their computer and input it and the year as parameters to run a perl script FORM : SCRIPT: use CGI; use Spreadsheet::ParseExcel; $q=new CGI; my $oExcel = new Spreadsheet::ParseExcel; my $user_ssheet=$q->param('file');

Re: Uploading a CSV file to a Database Table

2004-02-04 Thread Mark Martin
-\n\n"; } } but I'm still left with problem of isolating the column and row headers so that I can load it to the DB correctly i.e. update record with value from cell blahblah where cost_centre (column 0 values) = blahblah and cost_item

Uploading a CSV file to a Database Table

2004-02-04 Thread Mark Martin
I'm pulling my hair out trying to find out how to upload this data. My files can vary in numbers of rows and columns but the x and y axis always contain the same type of metadata - in my case cost centre and cost item. A sample of the data would look like : cost_centre,stationery,postage,furnitu

Dump Excel File to Database table

2004-01-26 Thread Mark Martin
Hi, I've got my "Spreadsheet::ParseExcel" module and I can parse it using the "Linux example: parsing" from Teodor Zlatanov at http://www-106.ibm.com/developerworks/linux/library/l-pexcel/ but I'm not sure how it works. I need to upload an Excel Sheet to a database table and I'm having troubl

Re: DBI and Unique Keys

2003-06-04 Thread Mark Martin
Bob, thanks! That worked fine. Went with no. 2 . No, those are not the original table and column names. Thanks again for takin the time. Mark - Original Message - From: "Bob Showalter" <[EMAIL PROTECTED]> To: "'Mark Martin'" <[EMAIL PROTECTED]>;

Re: DBI and Unique Keys

2003-06-03 Thread Mark Martin
gt;prepare($sql2) or die "Can't prepare SQL statement: $DBI::errstr\n"; $sth2->execute($var1,$var2$var10) or print "WARNING: Can't execute SQL statement 2: $DBI::errstr\n"; } $dbh1 ->disconnect(); $dbh2 ->disconn

DBI and Unique Keys

2003-05-31 Thread Mark Martin
Hi, I have an Oracle table with a Unique Key which is generated by a trigger : CREATE TRIGGER MYTRIGGER before insert on MYTABLE for each row begin select MYSEQUENCE.nextval into :new.MYCOLUMNAME from dual; end; And this works fine on normal insert When I try to insert from a perl script I get

Re: Content-type: text/html

2003-05-27 Thread Mark Martin
gt; anywhere? > > > On Tuesday, May 27, 2003, at 10:27 AM, Mark Martin wrote: > > > but when processeed the resulting html doc actually prints > > Content-Type: text/html; charset=ISO-8859-1 OR Content-type: text/html > > at the start of the page. Is

DBI script won't run as cron job

2002-08-29 Thread Mark Martin
I'm concious that this might be a Linux problem but maybe someone on the list has had the same issue and solved it. I copied out below one of the simplest functions from a perl script that I need to schedule every day. When I run it interactively the table truncates fine and I get all the print s

Fianacial Julian Dates

2002-01-17 Thread Mark Martin
Hi, I'm trying to use the Time::JulianDay module to work with Julian Dates. However the dates are in a Financial system where today - 17/01/02 is represented by the Julian Date 102017. Any Julian Date calendee though will tell you today is 2452291.5 I'm lost - does anybodsy have any ideas? Mark

UNIQUE KEY

2002-01-15 Thread Mark Martin
Hi, I'm trying to maintain a unique key in an Oracle Table while working on the table using DBI. the unique key is just a no. read in from a txt file and incremented for each record - supposedly. In fact I'm getting unique constraint violation. Can anybody tell me what is wrong with this code,(the

"BETWEEN" Comparison Operator

2001-10-18 Thread Mark Martin
tr\n"; } I can only seem to do this with 2 conditional statements(IF & ELSIF) and the action repeated. What I want is a "Between" operator for the range -10 to 10. Any ideas, Mark _ Mark Martin Computer Centre National Un

Newbie Deleting Table Records Problem

2001-07-10 Thread Mark Martin
32. Cheers - Mark _____ Mark Martin Computer Centre National University of Ireland Maynooth Tel: (01)708 4716/3830 Fax: (01)628 6249

Substitution Problem

2001-06-08 Thread Mark Martin
lear as Mud?? Any ideas? open (FILEHANDLE,$file); while (){ chomp; ($type,$doc,$narrative,$amount,$bdate,$branch) = split(/,/); if ($doc == " "){ doc =~ s/ /11/; ___

DBI and MS Access????

2001-05-14 Thread Mark Martin
ss DB : $dbh1 = DBI->connect( "dbi:??:??", "username", "password" ) . Do I need some software for this? Cheers, Mark _____ Mark Martin Computer Centre National University of Ireland Maynooth Tel: (01)708 4716/3830 Fax: (01)628 6249

"foreach" Trouble

2001-05-11 Thread Mark Martin
te stamp isn't found and the foreach loop never entered. Any Ideas? Mark _ Mark Martin Computer Centre National University of Ireland Maynooth Tel: (01)708 4716/3830 Fax: (01)628 6249

IF statements

2001-05-01 Thread Mark Martin
orten that to if (variable == "02" OR "03" OR "08"){ .etc I think what I need is something called a case. but I can't find the syntax anywhere. Cheers. _ Mark Martin Computer Centre National University of Ireland Maynooth Tel: (01)708 4716/3830 Fax: (01)628 6249

Date stamping files

2001-05-01 Thread Mark Martin
RE ??? $b = "filename.$a.txt"; # NOT SO SURE ABOUT THIS EITHER??? open (OUT2,">$b"); Thanks a lot! _____ Mark Martin Computer Centre National University of Ireland Maynooth Tel: (01)708 4716/3830 Fax: (01)628 6249

Problem Binding Variables : DBI

2001-04-26 Thread Mark Martin
$sth2->execute(); } close (FILE2); _ Mark Martin Computer Centre National University of Ireland Maynooth Tel: (01)708 4716/3830 Fax: (01)628 6249

Am I asking too much????

2001-04-24 Thread Mark Martin
chingcheques3.pl line 123, chunk 7. _____ Mark Martin Computer Centre National University of Ireland Maynooth Tel: (01)708 4716/3830 Fax: (01)628 6249

DBI and ORACLE

2001-04-20 Thread Mark Martin
h variables from the csv file. I'll probably create those with a simple split. any ideas? Mark _____ Mark Martin Computer Centre National University of Ireland Maynooth Tel: (01)708 4716/3830 Fax: (01)628 6249

Removing Leading Zeros

2001-04-19 Thread Mark Martin
Hi all, I have sucked two substrings into two variables : $index = substr $_, 35, 11; $value = substr $_, 64, 6; These variables may or may not have leading zero/s : 09/99/000999and so on. If they do I need to strip away the leading zeros. Any ideas? Mark

Removing Leading Zeros

2001-04-19 Thread Mark Martin
Hi all, I have sucked two substrings into two variables : $index = substr $_, 35, 11; $value = substr $_, 64, 6; These variables may or may not have leading zero/s : 09/99/000999and so on. If they do I need to strip away the leading zeros. Any ideas? Mark