difference between a User and a Schema in Oracle?

From Ask Tom

You should consider a schema to be the user account and collection of all objects therein as a schema for all intents and purposes.

SCOTT is a schema that includes the EMP, DEPT and BONUS tables with various grants, and other stuff.

SYS is a schema that includes tons of tables, views, grants, etc etc etc.

SYSTEM is a schema…..

Technically — A schema is the set of metadata (data dictionary) used by the database, typically generated using DDL. A schema defines attributes of the database, such as tables, columns, and properties. A database schema is a description of the data in a database.

http://stackoverflow.com/questions/880230/difference-between-a-user-and-a-schema-in-oracle

Execute Statement or Run Script?

Run Statement will give you a list of all the results in a sortable table. It will also only run the statement under the cursor (or highlighted). You will be prompted for bind variables when you run the statement (any place holder with : in front of it).

E.g.

select * from customers where customer_id = :id

will prompt for a value for id

Run Script will execute all statements in the worksheet, and give a text readout of the results. It will not prompt you for the values of bind variables.

http://stackoverflow.com/questions/479408/execute-statement-or-run-script

SQL*Plus Tip: @ vs. @@

I built huge amounts of PL/SQL code with SQL*Plus, using the ‘@’ command to import source files, without ever running across the ‘@@’ command. But one day I found a limitation in ‘@’, and in one fell swoop changed all my SQL and PL/SQL scripts to use ‘@@’ and have never looked back.

You need ‘@@’ if you ever want to compile source code by running SQL*Plus from a different directory. For example, I had source files that would call each other like so:

@variables;
@file1;
@file2;

and it all worked fine, as long as I went into the directory where all the files were and ran SQL*Plus from there.

But to automate my build process, I started running various scripts from a different directory, such as:

sqlplus $credentials source/file1.sql

For file1.sql to be able to import file2.sql and so on, I needed to use ‘@@’. With ‘@@’, all the import commands are processed relative to the directory where the original file sits, not the directory where you run SQL*Plus.

http://tahitiviews.blogspot.com/2007/01/sqlplus-tip-vs.html

java array traversal in circular manner

int start = ...
for (int i = 0; i < a.length; i++) {
    System.out.println(a[(i + start) % a.length]);
}

I should note that this is probably not the most efficient way of expressing the loop … in terms of execution speed. However, the difference is small, and most likely irrelevant.

A more relevant point is whether using % in this way gives more readable code. I think it does, but maybe that’s because I’ve seen / used this particular idiom before.

http://stackoverflow.com/questions/8651965/java-array-traversal-in-circular-manner

When executing a script on SQLPlus, it prints a sequence of numbers instead of output

From your edited question… you have to terminate the PL/SQL block with a / on a new line to make it end and run, otherwise SQL*Plus will keep prompting for more lines of code (which is the numbers you’re seeing). The documentation shows how to run PL/SQL blocks. And prompt is a SQL*Plus command so you can’t use it inside a PL/SQL block. You also don’t have your block syntax right:

SET serveroutput ON;
DECLARE
    mode NUMBER(1) := 1;
BEGIN
    IF mode = 1 THEN
        DBMS_OUTPUT.PUT_LINE('HERE');    
    END IF;
END;
/

prompt fim

http://stackoverflow.com/questions/20971731/when-executing-a-script-on-sqlplus-it-prints-a-sequence-of-numbers-instead-of-o

How to let TortoiseHg (Mercurial) on Windows use the Private Key file generated (by Puttygen)?

From the answer almost the same question at stackoverflow.com (by David Tischler):

Add the following to the [ui]-section of the mercurial.ini in your home directory:

[ui]
ssh = tortoiseplink.exe -ssh -i "C:\Users\UserName\mykey.ppk"

Or if you want to specify your ssh username, add

[ui]
ssh = tortoiseplink.exe -ssh -i "C:\Users\UserName\mykey.ppk" -l myusername

(assuming your key is in “C:\Users\UserName\mykey.ppk”).

Pageant (already mentioned by others) should work also (even though I haven’t tried it myself).

http://serverfault.com/questions/147136/how-to-let-tortoisehg-mercurial-on-windows-use-the-private-key-file-generated