You are viewing
apoorvs's journal
SELECT
C,C,KCU,C2,C2,C2,KCU2,RC,RC,C,C2
C.TABLE_CATALOG [PKTABLE_QUALIFIER], .TABLE_SCHEMA [PKTABLE_OWNER], .TABLE_NAME [PKTABLE_NAME], .COLUMN_NAME [PKCOLUMN_NAME], .TABLE_CATALOG [FKTABLE_QUALIFIER], .TABLE_SCHEMA [FKTABLE_OWNER], .TABLE_NAME [FKTABLE_NAME], .COLUMN_NAME [FKCOLUMN_NAME], .UPDATE_RULE, .DELETE_RULE, .CONSTRAINT_NAME [FK_NAME], .CONSTRAINT_NAME [PK_NAME], CAST(7 AS SMALLINT) [DEFERRABILITY]FROM
INFORMATION_SCHEMA
.TABLE_CONSTRAINTS C INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU ON C.CONSTRAINT_SCHEMA = KCU.CONSTRAINT_SCHEMA AND C.CONSTRAINT_NAME = KCU.CONSTRAINT_NAME INNER JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS RC ON C.CONSTRAINT_SCHEMA = RC.CONSTRAINT_SCHEMA AND C.CONSTRAINT_NAME = RC.CONSTRAINT_NAME INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS C2 ON RC.UNIQUE_CONSTRAINT_SCHEMA = C2.CONSTRAINT_SCHEMA AND RC.UNIQUE_CONSTRAINT_NAME = C2.CONSTRAINT_NAME INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU2 ON C2.CONSTRAINT_SCHEMA = KCU2.CONSTRAINT_SCHEMA AND C2.CONSTRAINT_NAME = KCU2.CONSTRAINT_NAME AND KCU.ORDINAL_POSITION = KCU2.ORDINAL_POSITIONWHERE
C.CONSTRAINT_TYPE = 'FOREIGN KEY'http://localhost:8888/$utils/peek.html
Create DB: A database must be named with all lowercase characters (a-z), digits (0-9), or any of these characters `_$()+-/` and must end with a slash in the URL.
1> [info] [<0.152.0>] HTTP Request: PUT /try1/ HTTP/1.1
Header:[{"cache-control","no-cache"},
{"connection","Keep-Alive"},
{"content-length","0"},
{"host","localhost:8888"},
{"user-agent",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0
.50727; .NET CLR 3.0.04506; .NET CLR 1.1.4322; MS-RTC LM 8)"},
{"accept-encoding","gzip, deflate"},
{"ua-cpu","x86"},
{"referer","http://localhost:8888/$utils/peek.html"},
{"accept-language","en-us"},
{"accept","*/*"}]
1> [info] [<0.152.0>] HTTP Response Code:201
Create document:
1> [info] [<0.165.0>] HTTP Request: POST /try1/ HTTP/1.1
Header:[{"cache-control","no-cache"},
{"connection","Keep-Alive"},
{"content-length","142"},
{"host","localhost:8888"},
{"user-agent",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0
.50727; .NET CLR 3.0.04506; .NET CLR 1.1.4322; MS-RTC LM 8)"},
{"accept-encoding","gzip, deflate"},
{"ua-cpu","x86"},
{"content-type","text/xml; charset=UTF-8"},
{"referer","http://localhost:8888/$utils/peek.html"},
{"accept-language","en-us"},
{"accept","*/*"}]
1> [info] [<0.165.0>] HTTP Response Code:201
<?xml version="1.0" ?>
- <doc id="60CF2C862F0EB074646574E28DD71919" rev="D4BA5040" xmlns="http://couchdb.org/doc">
- <field name="FirstName">
<text>Apoorv</text>
</field>
- <field name="LastName">
<text>Shrivastava</text>
</field>
</doc>
Create table:
/* Tables are just special documents, but don't forget to give them unique names! */
* Set the table statement. You can use the fabric language for that.
* Note that every field has to start with $table_ !
*/
select statement: select *
Oops!
<?xml version="1.0" ?>
- <doc id="1" rev="F2CD1E07" xmlns="http://couchdb.org/doc">
- <field name="$table_$table_1">
<text>select *</text>
</field>
</doc>
now:
Table id : 60CF2C862F0EB074646574E28DD71919
Table name : keeda_tablewithidsameasanotherexistingdo
Select Statement : select *
1> [info] [<0.214.0>] HTTP Request: POST /try1/ HTTP/1.1
Header:[{"cache-control","no-cache"},
{"connection","Keep-Alive"},
{"content-length","171"},
{"host","localhost:8888"},
{"user-agent",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0
.50727; .NET CLR 3.0.04506; .NET CLR 1.1.4322; MS-RTC LM 8)"},
{"accept-encoding","gzip, deflate"},
{"ua-cpu","x86"},
{"content-type","text/xml; charset=UTF-8"},
{"referer","http://localhost:8888/$utils/peek.html"},
{"accept-language","en-us"},
{"accept","*/*"}]
1> [info] [<0.214.0>] -HTTP Error-
Response Code: 409.
Error id: conflict
Error message: conflict
1> [info] [<0.214.0>] HTTP Response Code:409
Haiku Operating System rocks! Absolutely!!
Always wanted to try the BeOS ... read a lot, couldn't touch it. Great work!
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 |