open(IN,"input_file") or die "Can't open Input file.\n";
while (<IN>) {
chomp;
$line = $_;
if($line != '') {
print "\nprocessing $line\n";
$size = 0;
$hrid = $line;
@project_id_array = null;
$size = @project_id_array;
$query1 = $dbh->prepare("select project_tb.project_id from project_tb JOIN
project_event_tb ON project_tb.project_id=project_event_tb.project_id
where ((project_tb.created_by = ? or PROJECT_EVENT_TB.owner_id = ? )
and project_tb.PROJ_STATUS not in ('Complete','Cancelled'))");
$query1->execute($hrid,$hrid);
while ( ($project_id) = $query1->fetchrow_array() )
{
push @project_id_array, $project_id;
}
$size = @project_id_array - 1;
print "$size \n";
if($size == 0)
{
print "This user $hrid doesn't have any project with 'Open' status. Need to check more...\n";
}
i am getting this error
Code:
Started assign users process: Mon Dec 27 06:57:18 EST 2010
==== CONNECTED TO AS USER ====
Connected to Database as user : Mon Dec 27 06:57:19 EST 2010
processing 7770030
DBD::Oracle::st execute failed: ORA-01008: not all variables bound (DBD ERROR: OCIStmtExecute) [for Statement "select project_tb.project_id from project_tb JOIN
project_event_tb ON project_tb.project_id=project_event_tb.project_id
where ((project_tb.created_by = ? or PROJECT_EVENT_TB.owner_id = ? )
and project_tb.PROJ_STATUS not in ('Complete','Cancelled'))" with ParamValues: :p1=7770030, :p2=7770030] at projnew.pl line 42, <IN> line 1.
Last edited by pludi; 12-27-2010 at 08:48 AM..
Reason: code tags, please...
Hey everyone ...
I wanted to process the contents of a file, as in modify its contents. whats the best way to do it on perl? In more detail I hav to go through the contents of the file, match patterns n then modify the contents of the same file depending on the matching results. Any help is... (2 Replies)
Aim:
To scan a file and ignore all characters that has an ASCII value from 0 to 31 and 127 to 255 and accept only those characters having an ASCII between 32 and 126.
Script:
#!/usr/local/bin/perl
$filename = "$ARGV";
if (-e $filename)
{
open(OUT, "${filename}") || die "can't... (10 Replies)
I need a script to process a huge single line text file:
The sample of the text is:
"forward_inline_item": "Inline", "options_region_Australia": "Australia", "server_event_err_msg": "There was an error attempting to save", "Token": "Yes", "family": "Family","pwd_login_tab": "Enter Your... (1 Reply)
I am new to perl, and need a script to pull a CSV file, strip out 2 leading columns, and 2 ending columns, and resave the file in a new location. The file is basic and has less than 10,000 records. Secondly, can I schedule perl scripts to run daily? Can someone provide the basic script to... (1 Reply)
Qspace ABC
Queue doCol: true
Queue order: fifo
Queue setCol: red
Queue order: fifo
Qspace XYZ
Queue getCol: true
Queue order: fifo
I need to append every line in this file with Qspace & Queue, so that final o/p shall look like this,
Qspace: ABC Queue: doCol
Qspace: ABC Queue: doCol... (2 Replies)
Hi everyone,
I have Xml files in a folder, I need to extract some attribute values form xml files and store in a hash. My xml file look like this.
<?xml version="1.0" encoding="UTF-8"?>
<Servicelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"... (0 Replies)
HI All,
I have scenerio where I need to call sub modules through for loop
for (i=0; i<30 ;i++)
{
..
..
..
subroutine 1;
subroutine 2;
}
I want this to be run in parallel
process1
{
...
...
subroutine 1;
subroutine 2; (0 Replies)
I have following result.log file (always has 2 lines) which I need to process,
cat result.log
name.cmd.method,"result","abc","xyz";
name="hello,mine.12345,"&"tree"&" xyz "&" tree "&" xyz",
data="way,"&" 1"&"rate-me"&"1"&"rate-me",str="",ret="";
now I need to extract the strings/data as... (4 Replies)
Hello,
I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this :
This is the output of ls command : I stored the output in a file filelist
1.1M... (5 Replies)
Discussion started by: ajayram
5 Replies
LEARN ABOUT DEBIAN
dbix::compat
Compat(3pm) User Contributed Perl Documentation Compat(3pm)NAME
DBIx::Compat - Perl extension for Compatibility Infos about DBD Drivers
SYNOPSIS
use DBIx::Compat;
my $HaveTypes = DBIx::Compat::GetItem ($drv, 'HaveTypes') ;
DESCRIPTION
DBIx::Compat contains a hash which gives information about DBD drivers, to allow to write driver independent programs.
Currently there are the following attributes defined:
ListFields
A function which will return information about all fields of an table. Needs an database handle and a tablename as argument. Must at
least return the fieldnames and the fieldtypes.
Example:
$ListFields = $DBIx::Compat::Compat{$Driver}{ListFields} ;
$sth = &{$ListFields}($DBHandle, $Table) or die "Cannot list fields" ;
@{ $sth -> {NAME} } ; # array of fieldnames
@{ $sth -> {TYPE} } ; # array of filedtypes
$sth -> finish ;
ListTables
A function which will return an array of all tables of the datasource. Defaults to $dbh -> "tables".
NumericTypes
Hash which contains one entry for all datatypes that are numeric.
SupportJoin
Set to true if the DBMS supports joins (select with multiple tables)
SupportSQLJoin
Set to 1 if the DBMS supports INNER/LEFT/RIGHT JOIN Syntax in SQL select. Set to 2 if DBMS needs a *= b syntax for inner join (MS-SQL,
Sybase). Set to 3 if DBMS needs a = b (+) syntax for inner join (Oracle syntax).
SQLJoinOnly2Tabs
Set to true if DBMS can only support two tables in inner joins.
HaveTypes
Set to true if DBMS supports datatypes (most DBMS will do)
NeedNullInCreate
Set to 'NULL' if DBMS requires the NULL keyword when creating tables where fields should contains nulls.
EmptyIsNull
Set to true if an empty string ('') and NULL is the same for the DBMS.
LimitOffset
An function which will be used to create a SQL text for limiting the number of fetched rows and selecting the starting row in selects.
Keys that aren't needed anymore
Placeholders
Gives information if and how placeholders are supported:
0 = Not supported
1 = Supported, but not fully, unknown how much
2 = Supported, but perl type must be the same as type in db
3 = Supported, but can not give a string when a numeric type is in the db
10 = Supported under all circumstances
QuoteTypes
Gives information which datatypes must be quoted when passed literal (not via a placeholder). Contains a hash with all type number which
need to be quoted.
$DBIx::Compat::Compat{$Driver}{QuoteTypes}{$Type}
will be true when the type in $Type for the driver $Driver must be quoted.
Supported Drivers
Currently there are entry for
DBD::mSQL
DBD::mysql
DBD::Pg
DBD::Solid
DBD::ODBC
DBD::CSV
DBD::Oracle
DBD::Sysbase
DBD::Informix
if you detect an error in the definition or add an definition for a new DBD driver, please mail it to the author.
AUTHOR
G.Richter <richter*dev.ecos.de>
SEE ALSO perl(1), DBI(3), DBIx::Recordset(3)perl v5.10.1 2010-03-05 Compat(3pm)