Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-12

Oracle driving me crazy - please provide dried frog pills[1]

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Olislagers

Been fiddling with the Oracle connector.

This:
using the scott schema on Oracle 10g, this works fine in my JDBC query GUI and in sql*plus:
select * from scott.emp where JOB='CLERK';

However, in code (FPC trunk x86, Windows), this:
Q.SQL.Text:='select * from EMP WHERE JOB=''CLERK'';'; gives ORA-00911: invalid character!?!?
(with the 11g instant client)

What am I doing wrong?

Program can be downloaded here:
https://bitbucket.org/reiniero/fpc_laz_patch_playground/downloads/dberror.lpr

[1] If you're not a Terry Pratchett fan, never mind...

Tomas Hajny
to Reinier Olislagers
Reinier Olislagers wrote 16 lines
Been fiddling with the Oracle connector. This: using the scott schema on Oracle 10g, this works fine in my JDBC query GUI and in sql*plus: select * from scott.emp where JOB='CLERK'; However, in code (FPC trunk x86, Windows), this: Q.SQL.Text:='select * from EMP WHERE JOB=''CLERK'';'; gives ORA-00911: invalid character!?!? (with the 11g instant client) What am I doing wrong? Program can be downloaded here: https://bitbucket.org/reiniero/fpc_laz_patch_playground/downloads/dberror.lpr

I don't know what you're doing wrong, but I'd try excluding the semicolon.

Tomas

Ludo Brands
to Reinier Olislagers: Been fiddling with the Oracle connector. This: using the scott schema on Oracle 10g, this…
Reinier Olislagers wrote 18 lines
Been fiddling with the Oracle connector. This: using the scott schema on Oracle 10g, this works fine in my JDBC query GUI and in sql*plus: select * from scott.emp where JOB='CLERK'; However, in code (FPC trunk x86, Windows), this: Q.SQL.Text:='select * from EMP WHERE JOB=''CLERK'';'; gives ORA-00911: invalid character!?!? (with the 11g instant client) What am I doing wrong? Program can be downloaded here: https://bitbucket.org/reiniero/fpc_laz_patch_playground/downloads/dberror.lpr

Get rid of the trailing semi-colon which is only meant for the sql client. See also
http://social.msdn.microsoft.com/Forums/en/adodotnetdataproviders/thread/58a27505-a3fb-4cb1-9063-3946b3f26acd.

Ludo

Reinier Olislagers
to Tomas Hajny: I don't know what you're doing wrong, but I'd try excluding the semicolon. Tomas
Tomas Hajny wrote 20 lines
On Mon, December 3, 2012 16:44, Reinier Olislagers wrote: > Been fiddling with the Oracle connector. > > This: > using the scott schema on Oracle 10g, this works fine in my JDBC query > GUI and in sql*plus: > select * from scott.emp where JOB='CLERK'; > > However, in code (FPC trunk x86, Windows), this: > Q.SQL.Text:='select * from EMP WHERE JOB=''CLERK'';'; > gives ORA-00911: invalid character!?!? > (with the 11g instant client) > > What am I doing wrong? > > Program can be downloaded here: > https://bitbucket.org/reiniero/fpc_laz_patch_playground/downloads/dberror.lpr I don't know what you're doing wrong, but I'd try excluding the semicolon.

Thanks, Tomas, did that already - no effect.

Reinier Olislagers
to Reinier Olislagers
Reinier Olislagers wrote 5 lines
On 3-12-2012 17:17, Tomas Hajny wrote: > I don't know what you're doing wrong, but I'd try excluding the semicolon. > Thanks, Tomas, did that already - no effect.

Oops - blast - had used old .exe version & forgot to copy newly compiled version so the removed ; never made it.

Thanks Tomas & Ludo - removing the last ; indeed works!