forked from orientechnologies/orientdb-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
90 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!-- proofread 2015-01-05 SAM --> | ||
<!-- proofread 2015-01-06 SAM --> | ||
|
||
### Administration | ||
_____ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,55 @@ | ||
# Console - `BEGIN` | ||
|
||
Initiates a transaction. When a transaction is open, any commands you execute on the database remain temporary. In the event that you are satisfied with the changes, you can call the [`COMMIT`](Console-Command-Commit.md) command to commit them to the database. Otherwise, you can call the [`ROLLBACK`](Console-Command-Rollback.md) command, to roll the changes back to the point where you called [`BEGIN`](Console-Command-Begin.md). | ||
|
||
**Syntax:** | ||
|
||
```sql | ||
BEGIN | ||
``` | ||
|
||
**Examples** | ||
|
||
- Begin a transaction: | ||
|
||
<pre> | ||
orientdb> <code class="lang-sql userinput">BEGIN</code> | ||
|
||
Transaction 1 is running | ||
</pre> | ||
|
||
- Attempting to begin a transaction when one is already open: | ||
|
||
<pre> | ||
orinetdb> <code class='lang-sql userinput'>BEGIN</code> | ||
|
||
Error: an active transaction is currently open (id=1). Commit or rollback | ||
before starting a new one. | ||
</pre> | ||
|
||
- Making changes when a transaction is open: | ||
|
||
<pre> | ||
orientdb> <code class="lang-sql userinput">INSERT INTO Account (name) VALUES ('tx test')</code | ||
Inserted record 'Account#9:-2{name:tx test} v0' in 0,004000 sec(s). | ||
orientdb> <code class="lang-sql userinput">SELECT FROM Account WHERE name LIKE 'tx%'</code> | ||
|
||
---+-------+---------- | ||
# | RID | name | ||
---+-------+---------- | ||
0 | #9:-2 | tx test | ||
---+-------+---------- | ||
</pre> | ||
|
||
When a transaction is open, new records all have temporary Record ID's, which are given negative values, (for instance, `#9:-2` above). These remain in effect until you run [`COMMIT`](Console-Command-Commit.md) | ||
|
||
>For more information on Transactions, see | ||
>- [Transactions](Transactions.md) | ||
>- [Console Command COMMIT](Console-Command-Commit.md) | ||
>- [Console Command ROLLBACK](Console-Command-Rollback.md) | ||
>- [Console Commands](Console-Commands.md) | ||
<!-- proofread 2015-01-06 SAM --> | ||
|
||
# Console - `BEGIN` | ||
|
||
Initiates a transaction. When a transaction is open, any commands you execute on the database remain temporary. In the event that you are satisfied with the changes, you can call the [`COMMIT`](Console-Command-Commit.md) command to commit them to the database. Otherwise, you can call the [`ROLLBACK`](Console-Command-Rollback.md) command, to roll the changes back to the point where you called [`BEGIN`](Console-Command-Begin.md). | ||
|
||
**Syntax:** | ||
|
||
```sql | ||
BEGIN | ||
``` | ||
|
||
**Examples** | ||
|
||
- Begin a transaction: | ||
|
||
<pre> | ||
orientdb> <code class="lang-sql userinput">BEGIN</code> | ||
|
||
Transaction 1 is running | ||
</pre> | ||
|
||
- Attempting to begin a transaction when one is already open: | ||
|
||
<pre> | ||
orinetdb> <code class='lang-sql userinput'>BEGIN</code> | ||
|
||
Error: an active transaction is currently open (id=1). Commit or rollback | ||
before starting a new one. | ||
</pre> | ||
|
||
- Making changes when a transaction is open: | ||
|
||
<pre> | ||
orientdb> <code class="lang-sql userinput">INSERT INTO Account (name) VALUES ('tx test')</code | ||
Inserted record 'Account#9:-2{name:tx test} v0' in 0,004000 sec(s). | ||
orientdb> <code class="lang-sql userinput">SELECT FROM Account WHERE name LIKE 'tx%'</code> | ||
|
||
---+-------+---------- | ||
# | RID | name | ||
---+-------+---------- | ||
0 | #9:-2 | tx test | ||
---+-------+---------- | ||
</pre> | ||
|
||
When a transaction is open, new records all have temporary Record ID's, which are given negative values, (for instance, like the `#9:-2` shown above). These remain in effect until you run [`COMMIT`](Console-Command-Commit.md) | ||
|
||
For more information on Transactions, see | ||
|
||
- [Transactions](Transactions.md) | ||
- [Console Command COMMIT](Console-Command-Commit.md) | ||
- [Console Command ROLLBACK](Console-Command-Rollback.md) | ||
- [Console Commands](Console-Commands.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
# Console - `BROWSE CLASS` | ||
|
||
Displays all records associated with the given class. | ||
|
||
**Syntax:** | ||
|
||
``` | ||
BROWSE CLASS <class-name> | ||
``` | ||
|
||
- **`<class-name>`** Defines the class for the records you want to display. | ||
|
||
**Example:** | ||
|
||
- Browse records associated with the class `City`: | ||
|
||
<pre> | ||
orientdb> <code class="lang-sql userinput">BROWSE CLASS City</code> | ||
|
||
----+------+------------------- | ||
# | RID | NAME | ||
----+------+------------------- | ||
0 | -6:0 | Rome | ||
1 | -6:1 | London | ||
2 | -6:2 | Honolulu | ||
----+------+------------------- | ||
</pre> | ||
|
||
>For more information on other commands, see [Console Commands](Console-Commands.md). | ||
<!-- proofread 2015-01-06 SAM --> | ||
|
||
# Console - `BROWSE CLASS` | ||
|
||
Displays all records associated with the given class. | ||
|
||
**Syntax:** | ||
|
||
``` | ||
BROWSE CLASS <class-name> | ||
``` | ||
|
||
- **`<class-name>`** Defines the class for the records you want to display. | ||
|
||
**Example:** | ||
|
||
- Browse records associated with the class `City`: | ||
|
||
<pre> | ||
orientdb> <code class="lang-sql userinput">BROWSE CLASS City</code> | ||
|
||
----+------+------------------- | ||
# | RID | NAME | ||
----+------+------------------- | ||
0 | -6:0 | Rome | ||
1 | -6:1 | London | ||
2 | -6:2 | Honolulu | ||
----+------+------------------- | ||
</pre> | ||
|
||
For more information on other commands, see | ||
|
||
- [Console Commands](Console-Commands.md). | ||
|