#1 mORMot 1 » Create a Restmodel from an existing Oracle database Schema » 2017-02-06 23:38:36

ericgarcia
Replies: 1

Hello,

I 'm newbie in the mormot world, and I successfully tried some samples, that I modified to work with Oracle in native OCI mode.
everything works well and I m impressed by the response time!!!!
my questions are the following:

1/ How to retrieve a global existing database and create the corresponding RestModel.  I tried SynDBExplorer and manually select some tables then it asks me to manage the joined file.
After I  generates thru the "To Object" button the Type model. seems to be work,  but I don't see see how it manages the joined information requested previously .
Maybe it s not the right way to generate a whole database to use SynDBExplorer ?


2/ I 'd like to publish this RestModel, as  a  webservice CRUD  to get or post Data in Json format. This is for external tool such as mobile application , or html5 + JS app wants to collect
and update datas . what is the best way or which sample can I use to derive from.

3/ In each Tsqlrecord, can i add some validation rules. So what is the best way , do we have some classes provided with the framework?


Thank for all  your  recommendation

eric fg

#2 mORMot 1 » Sample 16 - get the exception message » 2015-07-16 00:17:06

ericgarcia
Replies: 1

hello,

I am trying the sample 16 , connected to an oracle server.
when  an error is raised , a showexception method  is raised and message box show , with Json wrapped message.
how to get this  json message in an exception try/ except .

thanks

#3 mORMot 1 » Override AuthUser and AuthGroup » 2015-07-16 00:13:35

ericgarcia
Replies: 1

hello,

I am newbie in Mormot and every day discover, the power of this framework. Today I d like to do some authentification,
but i have my own tables for Group and User already created in Oracle. These tables are maintained thru my own application.

The Idea  is to be able at the init or starting of the server , to download an image of my securities in the mpormot tables
and then use the authentification thru TSQLRestServerFullMemory.
i don't know if it s the right approach.
some samples could be helpfull

thanks

#4 Re: mORMot 1 » Exception ESQLDBOracle : string buffer too small » 2015-07-13 18:00:41

After debugging the ProjectServer16http
finally i get errors when it is trying to execute the function  GetTableNames: TRawUTF8DynArray;
my  tnsnames.ora is as below
lsp45=
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 54.85.217.118)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = DFCASB)
    )
  )


the problem occured in SyndbOracle line 1845 at the statement:
Check(self,nil,TypeByName(fEnv,fError,fContext,Pointer(type_owner_name),length(type_owner_name),     Pointer(type_NymberListName),length(type_NymberListName),nil,0,OCI_DURATION_SESSION,OCI_TYPEGET_HEADER,     fType_numList),fError);

20150712 20384047  ! EXC   ESQLDBOracle {"Message":"TSQLDBOracleLib error: OCI-2
1560: argument 10 Null, non valide ou hors limites"} at 00705931  stack trace AP
I 005C0571 005C05A5 00007FFDC7299AB2 00007FFDC72982D3 00007FFDC729762D 00007FFDC
45A606C 00410526 004105A8 007083EB 006CA6E0 006C9AAA 006CF347 00739E63 006B3A88
006B3B55 00515AE5 005A7FC5 00742632 00007FFDC54A16AD 00007FFDC72AE954
571 005C05A5 00007FFDC7299AB2 00007FFDC72982D3 00007FFDC729762D 00007FFDC
45A606C 00410526 004105A8 007083EB 006CA6E0 006C9AAA 006CF347 00739E63 006B3A88
006B3B55 00515AE5 005A7FC5 00742632 00007FFDC54A16AD 00007FFDC72AE954

thanks for your help

#5 Re: mORMot 1 » oracle - OCI-21560 » 2015-07-13 00:47:49

Nope. finally i get errors when trying to connect.
I'd like to connect directly to my database without any tnsname.
But even the tnsnames is defines i get errors.
for instance my  tnsnames.ora is as below
lsp45=
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 54.85.217.118)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = DFCASB)
    )
  )

I am tying the sample 16 (client server). when executing the clientexe, I get the following results:
- server = lsp45
- database= blank or DFCASB

20150712 20384047  ! EXC   ESQLDBOracle {"Message":"TSQLDBOracleLib error: OCI-2
1560: argument 10 Null, non valide ou hors limites"} at 00705931  stack trace AP
I 005C0571 005C05A5 00007FFDC7299AB2 00007FFDC72982D3 00007FFDC729762D 00007FFDC
45A606C 00410526 004105A8 007083EB 006CA6E0 006C9AAA 006CF347 00739E63 006B3A88
006B3B55 00515AE5 005A7FC5 00742632 00007FFDC54A16AD 00007FFDC72AE954


server: my_ip_address
database: DFCASB
20150712 20424412  ! EXC   ESQLDBOracle {"Message":"TSQLDBOracleLib error: ORA-1
2504: TNS : le processus d'Ǹcoute n'a pas obtenu de SERVICE_NAME dans CONNECT_D
ATA"} at 00705931  stack trace API 005C0571 005C05A5 00007FFDC7299AB2 00007FFDC7
2982D3 00007FFDC729762D 00007FFDC45A606C 00410526 004105A8 007083EB 006CA6E0 006
C9AAA 006CF347 00739E63 006B3A88 006B3B55 00515AE5 005A7FC5 00742632 00007FFDC54
A16AD 00007FFDC72AE954


server : my_ip_address:1521/DFCASB
database:NULL
20150712 20445940  ! EXC   ESQLDBOracle {"Message":"TSQLDBOracleLib error: OCI-2
1560: argument 10 Null, non valide ou hors limites"} at 00705931  stack trace AP
I 005C0571 005C05A5 00007FFDC7299AB2 00007FFDC72982D3 00007FFDC729762D 00007FFDC
45A606C 00410526 004105A8 007083EB 006CA6E0 006C9AAA 006CF347 00739E63 006B3A88
006B3B55 00515AE5 005A7FC5 00742632 00007FFDC54A16AD 00007FFDC72AE954

thanks for your help

#6 Re: mORMot 1 » Exception ESQLDBOracle : string buffer too small » 2015-07-10 19:29:48

please explain me more in detail what do you think about. thanks
Use a shared PropsOracle := TSQLDBOracleConnectionProperties property, and call PropsOracle.NewThreadSafeStatementPrepared() within your methods services.

#7 mORMot 1 » Exception ESQLDBOracle : string buffer too small » 2015-07-09 23:56:32

ericgarcia
Replies: 4

hello,

1/ I am trying to connect to oracle and call a procedure with 2 parameters.
IN and OUT.  if the parameter out is a string or rawutf I get the following message when call the procedure at the statement ExecutePrepared.
When it's integer It works well.
I debug it on the PL/SQL side and the procedure is correctly excuted, but seems that the VARCHAR2 is not allocated.

Exception classe ESQLDBOracle with message TSQLDBORACLEstatement error ORA-06502: character string buffer too small

here some sub-set of code

 PropsOracle := TSQLDBOracleConnectionProperties.Create('DB','SID','USER','PWD');
  call:='select actcode,actnom,actid from acteur where actcode like ''AK0%''';
  query := 'BEGIN MYPROCEDURE(?, ?); END;';
  stmt := PropsOracle.NewThreadSafeStatementPrepared(query, false);
  stmt.BindTextS(1, call, paramIn); // call var string;
  stmt.BindTextS(2, res, paramOut); // res var string
  stmt.ExecutePrepared;

for information my procedure is declared as:

PROCEDURE MYPROCEDURE(   call              IN       varchar2,    retn             OUT     varchar2);

2/ General question:
I am newbie in mormot and I see that there is a lot of different  possibilities to create servers.
My first wish is to start a project able to reply to REST request from http.
so something like a console  server multi-thread based on the http.sys
in detail :
- start a basic authentification
- create a session oracle
- call procedure and get results (varchar, integer, no cursor)
. select , ... statements
.
.
. then close my session.

for the first time I don't want to use ORM possibilities. I will see later.
so I am looking for some piece of code or example, where I can  rely on .
anyway I love very much the Mormot concept.


thanks for your help

eric g

#8 Re: mORMot 1 » oracle - OCI-21560 » 2015-07-09 23:27:42

I am really sorry, but i did a mistake in the settings.
I used :TSQLDBOracleConnectionProperties.Create(//ip-address:port,'SID','USER','PWD');  and get the issue.
but when using
TSQLDBOracleConnectionProperties.Create('TNSDEF','SID','USER','PWD'); it works well.

thanks

eric

#9 mORMot 1 » oracle - OCI-21560 » 2015-07-08 00:06:06

ericgarcia
Replies: 3

hello,

i am trying to connect to oracle direct driver OCI, and get the following message:
projet synDBEXplorer raise exception in the class TSQLDBOracleLib error OCI-21560
argument null, non valide ou Hors limite.
I am using instantclient 12.1 connect to Oracle server 11g
thanks for your help

eric g.

Board footer

Powered by FluxBB