[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

Can't load '/usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris/auto/DBD/Oracle/Oracle.so'

Asked by papfal in Perl Programming Language

Tags: Perl PHP Apache SOLARIS10

Hi,

I am having a problem when I try to run my script download.cgi even I'd never get error when i install and compiled perl and modules associated. My configuration is on SOLARIS10. I get this message :

Can't load '/usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: perl: fatal: libclntsh.so.9.0: open failed: No such file or directory at /usr/local/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line 230.
 at ./download.cgi line 18
Compilation failed in require at ./download.cgi line 18.
BEGIN failed--compilation aborted at ./download.cgi line 18.


I join the script in this message.

Thanks you for your reply
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
404:
405:
406:
407:
408:
409:
410:
411:
412:
413:
414:
415:
416:
417:
418:
419:
420:
421:
422:
423:
424:
425:
426:
427:
428:
429:
430:
431:
432:
433:
434:
435:
436:
437:
438:
439:
440:
441:
442:
443:
444:
445:
446:
447:
448:
449:
450:
451:
452:
453:
454:
455:
456:
457:
458:
459:
460:
461:
462:
463:
464:
465:
466:
467:
468:
469:
470:
471:
472:
473:
474:
475:
476:
477:
478:
479:
480:
481:
482:
483:
484:
485:
486:
487:
488:
489:
490:
491:
492:
493:
494:
495:
496:
497:
498:
499:
500:
501:
502:
503:
504:
505:
506:
507:
508:
509:
510:
511:
512:
513:
514:
515:
516:
517:
518:
519:
520:
521:
522:
523:
524:
525:
526:
527:
528:
529:
530:
531:
532:
533:
534:
535:
536:
537:
538:
539:
540:
541:
542:
543:
544:
545:
546:
547:
548:
549:
550:
551:
552:
553:
554:
555:
556:
557:
558:
559:
560:
561:
562:
563:
564:
565:
566:
567:
568:
569:
570:
571:
572:
#!/usr/local/bin/perl
#
#---------------------------------------------
#
# Integre e_sda
#
# Auteur : D.GABARD
# date : 27/09/2007
#
# integre une SDA a partir de l'outil e-sda
# V1.1 : creation
#
#---------------------------------------------
 
 
### Mise en place des library ###
use File::Copy;
use DBD::Oracle qw(:ora_types);
use CGI;
use CGI qw/:standard/;  
use DBI qw(:sql_types);
use lib '/u01/app/e_sda/exploit/sources';
use MIME::Lite;
use e_sda::e_sda;
use Spreadsheet::ParseExcel;
use Spreadsheet::ParseExcel::Utility qw(xls2csv);
 
 
### Definition des variables ###
@TIME=localtime(time);
my $HEURE="$TIME[2]h\_$TIME[1]m\_$TIME[0]s";
chomp ($DATE = `date '+le %d/%m/%Y'`);
undef @MESSAGE_SQL;
undef $GEM_SIMU,@MY_ERROR,@MY_EXEC,$COMPTEUR_FEUILLE;
$RAND=int(rand 1000);
 
my $dbh = DBI->connect("dbi:Oracle:$SID", $ORA_USER, $ORA_PASSWD, { RaiseError => 1, AutoCommit => 0 });
my $cgi = new CGI;
my $absolute_url  = $cgi->url(-absolute => 1);
 
print $cgi->header('text/html');
print $cgi->start_html(
        -title=>'[eSDA] telechargement d\'une SDA',
    -style => {'src' => ['/style/spinoza.css','/style/eSDA.css','/style/dhtmlwindow.css']},
        -bgcolor=>"",
        -leftmargin=>"3",
        -topmargin=>"3",
        -lang=>'fr-FR'
);
 
 
### Mise en place des parametres ###
       my $LIVRABLE  = $cgi->param('LIVRABLE');
	my $FICH_XLS = $cgi->param('uploaded_file');
 
 
### Extraction du projet ###
if ( $LIVRABLE )
{
$sql="select ID_PROJET,NOM,VERSION,GROUPE,DATE_PROJET,ID_WIC,TYPE_WIC from PROJET_SDA where ID_PROJET=$LIVRABLE";
my $sth =$dbh -> prepare ($sql) ;
my $rc = $sth -> execute ;
if ( $sth->err ) { $MESSAGE =$sth->err; @MESSAGE_SQL=@MESSAGE_SQL," ERR - $MESSAGE "; }
( $ID_PROJET,$NOM,$VERSION,$GROUPE,$DATE_PROJET,$ID_WIC,$TYPE_WIC ) = $dbh->selectrow_array($sql);
if  ( length($ID_PROJET) == 0 ) { $MESSAGE=$sth->err; @MESSAGE_SQL=(@MESSAGE_SQL," ERR - le projet $LIVRABLE n existe pas"); }
$rc  = $sth->finish;
}
 
 
 
### Construction de la page ###
print " <div id=historique STYLE='width: 204px; height: 56px;'><div class='drag-handle'>IMPORTER UNE SDA</div>";
print "<div class='drag-contentarea' style='height:76px'><div class='menu_item'> Projet : $ID_PROJET - $NOM - $VERSION</div>\n";
print "<div class='menu_item'>Groupe utilisateur : $GROUPE</div>\n";
print "<div class='menu_item'>Date creation : $DATE_PROJET</div>\n";
print "<div class='menu_item'>Type projet : $TYPE_WIC</div></div></div>\n";
print "<div class='sda_item'>";
 
### Download du fichier ###
 
if  ( ! $FICH_XLS )
{
print $cgi->start_multipart_form(-name=>"Tune");
print $cgi->hidden(-name=>'LIVRABLE', -default=>['$LIVRABLE']);
print "<br>Telecharger le fichier excel : <br>";
print $cgi->filefield({-name=>'uploaded_file', -size=>'61'});
print "<br>";
print $cgi->submit('check', 'check');
print $cgi->endform;
 
### TEMPO ###
$LIVRABLE=1;
$SIMU=Y;
}
else
{
#print "fichier : $FICH_XLS\n LIVRABLE :  $LIVRABLE ";
 
### upload du fichier excel ###
open (FDTMP, ">./tmp/tmpfile.xls");
$fh = $cgi->upload('uploaded_file');
binmode FDTMP;
while (<$fh>)
{
print FDTMP ;
}
close FDTMP;
 
### depecage du fichier excel ###
 
chdir "./tmp" or die "\n--- ERR : Impossible de se deplacer dans le repertoire temporaire ---\n";
$FICH_XLS="tmpfile.xls";
 
$oExcel = new Spreadsheet::ParseExcel;
$oBook = $oExcel->Parse($FICH_XLS);
 
my $oWkS;
foreach my $oWkS (@{$oBook->{Worksheet}}) {
$ORDRE ++;
($FEUILLE=$oWkS->{Name}) =~ s/ //g ;
if ( grep /Dates/,$FEUILLE) { $COMPTEUR_FEUILLE++; $DATES=(xls2csv( ${FICH_XLS}, "${ORDRE}-A1:AC200"))};
if ( grep /Appli/,$FEUILLE) { $COMPTEUR_FEUILLE++; $APPLI=(xls2csv( ${FICH_XLS}, "${ORDRE}-A1:AC200"))};
if ( grep /Traite/,$FEUILLE) { $COMPTEUR_FEUILLE++; $JOB=(xls2csv( ${FICH_XLS}, "${ORDRE}-A1:AC2000"))};
if ( grep /Ressources/,$FEUILLE) { $COMPTEUR_FEUILLE++; $RESSOU=(xls2csv( ${FICH_XLS}, "${ORDRE}-A1:AC200"))};
}
 
if ( $COMPTEUR_FEUILLE != 4 ) {
print "<br>";
print "<div class='sda_error'><font color=black>La E_SDA n\'est pas valide : 1 ou plusieurs des onglets date, application, job et associations ressources ne sont pas présents";
print "</div>";
print "<br> Telecharger le format standard e_sda : <a href=\"http://bt1sssne/vtom/E_SDA_STANDARD_v1.xls\">E_SDA STANDARD</a>";
exit;
}
 
 
@JOB=split /\n/,$JOB;
@APPLI=split /\n/,$APPLI;
@DATES=split /\n/,$DATES;
@RESSOU=split /\n/,$RESSOU;
 
### Relecture de la SDA ###
 
### MISE EN PAGE ###
@LECTURE="";
print "<br><b>--- Mode relecture de la SDA ---</b><br><br>";
print "\n --- Extraction des donnees du fichier excel ---\n";
undef @TEST_DATE;
undef @APPLI_RECENS; undef @JOB_RECENS;
 
# relecture page date #
print "<br>-> Relecture de la page date";
for $LIGNE (grep !/Action/,@DATES)
{
@LIGNE=split ';',$LIGNE;
if ( $LIGNE[0] =~ "Ajout" )     {
if ( grep /$LIGNE[1]/,@DAT_ENVIR ) { @LECTURE_WARNING=(@LECTURE,"\nC | DATE : $LIGNE[1] - Attention : la date est deja presente dans la base et dans l\'environnement $ENVIR -> Date : $LIGNE[1] - elle ne sera pas creee ! "); }
if ( grep /^[Ss]yst/,$LIGNE[2] ) { $LIGNE[2]=systeme; }
if ( grep /^[Aa]uto/,$LIGNE[2] ) { $LIGNE[2]=automatique; }
$DATE{$LIGNE[1]}=$LIGNE[2];
@DATE_REL=(@DATE_REL,$LIGNE[1]);
                                }
}
 
 
# relecture page application
undef $GEOM;
print "<br>-> Relecture de la page application\n";
foreach $LIGNE (@APPLI)
{
 
 
        @LIGNE=split ';',$LIGNE;
        if ( grep/Action/,$LIGNE[0] ) { if ( ! ( grep /[Aa]pplication/,$LIGNE[2]) and grep /[Dd]ate d/,$LIGNE[3] and grep /Heure de d\351but/,$LIGNE[4] and grep /Heure de fin/,$LIGNE[5] and grep /Mode d/,$LIGNE[6] and grep /Activation/,$LIGNE[7] and grep /Cyclique/,$LIGNE[8] and  grep /Cycle/,$LIGNE[7] and grep /[Uu]ser/,$LIGNE[11] and grep /[Mm]achine/,$LIGNE[12] ) {  @LECTURE_ERROR=(@LECTURE_ERROR,"L\'onglet Applications n\'est pas standard E_SDA "); last; } }
        if (  grep/^[Aa]jout$/,$LIGNE[0] or grep/^[Mm]odification$/,$LIGNE[0] and ! (grep /[Pp]oub/,$LIGNE[2]) )
        {
 
	### mise en plce de la geometrie
	$GEOM=$GEOM+50;
 
        if ( grep /[Ii]llim/,$LIGNE[5] ) { $LIGNE[5]=illimite; }
        undef $VALEUR{DUREE};
        $VALEUR{ACTION}=$LIGNE[0]; $VALEUR{ENVIR}=$LIGNE[1]; $VALEUR{APPLI}=$LIGNE[2]; $VALEUR{DATE}=$LIGNE[3]; $VALEUR{HEURE_DEBUT}=$LIGNE[4]; $VALEUR{HEURE_FIN}=$LIGNE[5]; $VALEUR{MODE_EXECUTION}=$LIGNE[6]; $VALEUR{CYCLIQUE}=$LIGNE[8]; $VALEUR{DUREE}=$LIGNE[9]; $VALEUR{USER}=$LIGNE[11]; $VALEUR{MACHINE}=$LIGNE[12]; $LIGNE[1]{DATE}=$LIGNE[3]; $LIGNE[1]{HEURE_DEBUT}=CONVERT_HEURE($LIGNE[4]); $LIGNE[1]{HEURE_FIN}=CONVERT_HEURE($LIGNE[5]);
 
        # Pour comparaison et reutilisation dans l onglet job
        $LIGNE[2]{DATE}=$TYPE_DATE{$LIGNE[1]};
        $LIGNE[2]{CYCLIQUE}=$LIGNE[8];
 
        # TEST sur les pre requis
 
        foreach $APPLI_RECENS (@APPLI_RECENS)
        {
        if ( grep /${APPLI_RECENS}/,$VALEUR{APPLI} ) { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - Cette application est ajoutee ou modifie plusieurs fois dans la SDA");} else { @APPLI_RECENS=(@APPLI_RECENS,$VALEUR{APPLI}); }
        }
 
        # Recherche par application
        foreach $OBJET ( keys %VALEUR )
        {
        if ( $OBJET =~ "HEURE_DEBUT" or $OBJET =~ "HEURE_FIN" or $OBJET =~ "DUREE" or $OBJET =~ "MODE_EXECUTION" ) { next ; }
        if ( grep /\ /,$VALEUR{$OBJET} ) { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - le champ $OBJET comporte un espace non permis");}
        if ( grep /\W\S/,$VALEUR{$OBJET} and ! ( grep /\:/,$VALEUR{$OBJET} ) and ! ( grep /\-/,$VALEUR{$OBJET} ) and ! ( grep /\351/,$VALEUR{$OBJET} ) ) { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - le champ $OBJET contient 1 caractere special"); }
        if ( length($VALEUR{$OBJET}) == 0 ) { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - le champ $OBJET n\'est pas rempli");}
        }
 
        if ( $VALEUR{MODE_EXECUTION} ) { if ( grep /riodique/,$VALEUR{MODE_EXECUTION} ) { $VALEUR{MODE_EXECUTION}="periodique"; }  if ( ! ( grep /riodique/,$VALEUR{MODE_EXECUTION} or grep /demande/,$VALEUR{MODE_EXECUTION} ) ) { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - le champ mode execution est mal rempli"); } } else { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - le champ mode execution n est pas rempli");  if ( grep /riodique/,$VALEUR{MODE_EXECUTION} ) { $VALEUR{MODE_EXECUTION}='periodique'; } }
 
        # Mise en place de la fonction de hachage pour comparaison date - job - appli
        $VALEUR{HEURE_DEBUT}=HEURE($LIGNE[4]); $VALEUR{HEURE_FIN}=HEURE($LIGNE[5]);
        if ( $VALEUR{DUREE} ) { $VALEUR{DUREE}=HEURE($VALEUR{DUREE}); }
        $LIGNE[2]{HEURE_DEBUT}=$LIGNE[4]; $LIGNE[2]{HEURE_FIN}=$LIGNE[5];
if ( ! ( grep /$LIGNE[2]/,@APPLI_REL )) { @APPLI_REL=(@APPLI_REL,$LIGNE[2]); }
if ( ! ( grep /$LIGNE[3]/,@DATE_REL )) { print "<br>Recherche type de date dans la base VTOM \n"; @DATE_REL=(@DATE_REL,$LIGNE[3]); 
 
### REQUETE SQL ###
$sql="select type from t_date_vtom where ID_DOMAINE in ($DOMAINE_PROD) and NOM='$LIGNE[3]'";
my $sth =$dbh -> prepare ($sql) ;
my $rc = $sth -> execute ;
if ( $sth->err ) { $MESSAGE =$sth->err; @MESSAGE_SQL=@MESSAGE_SQL," ERR - $MESSAGE "; }
( $TYPE_DATE{$LIGNE[2]} ) = $dbh->selectrow_array($sql);
}
 
### REQUETE SQL ###
$sql="select application from t_application a, t_environnement e where a.ID_DOMAINE in ($DOMAINE_PROD) and e.id_environnement_ora=a.id_environnement_ora and e.environnement='$LIGNE[1]' and application='$LIGNE[2]'";
my $sth =$dbh -> prepare ($sql) ;
my $rc = $sth -> execute ;
if ( $sth->err ) { $MESSAGE =$sth->err; @MESSAGE_SQL=@MESSAGE_SQL," ERR - $MESSAGE "; }
( @APP_BASE ) = $dbh->selectrow_array($sql);
 
###print " application base : @APP_BASE <br>";
 
 
        if ( grep/^[Mm]odification$/,$LIGNE[0] and ! ( grep /$LIGNE[2]/,@APP_BASE ) ) { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - Attention : l\'application a modifier n\'est pas presente dans la base et l`environnement $ENVIR - elle ne sera pas modifiee !"); }
        if ( length($VALEUR{APPLI})>16 ) { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - L\'application excede 16 caracteres "); }
        if ( $VALEUR{HEURE_DEBUT} !~ "[0-4][0-9]:[0-6][0-9]:[0-6][0-9]" ) { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - L\'Heure de debut n\'est pas une heure valide"); }
        if ( $VALEUR{HEURE_FIN} !~ "[0-4][0-9]:[0-6][0-9]:[0-6][0-9]" and ! (  grep /illimi/,$VALEUR{HEURE_FIN} )) { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - L\'Heure de fin n\'est pas une heure valide"); }
        if ( length($VALEUR{DUREE}) != 0 and $VALEUR{DUREE} !~ "[0-4][0-9]:[0-6][0-9]:[0-6][0-9]" ) { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - la dur\351e du cycle n\'est pas une heure valide"); }
        # pas d horaire illimite sur une appli cyclique
        if ( grep /[Oo]ui/,$VALEUR{CYCLIQUE} and grep /illimi/,$VALEUR{HEURE_FIN} ) { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - Un horaire illimite ne peut etre implemente dans une application cyclique"); }
        # pas d horaire illimte sur une date systeme
        if ( grep /illimi/,$VALEUR{HEURE_FIN} and grep /[Ss]yst/,$TYPE_DATE{$LIGNE[2]} ) { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - Un horair e illimite ne peut etre implemente sur une date systeme"); }
 
### insertion dans la base de donnees ##
if ( grep/^[Aa]jout$/,$LIGNE[0] or grep/^[Mm]odification$/,$LIGNE[0] or grep/^[Ss]uppression/,$LIGNE[0] ) {  
undef $ID_APPLICATION_ORA; undef $APPLICATION_EXIST;
 
### mise en place de la sequence application
$sql_seq="select SEQUENCE_APPLICATIONESDA.nextval from dual";
my $sth =$dbh -> prepare ($sql_seq) ;
my $rc = $sth -> execute ;
( $SEQUENCE_APPLI ) = $dbh->selectrow_array($sql_seq);
 
# recherche de l'id de l'application
$sql="select id_application_ora from t_application a, t_environnement e where a.ID_DOMAINE in ($DOMAINE_PROD) and e.id_environnement_ora=a.id_environnement_ora and e.environnement='$VALEUR{ENVIR}' and application='$VALEUR{APPLI}'";
my $sth =$dbh -> prepare ($sql) ;
my $rc = $sth -> execute ;
if ( $sth->err ) { $MESSAGE =$sth->err; @MESSAGE_SQL=@MESSAGE_SQL," ERR - $MESSAGE "; }
( $ID_APPLICATION_ORA ) = $dbh->selectrow_array($sql);
 
# recherche si l application est deja modifie dans le projet
 
$sql="select application from t_application_esda where id_projet='$LIVRABLE' and environnement='$VALEUR{ENVIR}' and application='$VALEUR{APPLI}'";
my $sth =$dbh -> prepare ($sql) ;
my $rc = $sth -> execute ;
if ( $sth->err ) { $MESSAGE =$sth->err; @MESSAGE_SQL=@MESSAGE_SQL," ERR - $MESSAGE "; }
( $APPLICATION_EXIST ) = $dbh->selectrow_array($sql);
###print " APPLICATION_EXIST : $APPLICATION_EXIST<br>";
 
### mise en place de la queue
$MACHINE_TEMPO=substr($VALEUR{MACHINE},0,5);
print " machine tempo => $MACHINE_TEMPO";
if ( grep /$MACHINE_TEMPO/,@MACH_WINDOW ) { $QUEUE="queue_wnt1"; } else { $QUEUE="queue_ksh"; }
 
 
if ( ! ( $APPLICATION_EXIST ) )
{
	if  ( $ID_APPLICATION_ORA )
	{
		$sql_insert="insert into t_application_esda (ID_PROJET,ENVIRONNEMENT,APPLICATION,ACTIVATION,PERIODICITE,CYCLIQUE,CYCLE,MACHINE,QUEUE,UTILISATEUR,DEPLANIFICATION,DATE_VTOM,HEURE_DEBUT,HEURE_FIN,ACTION,ID_APPLICATION_ESDA,GEOMETRIE,ID_APPLICATION_ORA) values ('$LIVRABLE','$VALEUR{ENVIR}','$VALEUR{APPLI}','job','$VALEUR{MODE_EXECUTION}','$VALEUR{CYCLIQUE}','$VALEUR{DUREE}','$VALEUR{MACHINE}','$QUEUE','$VALEUR{USER}','$LIGNE[10]','$VALEUR{DATE}','$VALEUR{HEURE_DEBUT}','$VALEUR{HEURE_FIN}','$LIGNE[0]','$SEQUENCE_APPLI','180x25+$GEOM+50','$ID_APPLICATION_ORA')";
	}
	else 
	{
	$sql_insert="insert into t_application_esda (ID_PROJET,ENVIRONNEMENT,APPLICATION,ACTIVATION,PERIODICITE,CYCLIQUE,CYCLE,MACHINE,QUEUE,UTILISATEUR,DEPLANIFICATION,DATE_VTOM,HEURE_DEBUT,HEURE_FIN,ACTION,ID_APPLICATION_ESDA,GEOMETRIE,ID_APPLICATION_ORA) values ('$LIVRABLE','$VALEUR{ENVIR}','$VALEUR{APPLI}','job','$VALEUR{MODE_EXECUTION}','$VALEUR{CYCLIQUE}','$VALEUR{DUREE}','$VALEUR{MACHINE}','$QUEUE','$VALEUR{USER}','$LIGNE[10]','$VALEUR{DATE}','$VALEUR{HEURE_DEBUT}','$VALEUR{HEURE_FIN}','$LIGNE[0]','$SEQUENCE_APPLI','180x25+$GEOM+50','-1')"; 
	}
}
else
{
	$sql_insert="update t_application_esda set PERIODICITE='$VALEUR{MODE_EXECUTION}',CYCLIQUE='$VALEUR{CYCLIQUE}',CYCLE='$VALEUR{DUREE}',MACHINE='$VALEUR{MACHINE}',UTILISATEUR='$VALEUR{USER}',DEPLANIFICATION='$LIGNE[10]',DATE_VTOM='$VALEUR{DATE}',HEURE_DEBUT='$VALEUR{HEURE_DEBUT}',HEURE_FIN='$VALEUR{HEURE_FIN}',ACTION='$LIGNE[0]',QUEUE='$QUEUE' where ID_PROJET='$LIVRABLE' and ENVIRONNEMENT='$VALEUR{ENVIR}' and APPLICATION='$VALEUR{APPLI}'";
}	
 
my $sth =$dbh -> prepare ($sql_insert) ;
my $rc = $sth -> execute ;
 
}
 
 
 
        }
 
        if ( grep/^[Ss]uppression$/,$LIGNE[0] and ! ( grep /$LIGNE[2]/,@APP_BASE ) ) { @LECTURE_ERROR=(@LECTURE_ERROR,"APPLICATION : $VALEUR{APPLI} - Attention : l \'application a supprimer n\'est pas presente dans la base et l`environnement $ENVIR - elle ne sera pas suprimee !"); }
}
 
 
 
 
### Relecture de la page job ###
print "<br>-> Relecture de la page job \n";
undef $GEOM; 
 
foreach $LIGNE (@JOB)
{
 
### REINITIALISATION PARAMETRES
undef $PARAM;
 
        @LIGNE=split ';',$LIGNE;
        if ( grep/Action/,$LIGNE[0] ) { if ( ! ( grep /Environnement/,$LIGNE[1] and grep /Application/,$LIGNE[2] and grep/Traitement/,$LIGNE[3] and grep /[Ss]cript/,$LIGNE[4] and grep /Heure\ de\ d/,$LIGNE[5] and grep /Heure\ de\ fin/,$LIGNE[6] and grep /Mode\ d/,$LIGNE[7] and grep /[Cc]yclique/,$LIGNE[9] and grep /[Cc]ycle/,$LIGNE[10] and grep /User/,$LIGNE[12] and grep /Machine/,$LIGNE[13] and grep /[Dd]\351planifier/,$LIGNE[14] and grep /Mettre\ l/,$LIGNE[15] and grep /Bloquer\ l/,$LIGNE[16] and grep /[Pp]aram/,$LIGNE[17] ) )  { @LECTURE_ERROR=(@LECTURE_ERROR,"L\'onglet Job n\'est pas standard E_SDA"); last; } }
 
        if (  grep/^[Aa]jout$/,$LIGNE[0] or grep/^[Mm]odification$/,$LIGNE[0] and ! (grep /[Pp]oub/,$LIGNE[1]) and ! (grep /[Pp]oub/,$LIGNE[2]) )
        {
 
	# Incrementation de la geometrie
	$GEOM=$GEOM+50;
 
        if ( grep /[Ii]llim/,$LIGNE[6] ) { $LIGNE[6]=illimite; }
        undef $VALEUR{APP_HEURE_DEBUT}; undef $VALEUR{APP_HEURE_FIN}; undef $VALEUR{DATE}; undef $VALEUR{DUREE};
        $VALEUR{ACTION}=$LIGNE[0]; $VALEUR{ENVIR}=$LIGNE[1]; $VALEUR{APPLI}=$LIGNE[2]; $VALEUR{JOB}=$LIGNE[3]; $VALEUR{SCRIPT}=$LIGNE[4]; $VALEUR{HEURE_DEBUT}=$LIGNE[5]; $VALEUR{HEURE_FIN}=$LIGNE[6]; $VALEUR{MODE_EXECUTION}=$LIGNE[7]; $VALEUR{CYCLIQUE}=$LIGNE[9]; $VALEUR{DUREE}=$LIGNE[10]; $VALEUR{USER}=$LIGNE[12]; $VALEUR{MACHINE}=$LIGNE[13]; $VALEUR{PLANIFICATION}=$LIGNE[14]; $VALEUR{APPLI_ERR}=$LIGNE[15]; $VALEUR{BLOCAGE}=$LIGNE[16];
 
 
        # Test sur les pre requis
 
        if ( grep /$VALEUR{APPLI}\-$VALEUR{JOB}$/,@{JOB_RECENS} ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nC | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - Ce job est ajoute ou modifie plusieurs fois dans la SDA");} else { @JOB_RECENS=(@JOB_RECENS,"$VALEUR{APPLI}-$VALEUR{JOB}");
###print " \@JOB_RECENS => @JOB_RECENS ";
}
        # Recherche par job
        foreach $OBJET ( keys %VALEUR )
        {
        if ( $OBJET =~ "HEURE_DEBUT" or $OBJET =~ "HEURE_FIN" or $OBJET =~ "DUREE" or $OBJET =~ "MODE_EXECUTION" or $OBJET =~ "DATE" ) { next ; }
        if ( grep /\ /,$VALEUR{$OBJET} ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - le champ $OBJET comporte un espace non permis"); }
        if ( grep /\W\S/,$VALEUR{$OBJET} and ! ( grep /\-/,$VALEUR{$OBJET} ) ) {
if ( $OBJET =~ "SCRIPT" and ! ( grep /\./,$VALEUR{$OBJET} ) and ! ( grep /\//,$VALEUR{$OBJET}) ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - le champ $OBJET contient 1 caractere special"); }
elsif ( $OBJET =~ "MODE_EXECUTION" and ! ( grep /\351/,$VALEUR{$OBJET} ) ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - le champ $OBJET contient 1 caractere special");  }
elsif ( $OBJET !~ "MODE_EXECUTION" and $OBJET !~ "SCRIPT" and ! ( grep /\ /,$VALEUR{$OBJET} ) ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB}- le champ $OBJET contient 1 caractere special"); } }
        if ( length($VALEUR{$OBJET}) == 0 ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - le champ $OBJET n\'est pas rempli");}
        }
        if ( $VALEUR{MODE_EXECUTION} ) {  if ( grep /riodique/,$VALEUR{MODE_EXECUTION} ) { $VALEUR{MODE_EXECUTION}="periodique"; } if ( ! ( grep /riodique/,$VALEUR{MODE_EXECUTION} or grep /demande/,$VALEUR{MODE_EXECUTION} ) ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - le champ mode execution est mal rempli"); } } else { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB}- le champ mode execution n est pas rempli"); }
 
 
        # Mise en place de la fonction de hachage pour comparaison date - job - appli
        $VALEUR{HEURE_DEBUT}=HEURE($LIGNE[5]); $VALEUR{HEURE_FIN}=HEURE($LIGNE[6]);
        if ( $VALEUR{DUREE} ) { $VALEUR{DUREE}=HEURE($VALEUR{DUREE}); }
        $LIGNE[3]{HEURE_DEBUT}=$LIGNE[5]; $LIGNE[3]{HEURE_FIN}=$LIGNE[6]; $LIGNE[3]{BLOCAGE}=$LIGNE[17]; $LIGNE[3]{APPLI}=$LIGNE[2];
 
### REQUETE SQL ###
$sql="select job from t_job j,t_application a,t_environnement e where a.ID_DOMAINE in ($DOMAINE_PROD) and j.id_environnement_ora=e.id_environnement_ora and a.id_environnement_ora=j.id_application_ora and e.environnement='$LIGNE[1]' and a.application='$LIGNE[2]'";
my $sth =$dbh -> prepare ($sql) ;
my $rc = $sth -> execute;
if ( $sth->err ) { $MESSAGE =$sth->err; @MESSAGE_SQL=@MESSAGE_SQL," ERR - $MESSAGE "; }
( @JOB_BASE ) = $dbh->selectrow_array($sql);
        # TEST sur les pre requis
        if ( grep/^[Mm]odification$/,$LIGNE[0] and ! ( grep /$LIGNE[2]/,@JOB_BASE ) ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nC | JOB : $VALEUR{APPLI}/$VALEUR{JOB} -  Attention : le job a modifier n\'est pas present dans la base et l\`environnement $ENVIR - il ne sera pas modifie !"); }
        if ( length($VALEUR{JOB})>16 ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nC | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - le job excede 16 caracteres "); }
        if ( $VALEUR{HEURE_DEBUT} !~ "[0-4][0-9]:[0-6][0-9]:[0-6][0-9]" ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - L\'Heure de debut n\'est pas une heure valide ou contient un espace"); }
	if ( $VALEUR{HEURE_FIN} !~ "[0-4][0-9]:[0-6][0-9]:[0-6][0-9]" and ! (  grep /illimi/,$VALEUR{HEURE_FIN} )) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - l\'Heure de fin n\'est pas une heure valide ou contient un espace"); }
        if ( length($VALEUR{DUREE}) != 0 ) { $VALEUR{DUREE}=HEURE($LIGNE[10]); if ( $VALEUR{DUREE} !~ "[0-4][0-9]:[0-6][0-9]:[0-6][0-9]" ) { @LECTURE_ERROR=(@LECTURE,"\nM | APPLICATION : $VALEUR{APPLI} - la dur\351e du cycle n\'est pas une heure valide"); } }
	if ( grep /[Oo]ui/,$VALEUR{BLOCAGE} and $VALEUR{APPLI}{DATE} =~ systeme ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - On ne peut bloquer une date d\'exploitation systeme"); }
        if ( grep /[Oo]ui/,$VALEUR{CYCLIQUE} and grep /[Oo]ui/,$VALEUR{APPLI}{CYCLIQUE} ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - On ne peut mettre un job cyclique pour une application cyclique"); }
        if ( length($VALEUR{DUREE}) != 0 and $VALEUR{DUREE} !~ "[0-4][0-9]:[0-6][0-9]:[0-6][0-9]" ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | APPLICATION : $VALEUR{APPLI} - la dur\351e du cycle n\'est pas une heure valide"); }
 
        # comparaison heure job/appli
        if ( ! ( grep /$VALEUR{APPLI}/,@APPLI_REL )) {
                if ( length ( $VALEUR{APP_HEURE_DEBUT} ) == 0 and length ( $VALEUR{APP_HEURE_FIN} ) == 0 )
                { 
 
 
print "<br>-  Recherche heures application dans la base VTOM";
### REQUETE SQL ###
$sql="select heure_debut,heure_fin from t_application a,t_environnement e where a.ID_DOMAINE in ($DOMAINE_PROD) and a.id_environnement_ora=e.id_environnement_ora and e.environnement='$LIGNE[1]' and a.application='$LIGNE[2]'";
print "<br> $sql";
my $sth =$dbh -> prepare ($sql) ;
my $rc = $sth -> execute;
if ( $sth->err ) { $MESSAGE =$sth->err; @MESSAGE_SQL=@MESSAGE_SQL," ERR - $MESSAGE "; }
( $LIGNE[1]{HEURE_DEBUT},$LIGNE[1]{HEURE_FIN} ) = $dbh->selectrow_array($sql);
 
                @APPLI_REL=(@APPLI_REL,$VALEUR{APPLI});
                }
        }
 
 
        # pas d horaire illimite sur appli/job cyclique
        if ( grep /[Oo]ui/,$VALEUR{CYCLIQUE} and grep /illimi/,$VALEUR{HEURE_FIN} ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - Un horaire de job illimite ne peut etre implemente dans un job cyclique"); }
        if ( grep /[Oo]ui/,$VALEUR{APPLI}{CYCLIQUE} and grep /illimi/,$VALEUR{HEURE_FIN} ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - Un horaire de job illimite ne peut etre implemente dans une application cyclique"); }
        # pas d horaire illimte sur une date systeme
        if ( grep /illimi/,$VALEUR{HEURE_FIN} and $VALEUR{APPLI}{DATE} =~ systeme ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - Un horaire de job illimite ne peut etre implemente sur une date systeme"); }
 
 
        $VALEUR{HEURE_DEBUT_REF}=$VALEUR{HEURE_DEBUT};
        $VALEUR{HEURE_FIN_REF}=$VALEUR{HEURE_FIN};
        $VALEUR{HEURE_DEBUT}=CONVERT_HEURE($VALEUR{HEURE_DEBUT});
        $VALEUR{HEURE_FIN}=CONVERT_HEURE($VALEUR{HEURE_FIN});
        if ( length ( $LIGNE[2]{HEURE_FIN} ) != 0 ) { $VALEUR{APP_HEURE_FIN}=CONVERT_HEURE($LIGNE[2]{HEURE_FIN}); }
        if ( length ( $LIGNE[2]{HEURE_DEBUT} ) != 0 ) { $VALEUR{APP_HEURE_DEBUT}=CONVERT_HEURE($LIGNE[2]{HEURE_DEBUT}); }
 
 
        if ( length ( $VALEUR{APP_HEURE_DEBUT} ) != 0 and $VALEUR{HEURE_DEBUT} < $VALEUR{APP_HEURE_DEBUT} ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nm | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - l\'horaire de d\351but du job est ant\351rieure \340 l\'horaire de d\351but de l\'application"); }
        if ( length ( $VALEUR{APP_HEURE_FIN} ) != 0 and $VALEUR{HEURE_FIN} > $VALEUR{APP_HEURE_FIN} ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nm | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - l\'horaire de fin du job est sup\351rieure \340 l'horaire de fin de l\'application"); }
 
        if ( $VALEUR{HEURE_FIN} > 86359  and  $VALEUR{APPLI}{DATE} =~ systeme ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nm | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - l\'horaire de fin du job ne doit pas exceder 24 h pour une date systeme"); }
 
        }
 
        if ( grep/^[Ss]uppression$/,$LIGNE[0] and ! ( grep /$LIGNE[2]/,@JOB_BASE ) ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nC | JOB : $VALEUR{APPLI}/$VALEUR{JOB} - Attention : le job a supprimer n est pas present dans la base et l environnement $ENVIR - il ne sera pas supprimee ! "); }
 
 
###print "---------fin--------------"; exit ;
### Mise en place de parametres
 
        if ( $LIGNE[17] )
        {
                for ($i=17;$i<28;$i++)
                {
                        if  ( length ($LIGNE[$i]) == 0  ) { $PARAM =~ s/^#//g; last ; }
                	$PARAM="$PARAM\#$LIGNE[$i]";
                }
        }
 
 
 
 
if ( grep/^[Aa]jout$/,$LIGNE[0] or grep/^[Mm]odification$/,$LIGNE[0] or grep/^[Ss]uppression/,$LIGNE[0] ) {
undef $ID_JOB_ORA; undef @JOB_EXIST;
 
# recherche de l'id  du job
$sql="select id_job_ora from t_application a, t_environnement e , t_job j where a.ID_DOMAINE in ($DOMAINE_PROD) and e.id_environnement_ora=a.id_environnement_ora and e.environnement='$VALEUR{ENVIR}' and j.id_application_ora=a.id_application_ora and a.application='$VALEUR{APPLI}' and job='$VALEUR{JOB}'";
my $sth =$dbh -> prepare ($sql) ;
my $rc = $sth -> execute ;
if ( $sth->err ) { $MESSAGE =$sth->err; @MESSAGE_SQL=@MESSAGE_SQL," ERR - $MESSAGE "; }
( $ID_JOB_ORA ) = $dbh->selectrow_array($sql);
 
# recherche si l application est deja modifie dans le projet
 
$sql="select job from t_job_esda where id_projet='$LIVRABLE' and environnement='$VALEUR{ENVIR}' and application='$VALEUR{APPLI}' and job='$VALEUR{JOB}'";
my $sth =$dbh -> prepare ($sql) ;
my $rc = $sth -> execute ;
if ( $sth->err ) { $MESSAGE =$sth->err; @MESSAGE_SQL=@MESSAGE_SQL," ERR - $MESSAGE "; }
( $JOB_EXIST ) = $dbh->selectrow_array($sql);
 
###print " JOB_EXIST : $JOB_EXIST<br>";
 
### mise en place de la queue
$MACHINE_TEMPO=substr($VALEUR{MACHINE},0,5);
if ( grep /$MACHINE_TEMPO/,@MACH_WINDOW ) { $QUEUE="queue_wnt1"; } else { $QUEUE="queue_ksh"; }
 
 
if ( ! ( $JOB_EXIST ) )
{
	$sql_seq="select SEQUENCE_JOBESDA.nextval from dual";
	my $sth =$dbh -> prepare ($sql_seq) ;
	my $rc = $sth -> execute ;
	( $SEQUENCE_JOB ) = $dbh->selectrow_array($sql_seq);
 
        if  ( $ID_JOB_ORA )
        {
		$sql_insert="insert into t_job_esda (ID_PROJET,ENVIRONNEMENT,APPLICATION,JOB,SCRIPT,ACTIVATION,PERIODICITE,CYCLIQUE,CYCLE,MACHINE,QUEUE,UTILISATEUR,DEPLANIFICATION,APPLICATION_ERREUR,DATE_BLOCAGE,HEURE_DEBUT,HEURE_FIN,PARAMETRES,ACTION,id_job_esda,GEOMETRIE,ID_job_ORA) values ('$LIVRABLE','$VALEUR{ENVIR}','$VALEUR{APPLI}','$VALEUR{JOB}','$VALEUR{SCRIPT}','exec','$VALEUR{MODE_EXECUTION}','$VALEUR{CYCLIQUE}','$VALEUR{DUREE}','$VALEUR{MACHINE}','$QUEUE','$VALEUR{USER}','$VALEUR{PLANIFICATION}','$VALEUR{APPLI_ERR}','$VALEUR{BLOCAGE}','$VALEUR{HEURE_DEBUT_REF}','$VALEUR{HEURE_FIN_REF}','$PARAM','$LIGNE[0]','$SEQUENCE_JOB','180x25+$GEOM+50','$ID_JOB_ORA')";  
	}
	else
	{
		$sql_insert="insert into t_job_esda (ID_PROJET,ENVIRONNEMENT,APPLICATION,JOB,SCRIPT,ACTIVATION,PERIODICITE,CYCLIQUE,CYCLE,MACHINE,QUEUE,UTILISATEUR,DEPLANIFICATION,APPLICATION_ERREUR,DATE_BLOCAGE,HEURE_DEBUT,HEURE_FIN,PARAMETRES,ACTION,id_job_esda,GEOMETRIE,ID_job_ORA) values ('$LIVRABLE','$VALEUR{ENVIR}','$VALEUR{APPLI}','$VALEUR{JOB}','$VALEUR{SCRIPT}','exec','$VALEUR{MODE_EXECUTION}','$VALEUR{CYCLIQUE}','$VALEUR{DUREE}','$VALEUR{MACHINE}','$QUEUE','$VALEUR{USER}','$VALEUR{PLANIFICATION}','$VALEUR{APPLI_ERR}','$VALEUR{BLOCAGE}','$VALEUR{HEURE_DEBUT_REF}','$VALEUR{HEURE_FIN_REF}','$PARAM','$LIGNE[0]','$SEQUENCE_JOB','180x25+$GEOM+50','-1')"; 
	}
}
else
{
	$sql_insert="update t_job_esda set SCRIPT='$VALEUR{SCRIPT}', PERIODICITE='$VALEUR{MODE_EXECUTION}',CYCLIQUE='$VALEUR{CYCLIQUE}',CYCLE='$VALEUR{DUREE}',MACHINE='$VALEUR{MACHINE}',UTILISATEUR='$VALEUR{USER}',DEPLANIFICATION='$VALEUR{PLANIFICATION}',DATE_BLOCAGE='$VALEUR{BLOCAGE}',HEURE_DEBUT='$VALEUR{HEURE_DEBUT_REF}',HEURE_FIN='$VALEUR{HEURE_FIN_REF}',ACTION='$LIGNE[0]',PARAMETRES='$PARAM',QUEUE='$QUEUE' where ID_PROJET='$LIVRABLE' and ENVIRONNEMENT='$VALEUR{ENVIR}' and APPLICATION='$VALEUR{APPLI}' and JOB='$VALEUR{JOB}'";
}
my $sth =$dbh -> prepare ($sql_insert) ;
my $rc = $sth -> execute ;
}
}
 
 
### relecture de la page ressource ###
 
print "<br>-> Relecture de la page ressource \n";
 
for $LIGNE (@RESSOU)
{
        @LIGNE=split ';',$LIGNE;
        if ( grep/Action/,$LIGNE[0] ) { if ( ! ( grep /Environnement/,$LIGNE[1] and grep /Application/,$LIGNE[2] and grep/Traitement/,$LIGNE[3] and grep /ressource/,$LIGNE[4] and grep /Type/,$LIGNE[5] and grep /Operateur/,$LIGNE[6] and grep /Valeur/,$LIGNE[7] ) )  { @LECTURE_ERROR=(@LECTURE_ERROR,"L\'onglet ressource n\'est pas standard E_SDA"); last; } }
 
if (  grep/^[Aa]jout$/,$LIGNE[0] or grep/^[Mm]odification$/,$LIGNE[0] or grep/^[Ss]uppression/,$LIGNE[0] )
{
undef $RES_BASE, $RES_EXIST;
 
         if ( length($LIGNE[0]) == 0  or  length($LIGNE[1]) == 0 or length($LIGNE[2]) == 0 or length($LIGNE[4]) == 0 ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | Ressource : $LIGNE[3] - Attention : cette ressource est mal renseignee dans l\'onglet ressources !"); next; }
        if ( $LIGNE[5] =~ "[Pp]oids" and grep /[Ss]yst/,$LIGNE[2]{DATE} ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nM | Ressource : $LIGNE[3] - On ne peut attribuer une ressource de type poids sur un JOB ou une APPLI poss\351dant une date systeme"); }
 
 
	$sql_res_base="select environnement,application,job from t_environnement e, t_application a, t_job j, t_declaration_ressource r where '$LIGNE[1]'=e.environnement and '$LIGNE[2]'=a.application and '$LIGNE[3]'=j.job and r.ID_DOMAINE in ($DOMAINE_PROD) and a.id_application_ora=r.id_application_ora and j.id_job_ora=r.id_job_ora and e.id_environnement_ora=a.id_environnement_ora and a.id_application_ora=j.id_application_ora";
        my $sth =$dbh -> prepare ($sql_res_base) ;
        my $rc = $sth -> execute ;
	( $RES_base ) = $dbh->selectrow_array($sql);
 
###print "RES_BASE -> $RES_BASE<br>";
 
       if ( $RES_EXIST ) { @LECTURE_ERROR=(@LECTURE_ERROR,"\nm | Ressource : $LIGNE[3] - Attention une ressource est deja allouee sur le traitement ##: $LIGNE[1] $LIGNE[2] -> nom des ressources : $RESSOURCE_EXIST"); }
 
# recherche si la resource est deja modifie dans le projet
 
$sql="select nom_ressource from T_DECLARATION_RESSOURCE_ESDA where id_projet='$LIVRABLE' and environnement='$LIGNE[1]' and application='$LIGNE[2]' and job='$LIGNE[3]' and NOM_RESSOURCE='$LIGNE[4]'";
my $sth =$dbh -> prepare ($sql) ;
my $rc = $sth -> execute ;
if ( $sth->err ) { $MESSAGE =$sth->err; @MESSAGE_SQL=@MESSAGE_SQL," ERR - $MESSAGE "; }
( $RES_EXIST ) = $dbh->selectrow_array($sql);
 
if ( ! ( $RES_EXIST ) )
{
	$sql_seq="select SEQUENCE_RESSOURCEESDA.nextval from dual";
	my $sth =$dbh -> prepare ($sql_seq) ;
	my $rc = $sth -> execute ;
	( $SEQUENCE_RESSOURCE ) = $dbh->selectrow_array($sql_seq);
 
	$sql_res="insert into T_DECLARATION_RESSOURCE_ESDA (ID_PROJET,ENVIRONNEMENT,APPLICATION,JOB,NOM_RESSOURCE,TYPE,OPERATEUR,VALEUR_PRISE_COMPTE,ACTION,ID_RESSOURCE_ESDA) values ('$LIVRABLE','$LIGNE[1]','$LIGNE[2]','$LIGNE[3]','$LIGNE[4]','$LIGNE[5]','$LIGNE[6]','$LIGNE[7]','$LIGNE[0]','$SEQUENCE_RESSOURCE')"; 
} 
else
{
	$sql_res="update T_DECLARATION_RESSOURCE_ESDA set TYPE = '$LIGNE[5]', OPERATEUR = '$LIGNE[6]', VALEUR_PRISE_COMPTE = '$LIGNE[7]' , ACTION = '$LIGNE[0]' where ID_PROJET='$LIVRABLE' and ENVIRONNEMENT = '$LIGNE[1]' and APPLICATION = '$LIGNE[2]' and JOB = '$LIGNE[3]' and NOM_RESSOURCE = '$LIGNE[4]'";
}
 
my $sth =$dbh -> prepare ($sql_res) ;
my $rc = $sth -> execute ;
}
 
}
 
 
 
 
 
### ecriture des messages d erreur ###
### Mise a jour de la base de donnees ###
 
print $cgi->start_td({-class => error, -width=> '130px'});
if ( @LECTURE_ERROR )
{
print "<br>";
print "<div class='sda_error'><font color=black>La SDA n\'est pas valide :";
### rollbackk des actions ###
my $rc  = $dbh->rollback ;
for $ERROR (@LECTURE_ERROR)
{ print "<br>$ERROR"; }
print "</div>";
print "<div class='sda_item'><br> Telecharger le format standard e_sda : <a href=\"http://bt1sssne/vtom/E_SDA_STANDARD_v1.xls\">E_SDA STANDARD</a></div>";
}
else
{
print "<br>";
my $rc  = $dbh->commit;
print "<div class='sda_ok'><font color=black>L'integration de la SDA s\' est executee avec succes</div>";
}
 
print "<br><br>";
print button(-name=>'button_name',-value=>'Fermer la fenetre',-onClick=>"parent. close()");
print "<p></div>";
 
print $cgi->end_td;
 
$dbh->disconnect;
 
}
 
 
 
 
###exit ;
Attachments:
 
the cgi file that i try to run
 
[+][-]01/28/09 09:48 AM, ID: 23489095Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/09 10:04 AM, ID: 23489268Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/28/09 10:18 AM, ID: 23489397Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/28/09 10:48 AM, ID: 23489735Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/28/09 11:55 AM, ID: 23490510Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/29/09 04:41 AM, ID: 23496533Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/29/09 05:33 AM, ID: 23496967Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/29/09 06:20 AM, ID: 23497499Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/29/09 06:30 AM, ID: 23497650Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/29/09 06:37 AM, ID: 23497740Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/29/09 08:43 AM, ID: 23499405Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/29/09 09:48 AM, ID: 23500306Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/29/09 01:25 PM, ID: 23502769Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Perl Programming Language
Tags: Perl PHP Apache SOLARIS10
Sign Up Now!
Solution Provided By: Adam314
Participating Experts: 1
Solution Grade: B
 
[+][-]01/30/09 08:32 AM, ID: 23510038Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625