aspose file tools*
The moose likes JDBC and the fly likes PL / SQL BLOCK EXECUTION Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "PL / SQL BLOCK EXECUTION" Watch "PL / SQL BLOCK EXECUTION" New topic
Author

PL / SQL BLOCK EXECUTION

Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
I have written a PL SQL block of code and tried to execute it with a /.

My SQL file had a space before the / and it resulted in syntax error.

The same file worked in another environment. I am not sure if both the environments are having same version for oracle client.

My questions are

-- Is it a violation of SQL to have a space before /

-- if any one version of oracle client does remove the space before /

Any thoughts / suggestions will be appreciated.
Paul Campbell
Ranch Hand

Joined: Oct 06, 2007
Posts: 338
I think you need to be asking this in the oracle forum... but are you trying to execute the block in sqlplus?

a line with a single . followed with a line that says run; works for me.

could you post your code and how you're executing it?
Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
Thanks for the response.

I think there are two ways to execute a block of code.

I was having the SQL block following by a / in a new line.

My only issue was there was a space before / and it failed.

I am using oracle client 8.1.7.

my question is, i want to know if a space before / is a problem.

I ran in SQL PLUS also and it resulted in error when i had a space before /
Paul Campbell
Ranch Hand

Joined: Oct 06, 2007
Posts: 338
in sqlplus it is a slash (/) on the line with no spaces.
Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
Thanks.

But it was working in one environment and not working in another environment.

so, i was wondering if this has got to do with different version of oracle.
Paul Campbell
Ranch Hand

Joined: Oct 06, 2007
Posts: 338
Originally posted by Vicky Mohan:
Thanks.

But it was working in one environment and not working in another environment.

so, i was wondering if this has got to do with different version of oracle.


I don't have an answer except that is quite possibly an issue with using an old Oracle release (8 is no longer supported)... It isn't really anything I think is going to be terribly worthwhile in getting a definitive answer for what is probably an 8x issue. I would just go with the code that worked in both environments.

here is the link to the command reference for sqlplus.

http://download.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1011097
[ October 07, 2008: Message edited by: Paul Campbell ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PL / SQL BLOCK EXECUTION