---- sebb <[email protected]> wrote: 
> On 25 May 2014 18:19,  <[email protected]> wrote:
> > Hi,
> >
> > I am trying to use Jmeter 2.11 to load test against Oracle database.
> >
> > I can use a SELECT query in the JDBC Request and that works fine, but when 
> > I try the following:
> >
> > exec DBMS_SESSION.set_identifier('frank')
> >
> > I get:
> >
> > Response message: java.sql.SQLException: ORA-00900: invalid SQL statement
> >
> > However, if I run that EXEC command using sqlplus, it works fine.
> >
> > Does Jmeter not allow using the EXEC command in a JDBC request?
> 
> An EXEC command is not a Select statement; it is not in fact standard SQL.
> 
> However, according to
> 
> http://docs.oracle.com/cd/E11882_01/java.112/e16548/getsta.htm#JJDBC28075
> 
> the Oracle JDBC driver supports them using the syntax
> 
> {call DBMS_SESSION.set_identifier('frank')}
> 
> This needs to be invoked in JMeter using the Callable Statement option.
> 
> > I tried putting this in a BEGIN...END:
> >
> > BEGIN
> > exec DBMS_SESSION.set_identifier('frank');
> > select * from employees;
> > END;
> >
> > but then I got:
> >
> > Response message: java.sql.SQLException: ORA-06550: line 2, column 6:
> > PLS-00103: Encountered the symbol "DBMS_SESSION" when expecting one of the 
> > following:
> >
> >    := . ( @ % ;
> > The symbol ":=" was substituted for "DBMS_SESSION" to continue.
> >
> > Is there a way that this can be done with Jmeter?
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 


As you suggested, I tried as a Callable Statement:

{call DBMS_SESSION.set_identifier('jim')}

and got:

Thread Name: Thread Group 1-1
Sample Start: 2014-05-26 00:43:16 EDT
Load time: 3
Latency: 1
Size in bytes: 40
Headers size in bytes: 0
Body size in bytes: 40
Sample Count: 1
Error Count: 1
Response code: 72000 1006
Response message: java.sql.SQLException: ORA-01006: bind variable does not exist


Response headers:
oracle.jdbc.driver.OracleConnection@6735fad1

SampleResult fields:
ContentType: text/plain
DataEncoding: UTF-8

Actually, for the test, I really need to do the DBMS_SESSION.set_identifier, 
followed by a "select * from employees".  

Can I do those in the JDBC Request with the Query Type set to Callable 
Statement, and if so, how?

Thanks,
Jim

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to