|
|
|
Где ошибка ? (выгрузка oracle -> dbf средствами php)
|
|||
|---|---|---|---|
|
#18+
Исходник<?php $user = "scott"; $password = "tiger"; $host = "super2004"; $port = "1521"; $sid = "ora92a1"; $db = " (DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = $host)(PORT = $port))(CONNECT_DATA = (SID = $sid)))"; $link = ocilogon($user, $password, $db); if ($Error = ocierror()) { die('Неуспешное соединение !'); } ?> <?php $m=array(); $name=array(); $num=array(); $query ="select * from emp"; $statement = OCIParse($link, $query); OCIExecute($statement); $ncols = OCINumCols($statement); for ($i=1; $i<=$ncols; $i++) { $column_name = OCIColumnName($statement, $i); $name[]=$column_name; $column_type = OCIColumnType($statement, $i); $column_size = OCIColumnSize($statement, $i); $def[] = array ($column_name, $column_type, $column_size); //print ($column_name ." ". $column_type ." ". $column_size ."<br>"); } $dbname= "c:/export.dbf"; $dbid = dbase_create($dbname, $def); if (!$dbid) echo "Ошибка создания DBF файла !"; //ЗАБ. ДАННЫХ while (OCIFetch($statement)) { for ($i=1; $i<=count($name); $i++) { $rec[$i] = ociresult($statement, $name[$i]); if (!dbase_add_record($dbid, array($rec[$i]))) echo "Failed to add a record. "; } } ocilogoff($link); ocifreestatement($statement); ?> ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.11.2005, 17:20 |
|
||
|
|

start [/forum/topic.php?fid=23&fpage=450&tid=1477306]: |
0ms |
get settings: |
6ms |
get forum list: |
16ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
42ms |
get topic data: |
6ms |
get forum data: |
1ms |
get page messages: |
14ms |
get tp. blocked users: |
1ms |
| others: | 204ms |
| total: | 294ms |

| 0 / 0 |
