Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

yii gii cann't find table use oracle 10g #290

Closed
qiangxue opened this Issue · 9 comments

7 participants

@qiangxue
Owner

What steps will reproduce the problem?
1.config:
'class'=>'CDbConnection',
'connectionString'=>'oci:dbname=127.0.0.1/testdb',
'username'=>'test',
'password'=>'test',
'emulatePrepare' => true,
'charset' => 'utf8',
2.
I can select data from oracle,example as below:
$sql = 'select * from sr_black_list where rownum <=100';
$command = Yii::app()->db->createCommand($sql)->queryAll();
var_dump($command);exit;
it's display the date what I wanted.
So,I think I can connect to oracle in my enviroment.All config is ok.
3.But when I want to use gii ,script show the error:Table 'sr_black_list' does not exist.but it really exit in my oracle database,

What version of the product are you using? On what operating system?

Yii:1.1.8 Oracle:10.2.3 php:5.3
Please provide any additional information below.
Can't gii used in oracle?who can help me, thank u very much.

Migrated from http://code.google.com/p/yii/issues/detail?id=2875


earlier comments

alexander.makarow said, at 2012-02-09T19:03:07.000Z:

Can be related with http://code.google.com/p/yii/issues/detail?id=1775

@resurtm
Collaborator

I've tested this issue. It's not reproducible on my box.

My testing environment:

Windows 7, amd64 (6.1.7601)
PHP 5.4.3, x86
Oracle 11g XE Release 2, x86 (free express edition)
oci.dll version: 11.2.0.1
Yii 1.1.12-dev (this git commit used: 9b7c51d)

Database component configuration:

'db'=>array(
    'class'=>'CDbConnection',
    'connectionString'=>'oci:dbname=127.0.0.1:1521/xe;charset=UTF8',
    'username'=>'RESURTM',
    'password'=>'123123',
    'tablePrefix'=>'tbl_',
    'emulatePrepare'=>true,
),

Maybe it's only Oracle 10g specific.

@resurtm
Collaborator

DDL:

DROP TABLE "RESURTM"."tbl_post";
CREATE TABLE "RESURTM"."tbl_post" (
"id" NUMBER NOT NULL ,
"title" VARCHAR2(100 BYTE) DEFAULT ''  NOT NULL ,
"slug" VARCHAR2(100 BYTE) DEFAULT ''  NOT NULL 
)
LOGGING
NOCOMPRESS
NOCACHE
;

ALTER TABLE "RESURTM"."tbl_post" ADD CHECK ("id" IS NOT NULL);
ALTER TABLE "RESURTM"."tbl_post" ADD CHECK ("title" IS NOT NULL);
ALTER TABLE "RESURTM"."tbl_post" ADD CHECK ("slug" IS NOT NULL);

ALTER TABLE "RESURTM"."tbl_post" ADD PRIMARY KEY ("id");

Gii sees this table as expected. I'm going to test this issue more.

@mdomba
Collaborator

as this was reported on Yii 1.1.8 it's possible that this got fixed in the meantime

@resurtm
Collaborator

@mdomba Maybe close it? I've tested on real Oracle installation.

@mdomba
Collaborator

please try once more with the same table name as reported and with and without the table prefix set... if all will work we will close this issue... thanks

@swarog

Hello, I got to repeat this problem in some cases. My testing environment Oracle 10.2.0 x86, php 5.1.6, Yii 1.1.8.
When I try use gii model generator and set RS_ as table prefix, I get error "Table 'BLACK_LIST' does not exist". But if I set all table name in "Table Name" field, all is working fine.

@cebe
Owner

@swarog can you please check that with yii 1.1.12?

@swarog

@cebe Yes, of course, I try do this today.

@imrel
select * from sr_black_list where rownum <=100

this will query for table "SR_BLACK_LIST" as Oracle will convert unquoted table/column names to uppercase.

In gii it adds quotes "sr_black_list". I think in 1.1.8 there was no table hint in qii.

I do not think its a yii bug.

@samdark samdark closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.