Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Phalcon DevTools Models Oracle #1274

Open
verde3ro opened this issue Mar 5, 2019 · 13 comments
Open

Error Phalcon DevTools Models Oracle #1274

verde3ro opened this issue Mar 5, 2019 · 13 comments

Comments

@verde3ro
Copy link

verde3ro commented Mar 5, 2019

I have the following problem when generating the models of an Oracle database.

phalcon create-all-models --mapcolumn --doc --force --schema=MGR_ARVYC

Phalcon DevTools (3.4.0)

ERROR: SQLSTATE[HY000]: General error: 24337 OCIStmtExecute: ORA-24337: statement handle not prepared (ext\pdo_oci\oci_statement.c:159)

I hope you can help me.

@Jeckerson
Copy link
Member

@verde3ro Can you provide example models when it occurs?

@Jeckerson Jeckerson added this to the 3.4.x milestone Mar 15, 2019
@verde3ro
Copy link
Author

verde3ro commented Mar 19, 2019

@Jeckerson, Occurs when generating models with Phalcon DevTools or Web Tools.

2019-03-19 08_50_03-Window
2019-03-19 08_50_44-Window

@Jeckerson
Copy link
Member

@verde3ro Please execute model generation per single table and provide output of SHOW CREATE TABLE of tables where it occurs.

@verde3ro
Copy link
Author

verde3ro commented Mar 19, 2019

@Jeckerson, Execution generation of model per single table:

Table:

CREATE TABLE "AV_USUARIO_C" 
   (	"ID" NUMBER DEFAULT NULL NOT NULL ENABLE, 
	"USUARIO" VARCHAR2(20 BYTE) DEFAULT '' NOT NULL ENABLE, 
	"PASSWORD" VARCHAR2(50 BYTE) DEFAULT '', 
	"NOMBRE" VARCHAR2(250 BYTE) DEFAULT '' NOT NULL ENABLE, 
	"CORREO" VARCHAR2(100 BYTE) DEFAULT '', 
	"ESTATUS" VARCHAR2(5 BYTE) DEFAULT 'AC' NOT NULL ENABLE, 
	"USUARIO_I" VARCHAR2(20 BYTE) DEFAULT '' NOT NULL ENABLE, 
	"FECHA_I" DATE DEFAULT SYSDATE NOT NULL ENABLE, 
	"USUARIO_U" VARCHAR2(20 BYTE), 
	"FECHA_U" DATE, 
	"CORRECTO" NUMBER(1,0) DEFAULT 0, 
	"USUARIO_EBS" VARCHAR2(20 BYTE) DEFAULT '', 
	 CONSTRAINT "AV_USUARIO_PK" PRIMARY KEY ("ID"), 
	 CONSTRAINT "AV_USUARIO_UX" UNIQUE ("USUARIO")
   ) ;

Configuration:

 'database' => [
        'adapter'     => 'Oracle',
        'host'        => '127.0.0.1:1521/XE',
        'username'    => 'MGR_ARVYC',
        'password'    => 'password01',
        'dbname'      => '(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))) (CONNECT_DATA=(SID=XE)))',
        'charset'     => 'utf8',
    ],

Execution:

2019-03-19 08_50_44-Window
2019-03-19 11_38_27-Window
2019-03-19 11_38_39-Window

@Jeckerson
Copy link
Member

Option config hasn't been defined is related to another task. That means that your table name will be generated after #1292 will be merged.

Try to find another table that generate this error:
ERROR: SQLSTATE[HY000]: General error: 24337 OCIStmtExecute: ORA-24337: statement handle not prepared (ext\pdo_oci\oci_statement.c:159)

@verde3ro
Copy link
Author

verde3ro commented Apr 2, 2019

I did not understand the comment:

Option config hasn't been defined is related to another task. That means that your table name will be generated after #1292 will be merged.

Any table in the schema generate the error when created the model.

ERROR: SQLSTATE[HY000]: General error: 24337 OCIStmtExecute: ORA-24337: statement handle not prepared
 (ext\pdo_oci\oci_statement.c:159)

2019-04-02 10_20_21-Error Phalcon DevTools Models Oracle · Issue #1274 · phalcon_phalcon-devtools

@verde3ro verde3ro closed this as completed Apr 2, 2019
@Jeckerson Jeckerson reopened this Apr 2, 2019
@Jeckerson
Copy link
Member

I did not understand the comment:

You posted screenshot where error is different
https://user-images.githubusercontent.com/13452905/54629138-8c121800-4a3c-11e9-87fd-f0ea4daa64d0.png

@Jeckerson
Copy link
Member

So your issue is actual.

@verde3ro
Copy link
Author

verde3ro commented Apr 2, 2019

yes it's actual

@verde3ro
Copy link
Author

verde3ro commented Apr 2, 2019

ERROR: SQLSTATE[HY000]: General error: 24337 OCIStmtExecute: ORA-24337: statement handle not prepared
 (ext\pdo_oci\oci_statement.c:159)

2019-04-02 10_20_21-Error Phalcon DevTools Models Oracle · Issue #1274 · phalcon_phalcon-devtools

2019-04-02 10_58_22-Phalcon WebTools - Firefox Developer Edition

@Jeckerson Jeckerson self-assigned this Apr 2, 2019
@Jeckerson Jeckerson modified the milestones: 3.4.x, 4.0.0 Jun 28, 2019
@Jeckerson Jeckerson modified the milestones: 4.0.0, 4.1.0 Nov 23, 2019
@Jeckerson
Copy link
Member

Can be fixed only when Incubator DB Component is ready for Phalcon v4.

https://github.com/phalcon/incubator-db

@flyingangel
Copy link

Error Option namespace hasn't been defined when generating a class with constraint relation.

There's 2 typos in the file Model.php

if ($this->modelOptions->hasOption('namespace')) instead of if ($this->modelOptions->getOption('namespace'))

Devtool tag 4.0.5

@Jeckerson
Copy link
Member

@flyingangel I think your issue isn't related to this one. Please create separate one.

@Jeckerson Jeckerson modified the milestones: 4.0.x, 5.0.x Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants