File: oracle8iclobfetch.php

package info (click to toggle)
sqlrelay 1%3A0.37.1-3.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 13,084 kB
  • ctags: 6,691
  • sloc: cpp: 48,136; python: 10,118; ansic: 9,673; java: 9,195; php: 8,839; perl: 8,827; sh: 8,554; ruby: 8,516; tcl: 5,039; makefile: 3,665
file content (41 lines) | stat: -rwxr-xr-x 1,015 bytes parent folder | download | duplicates (2)
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
<html><pre><?php
# Copyright (c) 2001  David Muse
# See the file COPYING for more information.

ini_set('memory_limit','100M');
set_time_limit(600);

dl("sql_relay.so");

function checkSuccess($value,$success) {

	if ($value==$success) {
		echo("success ");
	} else {
		echo("failure ");
		#printf("%s!=%s\n",$value,$success);
		sqlrcur_free($cur);
		sqlrcon_free($con);
		exit(0);
	}
}

	$host=$_REQUEST["host"];
	$port=$_REQUEST["port"];
	$socket=$_REQUEST["socket"];
	$user=$_REQUEST["user"];
	$password=$_REQUEST["password"];

	# instantiation
	$con=sqlrcon_alloc($host,$port,$socket,$user,$password,0,1);
	$cur=sqlrcur_alloc($con);

	echo("LONG CLOB: \n");
	sqlrcur_prepareQuery($cur,"begin select testclob into :clobbindval from testtable2; end;");
	sqlrcur_defineOutputBindClob($cur,"clobbindval");
	checkSuccess(sqlrcur_executeQuery($cur),1);
	$clobbindvar=sqlrcur_getOutputBind($cur,"clobbindval");
	checkSuccess(sqlrcur_getOutputBindLength($cur,"clobbindval"),20*1024*1024);
	echo("\n");

?></pre></html>