Class: Oracle
Source Location: /php/db/Oracle.php
Class Oracle
Inherited Properties, Constants, and Methods
Method Summary
| array |
fetch() |
실행된 select 쿼리에 대해서 fetch 를 통해 한 행(row)을 리턴한다. |
| bool |
setPrefetch() |
execute 메소드를 실행했을 때 미리 읽어올 레코드셋 개수를 설정한다. |
Methods
Oracle __construct(
[
$option = ''], [
$type = 'product']
)
|
|
생성자
Parameters:
API Tags:
Redefinition of:
- DBClient::__construct()
bool bind(
string
$name, [string
$type = ''], [string
$output = 'in'], [int
$length = -1], [
&$value = null], mixed
$value
)
|
|
bind 메소드
Parameters:
|
string |
$name: |
바인딩 이름 |
|
string |
$type: |
바인딩될 타입, 데이타베이스 마다 틀림 |
|
string |
$output: |
output 형태, in, out, inout, return |
|
int |
$length: |
데이타길이, -1은 길이제한 없음 |
|
mixed |
$value: |
저장될 데이타 또는 output 변수에 저장될 데이타 |
|
|
&$value: |
|
API Tags:
Redefinition of:
- DBClient::bind()
- prepare된 구문을 바인딩 한다.
OracleProc createProc(
$str, [
$option = 'proc']
)
|
|
프로시저를 실행할 객체를 얻는다.
Parameters:
API Tags:
| See: | createProc($name) |
| Access: | public |
Redefinition of:
- DBClient::createProc()
- 프로시저를 실행할 객체 리턴 , 하위에서 구현해야합니다.
void define(
$column,
$var,
$type
)
|
|
Parameters:
API Tags:
에러 메세지 리턴
API Tags:
| Return: | 에러 메세지 |
| Access: | public |
Redefinition of:
- DBClient::error()
- 에러 리턴
resource execute(
[
$mode = OCI_DEFAULT]
)
|
|
쿼리 실행
$db = DB_('oracle', 'test', true);
$db->prepare("insert into test_table values ('1', '2')");
Parameters:
API Tags:
| Return: | statement를 실행한 리소스 |
| Access: | public |
Redefinition of:
- DBClient::execute()
- prepare된 구문을 실행한다.
array fetch(
resource
$stmt
)
|
|
실행된 select 쿼리에 대해서 fetch 를 통해 한 행(row)을 리턴한다.
리턴되는 값은 array('필드' => 'ㅁㅁㅁ', ...); 형태를 가진다.
Parameters:
|
resource |
$stmt: |
select 결과로 나온 resource |
API Tags:
| Return: | row 데이타 |
| Access: | public |
Redefinition of:
- DBClient::fetch()
- 레코드 가져오기
void fetchAll(
resource
$stmt
)
|
|
전체 패치
Parameters:
|
resource |
$stmt: |
파싱된 Statement 객체 |
API Tags:
Redefinition of:
- DBClient::fetchAll()
- 전체 레코드 가져오기
bool freeStatement(
resource
$stmt
)
|
|
prepare 메모리 해제
Parameters:
|
resource |
$stmt: |
oci_prepare() 함수로 나온 결과 resource |
API Tags:
Redefinition of:
- DBClient::freeStatement()
- prepare 된 구문 메모리 해제
DBData getCursorData(
$name, [
$isOne = false]
)
|
|
cursor 에서 DBData 얻기
$db = DB_('oracle', 'test', true);
.......
echo $data;
Parameters:
DBData getData(
string
$query, [boolean
$isOne = false], string
$baseClass
)
|
|
DBData 구함
$db = DB_('oracle', 'test', true);
$data = $db->getData("select 1 from dual");
echo $data;
Parameters:
|
string |
$query: |
DB query |
|
boolean |
$isOne: |
인덱스 한칸 옮기기 |
|
string |
$baseClass: |
생성될 클래스 이름 |
API Tags:
Redefinition of:
- DBClient::getData()
- DBData 구함
int getFieldCount(
resource
$stmt
)
|
|
쿼리의 결과로 나온 필드의 개수를 리턴한다.
Parameters:
|
resource |
$stmt: |
select 결과로 나온 resource |
API Tags:
| Return: | 필드개수 |
| Access: | public |
Redefinition of:
- DBClient::getFieldCount()
- 필드 개수 가지고 오기
string getFieldName(
resource
$stmt, int
$i
)
|
|
정해진 위치의 필드 이름을 얻어온다.
Parameters:
|
resource |
$stmt: |
select 결과로 나온 resource |
|
int |
$i: |
필드 위치, 처음은 0 |
API Tags:
| Return: | 필드이름 |
| Access: | public |
Redefinition of:
- DBClient::getFieldName()
- 필드 이름 가지고 오기
string getFieldType(
resource
$stmt, int
$i
)
|
|
정해진 위치의 필드 타입을 얻어온다.
Parameters:
|
resource |
$stmt: |
select 결과로 나온 resource |
|
int |
$i: |
필드 위치, 처음은 0 |
API Tags:
| Return: | 필드타입 |
| Access: | public |
Redefinition of:
- DBClient::getFieldType()
- 필드 타입 가지고 오기
DBData getPageData(
string
$query, int
$page, [int
$count = 10], string
$baseClass
)
|
|
select 쿼리에 대해서 페이징된 DBData를 리턴한다.
$db = DB_('oracle', 'test', true);
echo $data;
Parameters:
|
string |
$query: |
select 쿼리 |
|
int |
$page: |
현재 페이지 |
|
int |
$count: |
페이지당 리스트 개수 |
|
string |
$baseClass: |
DBData 를 상속한 클래스 , 기본값 DBData |
API Tags:
Redefinition of:
- DBClient::getPageData()
- paging 된 DBData 얻어오기
int|string getTypeConstant(
string
$type
)
|
|
필드 타입(자료형)별 php용 전용 상수 얻어오기
Parameters:
API Tags:
| Return: | PHP상수 |
| Access: | public |
Redefinition of:
- DBClient::getTypeConstant()
- 필드 타입(자료형)별 php용 전용 상수 얻어오기
string getTypeString(
string
$type, mixed
$value, [boolean
$is_null = false], [
$option = array('date_format' => 'YYYYMMDDHH24MISS')]
)
|
|
필드 타입(자료형)별 DB에 입력될 수 있는 문자열 얻어오기
Parameters:
|
string |
$type: |
타입문자열 |
|
mixed |
$value: |
입력값 |
|
boolean |
$is_null: |
널을 체크할 것인지 여부 , true 널체크, false 널 체크 안함 |
|
|
$option: |
|
API Tags:
| Return: | 변환된 문자열 |
| Access: | public |
Redefinition of:
- DBClient::getTypeString()
- 필드 타입(자료형)별 DB에 입력될 수 있는 문자열 얻어오기
void newCursor(
string
$name
)
|
|
커서 생성하기
Parameters:
API Tags:
resource prepare(
string
$query
)
|
|
sql 구문 파싱하기
Parameters:
API Tags:
| Return: | 파싱된 statment resource |
| Access: | public |
Redefinition of:
- DBClient::prepare()
- prepare
void query(
$query, [bool
$isCommit = true], [array
$args = array()], string
$sql
)
|
|
일반 쿼리 실행
Parameters:
|
string |
$sql: |
실행될 query |
|
bool |
$isCommit: |
commit 여부 , 바로 commit 이면 true, 아니면 false |
|
array |
$args: |
바인딩될 변수 목록 |
|
|
$query: |
|
API Tags:
Redefinition of:
- DBClient::query()
- 쿼리 실행하기
rollback
API Tags:
| Return: | 성공이면 true, 실패이면 false |
| Access: | public |
Redefinition of:
- DBClient::rollback()
- rollback
bool setPrefetch(
resource
$stmt, [int
$count = 10]
)
|
|
execute 메소드를 실행했을 때 미리 읽어올 레코드셋 개수를 설정한다.
Parameters:
|
resource |
$stmt: |
실행된 statement |
|
int |
$count: |
미리 읽어올 레코드셋 개수 |
API Tags:
| Return: | 성공했으면 true, 실패했으면 false |
| Access: | public |
프로시저 실행
// 1. 일반적인 실행방법
// 2. 임의의 구문 실행방법
API Tags:
| Return: | 성공이면 true, 실패이면 false |
| Access: | public |
Information Tags:
| Todo: | insert, update ,delete 구문에 대해서 자동으로 binding 할 수 있는 기능 구현 |
database 연결 생성
API Tags:
| Return: | 연결 resource |
| Access: | public |
Redefinition of:
- DBClient::_connect()
- 연결 리소스 리턴
|
|