Re: Create New Data Type
Posted by: larry williams
Date: May 14, 2012 12:21PM

In order to create a new data type, you need to be familiar with both the sql_yacc.yy and the lex.h files. Understanding these files, how they are converted into sql_yacc.cc, sql_yacc.h and lex_hash.h is critical, but not the point of this response. Understanding these files and how to use them is the first step. I am starting with 'step 2'.

In sql_yacc:

Add a 'token' for your data type. Notice that the token list is alphabetical. Keep it this way.
%token MYTYPE /* LRW TYPE */

In the '%type <NONE>' section, add the reference for your new data type. I admit that I do not understand this section and its purpose, but I needed include my type here. Notice that there are other 'non-base' data type declarations here too.

ref_list opt_match_clause opt_on_update_delete use
--> mytype opt_delete_options opt_delete_option varchar
nchar nvarchar opt_outer table_list table_name
table_alias_ref_list

Options: Reply• Quote


Subject
Views
Written By
Posted
3515
March 24, 2012 09:31AM
1352
March 26, 2012 10:38AM
1280
March 26, 2012 04:50PM
1124
March 26, 2012 12:26PM
1312
March 26, 2012 04:51PM
1339
March 26, 2012 06:55PM
1246
March 31, 2012 05:04AM
1379
April 01, 2012 09:15AM
1323
April 01, 2012 12:11PM
1361
April 03, 2012 09:45AM
1433
April 04, 2012 11:05AM
Re: Create New Data Type
1471
May 14, 2012 12:21PM
2125
May 14, 2012 12:53PM
1376
March 26, 2012 01:32AM
1396
June 23, 2012 08:18AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.