v1.6 - character field Primary Key unsupported?

A

Ap.Muthu

Guest
I created a table with a character (CHAR(3)) primary Key and DaDaBIk does not seem able to process it.

Also Recursive lookup of values from same table doesn't seem to work.

For foreign key SQL I also unsuccessfully tried:-
SQL: SELECT DISTINCT t1.PABR from places WHERE LENGTH(RTRIM(t1.PABR)) = 2

The table dump is as below:-

CREATE TABLE `places` (
`ABR` char(3) NOT NULL default '',
`PLACE` varchar(20) NOT NULL default '',
`PABR` char(3) NOT NULL default '',
PRIMARY KEY (`ABR`)
) TYPE=MyISAM;

INSERT INTO `places` VALUES("MAA","Madras","TN");
INSERT INTO `places` VALUES("TN","TamilNadu","IN");
INSERT INTO `places` VALUES("IN","India","");
INSERT INTO `places` VALUES("CBE","Coimbatore","TN");
INSERT INTO `places` VALUES("KKD","Karaikudi","TN");

# Internal Table used
CREATE TABLE `places_intdb` (
`name_field` varchar(50) NOT NULL default '',
`present_insert_form_field` enum('0','1') NOT NULL default '1',
`present_ext_update_form_field` enum('0','1') NOT NULL default '1',
`present_search_form_field` enum('0','1') NOT NULL default '1',
`required_field` enum('0','1') NOT NULL default '0',
`present_results_search_field` enum('0','1') NOT NULL default '1',
`check_duplicated_insert_field` enum('0','1') NOT NULL default '0',
`type_field` enum('text','textarea','password','insert_date','update_date','date','select_single','select_multiple_menu','select_multiple_checkbox','ID_user','password_record') NOT NULL default 'text',
`separator_field` char(2) NOT NULL default '~',
`content_field` enum('alphabetic','alphanumeric','numeric','web','email','phone','city') NOT NULL default 'alphanumeric',
`select_options_field` text NOT NULL,
`foreign_key_field` text NOT NULL,
`db_primary_key_field` varchar(255) NOT NULL default '',
`select_type_field` varchar(50) NOT NULL default 'exactly/like/>/<',
`prefix_field` text NOT NULL,
`default_value_field` text NOT NULL,
`label_field` varchar(50) NOT NULL default '',
`width_field` char(3) NOT NULL default '',
`height_field` char(3) NOT NULL default '',
`maxlength_field` char(3) NOT NULL default '100',
`hint_insert_field` varchar(100) NOT NULL default '',
`order_form_field` smallint(6) NOT NULL default '0',
PRIMARY KEY (`name_field`)
) TYPE=MyISAM;


INSERT INTO `places_intdb` VALUES("ABR","1","1","1","0","1","0","text","~","alphanumeric","","","","exactly/like/>/<","","","Place Code","","","3","","1");
INSERT INTO `places_intdb` VALUES("PLACE","1","1","1","0","1","0","text","~","alphanumeric","","","","exactly/like/>/<","","","Name of Place","","","","","2");
INSERT INTO `places_intdb` VALUES("PABR","1","1","1","0","1","0","select_single","~","alphanumeric","~TN~KA~KE~AP~IN~","\r\n","","exactly/like/>/<","","TN","State-Country","","","3","","3");
 
E

Eugenio

Guest
Ap.Muthu wrote:
>
> I created a table with a character (CHAR(3)) primary Key and
> DaDaBIk does not seem able to process it.

[......]

> The table dump is as below:-

[......]

> INSERT INTO `places_intdb`
> VALUES("PABR","1","1","1","0","1","0","select_single","~","alphanumeric","~TN~KA~KE~AP~IN~","\r\n","","exactly/like/>/<","","TN","State-Country","","","3","","3");

Hi,
The character field as primary key is perfectly supported by DaDaBIK.

The reason of your problem is that you have an error in your internal table, look at that "\r\n" as primary_key_field. Of course it doesn't make sense and DaDaBIK try to process is as primary key.

A request to all DaDaBIK users: please look carefully at your table dumps before submitting them as support request.

(Latest version of DaDaBIK when this message was posted: 1.6)
 
Top