Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: dbms_scheduler and ora-01756

Re: dbms_scheduler and ora-01756

From: himzo <asmir.biscevic_at_gmail.com>
Date: 3 Apr 2007 01:15:51 -0700
Message-ID: <1175588151.364330.103210@p15g2000hsd.googlegroups.com>


On Apr 3, 9:00 am, "himzo" <asmir.bisce..._at_gmail.com> wrote:
> On Apr 2, 8:26 pm, Frank van Bortel <frank.van.bor..._at_gmail.com>
> wrote:
>
>
>
> > himzo schreef:
>
> > > This is my code:
>
> > > call dbms_scheduler.create_program(
> > > program_name=>'RESET_MEMBERNUMBER',
> > > program_action=>
> > > 'BEGIN
> > > EXECUTE IMMEDIATE ''drop sequence membernumber_seq'';
> > > EXECUTE IMMEDIATE ''CREATE SEQUENCE MEMBERNUMBER_SEQ INCREMENT BY 1
> > > START WITH 10000 MAXVALUE 9999999 MINVALUE 10000 NOCYCLE NOCACHE'';
> > > END;',
> > > program_type=>'PLSQL_BLOCK',
> > > number_of_arguments=>0,
> > > enabled=>TRUE,
> > > comments=>'');
>
> > > Line: EXECUTE IMMEDIATE ''drop sequence membernumber_seq''; produces
> > > an ora-01756 error message - quoted string not properly terminated.
> > > I'm using two single quotes after each other so that the second one is
> > > being escaped by the first one.
>
> > > Note: After I paste my code into a development tool, this works
> > > excellent, but as soon I put this into a script so that sqlplus can
> > > execute it, it fails.
>
> > > Help
>
> > You need to 'escape' the quotes within you exec immediate:
> > EXECUTE IMMEDIATE '''drop sequence membernumber_seq''';
> > That is three quotes in a row (in order to produce one)
> > --
> > Regards,
> > Frank van Bortel
>
> > Top-posting is one way to shut me up...
>
> This didn't help. I get exactly the same error...

I have just solved this. Sql*plus wasn't happy with the use of "call"- statement and it wanted BEGIN/END around the whole code. Thank you for suggestions. Received on Tue Apr 03 2007 - 03:15:51 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US