<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sybase Guru &#187; Standard of Sybase</title>
	<atom:link href="http://sybaseguru.freetimelabs.com/category/standard-of-sybase/feed/" rel="self" type="application/rss+xml" />
	<link>http://sybaseguru.freetimelabs.com</link>
	<description>All about Sybase DB</description>
	<lastBuildDate>Sat, 13 Jun 2009 08:44:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sybase Exception Handling Standard</title>
		<link>http://sybaseguru.freetimelabs.com/2009/05/sybase-exception-handeling-standard/</link>
		<comments>http://sybaseguru.freetimelabs.com/2009/05/sybase-exception-handeling-standard/#comments</comments>
		<pubDate>Thu, 14 May 2009 11:13:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Standard of Sybase]]></category>

		<guid isPermaLink="false">http://sybaseguru.freetimelabs.com/?p=84</guid>
		<description><![CDATA[Exception Handlers:
In SQL server the errors are always written to sysmessages table, so no exception can be handled here.  The type of access to the SQL server from the front end determines the state of the error and how the error information can be retrieved.
Eg.
a).  For ODBC type of access the error messages are [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Exception Handlers:</strong></p>
<p>In SQL server the errors are always written to sysmessages table, so no exception can be handled here.  The type of access to the SQL server from the front end determines the state of the error and how the error information can be retrieved.</p>
<p>Eg.</p>
<p>a).  For ODBC type of access the error messages are stored in the  SQLError object of the SQL server, the front end should query that object to get the error message.</p>
<p>b).  For OLE-DB type of access the error messages are stored in the <strong>ISQLServerErrorInfo</strong> object. So the<strong> OLE-DB</strong> provider library</p>
<p><code>RAISERROR('Test Only',  1,  2) WITH SETERROR<br />
SELECT @@ERROR<br />
RAISERROR (101,  1,  2) WITH SETERROR<br />
SELECT @@ERROR<br />
Here is the result set:<br />
Msg 50000,  Level 1,  State 50000<br />
Test Only<br />
-----------<br />
50000<br />
(1 row(s) affected)<br />
Msg 101,  Level 1,  State 101<br />
Line 0: SQL syntax error.<br />
-----------<br />
101<br />
(1 row(s) affected)<br />
</code><br />
The first RAISERROR returns an @@ERROR value of 50000. The second returns the syntax error message used by Microsoft® SQL Server™ with an @@ERROR value of 101.</p>
<p><strong>Formatting T-SQL Blocks:</strong></p>
<p><strong>T-SQL</strong> blocks have the following sections:</p>
<ol>
<li> Header</li>
<li> Declaration section</li>
<li> Executable section.</li>
<li> Exception section.</li>
</ol>
<p><code>PROCEDURE  (Parameters)<br />
RETURN DATATYPE<br />
AS<br />
Variables DATATYPE;</code></p>
<p><code>BEGIN<br />
Executable_statements;<br />
If err then goto Err_block<br />
RETURN Value</code></p>
<p><code>Err_block:<br />
Process error and return the error string<br />
END<br />
GO</code></p>
<p>Recommendations:</p>
<ol>
<li>All the executable statements after the <strong>BEGIN</strong> and error handling block are indented in from the <strong>BEGIN</strong></li>
<li>Include a blank line after each section.</li>
<li>IS statement to be on a new line where everused.</li>
</ol>
<p><strong>Formatting SQL  statement:</strong></p>
<table style="height: 129px;" border="1" cellspacing="0" cellpadding="0" width="506" bordercolor="#000000">
<tbody>
<tr>
<td class="bold" width="250" height="28">
<div style="text-align: center;"><strong>SELECT</strong></div>
</td>
<td class="bold" style="text-align: center;" width="250"><strong>INSERT</strong></td>
<td class="bold" width="250">
<div class="bold" style="text-align: center;"><strong>UPDATE</strong></div>
</td>
<td class="bold" style="text-align: center;" width="250"><strong>DELETE</strong></td>
</tr>
<tr>
<td class="klasher" height="26">SELECT  FROM WHERE GROUP BY HAVING ORDER BY</td>
<td class="klasher">
<div class="bold">INSERT INTO VALUES OR INSERT INTO SELECT</div>
</td>
<td class="klasher">UPDATE SET WHERE</td>
<td class="klasher">
<div class="bold">DELETE FROM WHERE</div>
</td>
</tr>
</tbody>
</table>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://sybaseguru.freetimelabs.com/2009/05/sybase-exception-handeling-standard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sybase Column Creation Standard</title>
		<link>http://sybaseguru.freetimelabs.com/2009/05/sybase-column-creation-standard/</link>
		<comments>http://sybaseguru.freetimelabs.com/2009/05/sybase-column-creation-standard/#comments</comments>
		<pubDate>Tue, 12 May 2009 11:34:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Standard of Sybase]]></category>

		<guid isPermaLink="false">http://sybaseguru.freetimelabs.com/?p=40</guid>
		<description><![CDATA[Standard to create the columns:

 The column name should be of the form XX&#60;Abbr/Name&#62;&#60;suffix&#62; (XXX represents the abbreviation of the Table Name.It should be a meaningful abbreviation of the table name to which the column belongs.&#60;suffix&#62; is a meaningful suffix).
Column name should  not be  longer than 30  Alphanumeric characters.
Column name (&#60;Abbr/Name&#62; only) should be same throughout an  application [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Standard to create the columns:</strong></p>
<ol>
<li> The column name should be of the form <strong>XX&lt;Abbr/Name&gt;&lt;suffix&gt;</strong> (<strong>XXX</strong> represents the abbreviation of the Table Name.It should be a meaningful abbreviation of the table name to which the column belongs.<strong>&lt;suffix&gt;</strong> is a meaningful suffix).</li>
<li>Column name should  not be  longer than 30  Alphanumeric characters.</li>
<li>Column name (<strong>&lt;Abbr/Name&gt; only</strong>) should be same throughout an  application even though the field may be present in more than one table.</li>
</ol>
<p>The following suffixes can be used for better understanding.</p>
<table style="height: 292px;" border="1" width="457">
<tbody>
<tr>
<td style="text-align: left;"><strong>ata </strong></td>
<td><strong>Suffix</strong></td>
</tr>
<tr>
<td>CODES</td>
<td>Code</td>
</tr>
<tr>
<td>IDENTIFIER</td>
<td>Id</td>
</tr>
<tr>
<td>INDICATOR/FLAG</td>
<td>Flag</td>
</tr>
<tr>
<td>AMOUNT</td>
<td>Amount</td>
</tr>
<tr>
<td>RATES</td>
<td>Rate</td>
</tr>
<tr>
<td>KEY</td>
<td>Key</td>
</tr>
<tr>
<td>Number</td>
<td>Number</td>
</tr>
<tr>
<td>Name</td>
<td>Name</td>
</tr>
<tr>
<td>Type</td>
<td>Type</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://sybaseguru.freetimelabs.com/2009/05/sybase-column-creation-standard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sybase Tables Creation Standard</title>
		<link>http://sybaseguru.freetimelabs.com/2009/05/sybase-table-standard-review/</link>
		<comments>http://sybaseguru.freetimelabs.com/2009/05/sybase-table-standard-review/#comments</comments>
		<pubDate>Tue, 12 May 2009 07:14:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Standard of Sybase]]></category>

		<guid isPermaLink="false">http://sybaseguru.freetimelabs.com/?p=18</guid>
		<description><![CDATA[Standards to create the tables:

The table name should be the same as the logical entity name or should bear some significance to the data stored therein.
The table must have a primary key that uniquely identifies each row.
The column names will be same as logical attribute name.
Columns must be defined as NOT NULL wherever possible.
Table names [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Standards to create the tables:</strong></p>
<ol>
<li>The table name should be the same as the logical entity name or should bear some significance to the data stored therein.</li>
<li>The table must have a primary key that uniquely identifies each row.</li>
<li>The column names will be same as logical attribute name.</li>
<li>Columns must be defined as NOT NULL wherever possible.</li>
<li>Table names should be no more than 30 alphanumeric characters.</li>
</ol>
<p>For Examples creating the tables : AccountMaster , CashBalance , TransactionDetail</p>
<p><strong>Guidelines to create the tables:</strong></p>
<ol>
<li>Keep table names to around 20 characters. This will prevent the truncation of table name in the naming of other objects that contain the table name as part of the object name. e.g. Indexes</li>
<li>Columns may only be denormalized to improve performance, but this should be very carefully balanced against the additional update that may be required.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sybaseguru.freetimelabs.com/2009/05/sybase-table-standard-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
