SQuirreL (just like Oracle's SQL-Plus) needs to know when you have finished
you anonymous procedure. That is usually done by adding a line at the end
of your procedure with a sinlge slash (/) character. For example:
DECLARE
v1 NUMBER(3);
BEGIN
v1 := 3;
select 1 from dual
END;
/
Note: you will need to highlight the entire procedure since there are 2 eol
characters between the semi-colon of the number declaration and the BEGIN
keyword.
Rob
On Thu, Dec 22, 2011 at 7:53 AM, Matheus Garcia <
mat...@al...> wrote:
> Hi all,
>
> I'm used to create and run SQL scripts in Microsoft SQL Server with
> Query Analyser tool, something simple just like declaring some
> variables, setting their values and using them on sql queries. Like the
> following example:
>
> DECLARE
> @foo INTEGER
> SET @foo = 1
> INSERT INTO mytable (foofield) value (@foo)
>
> Although I saw it's possible to do something like that in Oracle PL-SQL,
> I couldn't run any samples I got on internet in SQuirrel SQL. My oracle
> connection is correctly configured, I can run simple sql commands, but
> when I try to somethibng like the the following code:
>
> DECLARE
> v1 NUMBER(3);
>
> BEGIN
> v1 := 3;
> select 1 from dual
> END;
>
> the DECLARE keywork appears in red, and when I try to run I got the
> following error: "java.lang.IllegalArgumentException: No SQL selected
> for execution."
>
> Could any of you please give me some help on doing that? Or running
> scripts these way is not supported on Squirrel?
>
> Best regards,
> Matheus
>
>
>
>
>
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev
> _______________________________________________
> Squirrel-sql-users mailing list
> Squ...@li...
> https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
>
|