[ PHP / Oracle ] Insérer les données d'un fichier texte

Insérer les données d'un fichier texte [ PHP / Oracle ] - Programmation

Marsh Posté le 06-08-2001 à 17:44:39    

J'ai un fichier texte qui contient des données, séparées par des tabulations. Lorsque j'essaye des les insérer avec "Oracle8 Navigator", j'ai un message d'erreur :"ORA-01704 constante de chaîne trop longue".
J'essaye de lire le fichier avec php avec ce script:
?
$fp = fopen ("REGIONS2.txt","r" );
while ($donnee = fscanf ($fp, "%s\t%s\t%s\t%s\t%s\t%s\n" )) {
        list ($num, $name, $type, $dept, $coord, $centre) = $donnee;
        $chaine="$num , $name , $type , $dept , ".strlen($coord)." , $centre";
        echo $chaine;
}
fclose($fp);
?>
Mais l'affichage ne corrspond pas à ce que j'ai dans le fichier!
Est-ce aussi du à la longueur?
J'ai essayé d'insérer un n-uplet via php et j'ai le même message!
Pourtant tous les champs font moins de 2000 characters sauf le 4ème que j'ai mis en long comme type et ça va jusqu'a 32776 et j'ai pas autant!
 
Voici l'insertion que j'ai essayé:
 
$queryauto="insert into REGIONS values('1','3','1','AIN','079,120053,4000
79,210053,590079,130053,660079,130053,730079,06005
3,740079,050053,780079,120053,830079,410053,930079
,550053,980079,660054,110079,570054,240079,670054,
350079,640054,460079,860054,590079,870054,650079,8
70054,860079,880054,900079,940054,900079,990054,49
0080,050054,490080,140054,790080,340054,730080,420
054,810080,350055,100080,320055,260080,460055,3600
80,640055,320080,720055,360080,970055,290081,07005
5,140081,120055,090081,140055,030081,310055,040081
,440054,880081,450054,790081,490054,630081,640054,
590081,660054,540081,700054,480081,740054,500081,7
70054,580081,760054,690081,890054,670082,040054,73
0082,040054,810082,290054,840082,330055,100082,300
055,150082,420055,330082,490055,270082,690055,2800
83,090055,310083,160055,330083,330055,300083,41005
5,210083,460055,230083,490055,260083,680055,040083
,760055,050083,920054,690084,040054,740084,260054,
280084,370054,070084,550053,990084,730053,760084,8
30053,620084,890053,510085,210053,600085,610053,91
0085,730053,910085,760053,990085,640054,280085,510
054,380085,440054,560085,410054,700085,420054,8400
85,290054,950085,370055,170085,450055,330085,28005
5,480085,180055,410084,990055,480084,900055,590084
,840055,540084,760055,520084,660055,550084,490055,
770084,290055,780084,250055,970084,470056,080084,5
10056,180084,390056,280084,330056,430084,290056,59
0084,310056,640084,210056,720084,070056,730083,910
056,730083,870056,830083,780056,840083,740056,9200
83,700056,960083,720057,230083,570057,260083,47005
7,190083,340057,070083,210057,080083,220057,230083
,130057,350083,110057,540083,150057,610083,110057,
760083,150057,880083,110058,030083,160058,140083,1
40058,290083,200058,360083,260058,440083,370058,49
0083,370058,610083,370058,850083,320058,930083,300
058,950083,320059,280083,270059,590083,250059,7900
83,190059,940083,130060,180083,040060,220083,06006
0,480083,050060,670083,030060,770083,070061,080082
,960061,120083,000061,290082,860061,500082,680061,
460082,610061,510082,450061,480082,460061,610082,5
10061,780082,320061,990082,340062,120082,370062,21
0082,340062,250082,110062,330082,060062,380082,000
062,540081,910062,580081,850062,480081,810062,4500
81,740062,230081,590061,990081,390061,960081,25006
1,850081,270061,680081,350061,690081,410061,790081
,460061,680081,330061,610081,290061,520081,260061,
490081,090061,480081,050061,390081,000061,330080,8
70061,160080,680060,970080,610060,930080,540060,82
0080,460060,690080,370060,610080,230060,510080,260
060,340080,350060,240080,280060,210080,200060,1400
80,170060,010080,060059,940079,890059,790079,74005
9,680079,560059,690079,540059,790079,390059,900079
,280060,080079,210060,440079,070060,740078,960060,
790078,860060,890078,850060,890078,730060,960078,5
40060,960078,420060,940078,410060,850078,330060,71
0078,080060,590077,920060,510077,740060,510077,670
060,510077,410060,560077,220060,540077,080060,6400
77,010060,580076,910060,620076,800060,650076,79006
0,650076,700060,670076,560060,600076,370060,680076
,310060,650076,350060,310076,310060,160076,180060,
080076,210059,870076,060059,830076,010059,640075,9
40059,650075,940059,560075,780059,510075,410059,65
0075,460059,490075,450059,380075,290059,340075,220
059,240075,090059,200075,040059,240074,940059,2100
74,820059,190074,810059,060074,960058,960074,97005
8,910074,990058,730074,960058,610074,920058,490074
,920058,480074,920058,210074,920058,130074,870057,
980075,010057,860075,020057,760074,880057,560075,0
10057,410075,030057,330075,090057,220075,210057,06
0075,220057,060075,290056,980075,320056,760075,210
056,690075,150056,590075,120056,550075,240056,2300
75,250056,090075,260055,990075,280055,970075,34005
5,690075,410055,580075,450055,440075,510055,180075
,590055,000075,630054,880075,650054,870075,640054,
680075,620054,580075,710054,380075,760054,330075,7
90054,230075,880054,020075,900054,010075,910053,86
0075,920053,740075,910053,710075,920053,550075,950
053,550076,090053,360076,090053,140076,080053,1300
76,110053,000076,160052,930076,200052,880076,22005
2,740076,310052,760076,310052,830076,390052,840076
,570052,740076,800052,790076,840052,910077,130053,
070077,240053,030077,440052,910077,510052,930077,5
70052,950077,740052,850077,760052,740077,970052,78
0078,000052,660078,270052,780078,290053,000078,380
053,190078,500053,210078,540053,310078,640053,2900
78,870053,410079,030053,360079,120053,400','0,46
8807340,475277')";
 
Merci de votre aide :)

Reply

Marsh Posté le 06-08-2001 à 17:44:39   

Reply

Marsh Posté le 07-08-2001 à 09:08:24    

Y a t-il un autre moyen pour insérer des n-uplets??
J'ai essayé avec SQLPlus mais la commande ne peut pas dépasser une certaine longueur.
Comment on fait déjà pour créer un fichier .sql puis pour l'executer depui SQLPlus??

Reply

Marsh Posté le 07-08-2001 à 09:12:21    

ed monfichier.sql , nan ??
 
et après pour l'exécuter c pas @monfichier.sql


---------------
Mes photos,Feed-Back HA/V
Reply

Marsh Posté le 07-08-2001 à 09:52:44    

j'ai essayé avec un fichier .sql (merci m@nou) mais j'ai ce message :
 
Entrée limitée à 2499 caractères
Entrée trop longue (> 2499 caractères) - ligne ignorée
 
Comment puis-je faire??

Reply

Marsh Posté le 07-08-2001 à 10:52:35    

J'ai trouvé que le problème se produit lorsque les chaînes dépassent 4000 caractères! Est-ce que c'est une propriété définie dans Oracle ou Oracle8 Navigator??

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed