#1  
Old 7th June 2013, 07:20 PM
Micael Micael is offline
Member
 
Join Date: Mar 2011
Posts: 78
Default Is this a BUG or am stupid

I'm using HTML5

I have two databases NexusDB and MySQL. They are both local and works fine when working with them in enterprice manager and phpMyAdmin
nexusDB version: 3.1201

The databases are very simple and Identical
TableName:Test
2 colums: aIntVal who is Integer and aStrVal who is ShortString/Text
They both have 3 records with aIntVal set to 1,2 and 3

When setting Table->Filter Both Databases get the right record

No to the problem
Nexus can not save but MySQL works fine
I have a big system written in delphi and use the nexusDB and I am very pleased with nexusDB. But now I want my customers to acces my system ower the web and time is running short.

I have changed only aStrVal but when i comes to nexusTable->post() I get this message:

Application raised an exception class PDOException with message 'SQLSTATE[H]: <>: 1 NexusDB: : Query execution failed:
Type mismatch: The source value type (NATIONAL CHARACTER VARYING) and the target site type (column: aIntVal, [INTEGER]) are not assignment compatible<[--!þ$ExceptionData$=BwNFRFYDfH..................



The compleat code follows:

<?php
require_once("rpcl/rpcl.inc.php");
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");
use_unit("dbtables.inc.php");

//Class definition
class Page2 extends Page
{
public $nexusName = null;
public $mySQLName = null;
public $NewStrVal_Edit = null;
public $IDLabel = null;
public $IntVal_Edit = null;
public $NewStrVal_Label = null;
public $Get_Button = null;
public $Set_Button = null;
public $mySQLDatabase = null;
public $mySQLTable = null;
public $NexusDatabase = null;
public $NexusTable = null;

function SetnameValues()
{
//mySQL
$this->mySQLName->Caption = $this->mySQLTable->fieldget('aStrVal');

//NexusDB
$this->nexusName->Caption = $this->NexusTable->fieldget('aStrVal');
}

function Get_ButtonClick($sender, $params)
{
//mySQL
$this->mySQLTable->Active = FALSE;
$this->mySQLTable->Filter ="aIntVal = ".intVal($this->IntVal_Edit->Text);
$this->mySQLTable->Active = TRUE;

//NexusDB
$this->NexusTable->Active = FALSE;
$this->NexusTable->Filter ="aIntVal = ".intVal($this->IntVal_Edit->Text);
$this->NexusTable->Active = TRUE;

$this->SetnameValues();

}
function Set_ButtonClick($sender, $params)
{
//MySQL
$this->mySQLTable->edit();
$this->mySQLTable->fieldset('aStrVal', $this->NewStrVal_Edit->Text);
$this->mySQLTable->post();

//nexusdb
$this->NexusTable->edit();
$this->NexusTable->fieldset('aStrVal', $this->NewStrVal_Edit->Text);
$this->NexusTable->post();


$this->SetnameValues();
}
}

global $application;

global $Page2;

//Creates the form
$Page2=new Page2($application);

//Read from resource file
$Page2->loadResource(__FILE__);

//Shows the form
$Page2->show();

?>
  #2  
Old 7th June 2013, 11:46 PM
Eivind Bakkestuen [NDD]
 
Posts: n/a
Default Re: Is this a BUG or am stupid

> I have two databases NexusDB and MySQL. They are both local and works
> fine when working with them in enterprice manager and phpMyAdmin


Can you please email the complete testapp to reproduce to Alexander,
like you did before? I'll let him know to have a look.

--
Eivind Bakkestuen [NDD]
  #3  
Old 8th June 2013, 03:29 AM
Alexander Telegin [NDX]
 
Posts: n/a
Default Re: Is this a BUG or am stupid

Micael,

Please send your project along with database at alex@itlab.ws

- Alex

On 6/7/2013 12:20 PM, Micael wrote:
> I'm using HTML5
>
> I have two databases NexusDB and MySQL. They are both local and works
> fine when working with them in enterprice manager and phpMyAdmin
> nexusDB version: 3.1201
>
> The databases are very simple and Identical
> TableName:Test
> 2 colums: *aIntVal *who is Integer and *aStrVal *who is
> ShortString/Text
> They both have 3 records with aIntVal set to 1,2 and 3
>
> When setting Table->Filter Both Databases get the right record
>
> No to the problem
> Nexus can not save but MySQL works fine
> I have a big system written in delphi and use the nexusDB and I am very
> pleased with nexusDB. But now I want my customers to acces my system
> ower the web and time is running short.
>
> I have changed only aStrVal but when i comes to nexusTable->post() I get
> this message:
>
> _Application_raised_an_exception_class_PDOExceptio n_with_message_'SQLSTATE[H]:_<>:_1_NexusDB:_:_Query_execution_failed:_
> Type_mismatch:_The_source_value_type_(NATIONAL_CHA RACTER_VARYING)_and_the_target_site_type_(column:_ aIntVal,_[INTEGER])_are_not_assignment_compatible<[--!þ$ExceptionData$=BwNFRFYDfH.................._
>
>
> The compleat code follows:
>
> <?php
> require_once("rpcl/rpcl.inc.php");
> //Includes
> use_unit("forms.inc.php");
> use_unit("extctrls.inc.php");
> use_unit("stdctrls.inc.php");
> use_unit("dbtables.inc.php");
>
> //Class definition
> class Page2 extends Page
> {
> public $nexusName = null;
> public $mySQLName = null;
> public $NewStrVal_Edit = null;
> public $IDLabel = null;
> public $IntVal_Edit = null;
> public $NewStrVal_Label = null;
> public $Get_Button = null;
> public $Set_Button = null;
> public $mySQLDatabase = null;
> public $mySQLTable = null;
> public $NexusDatabase = null;
> public $NexusTable = null;
>
> function SetnameValues()
> {
> //mySQL
> $this->mySQLName->Caption =
> $this->mySQLTable->fieldget('aStrVal');
>
> //NexusDB
> $this->nexusName->Caption =
> $this->NexusTable->fieldget('aStrVal');
> }
>
> function Get_ButtonClick($sender, $params)
> {
> //mySQL
> $this->mySQLTable->Active = FALSE;
> $this->mySQLTable->Filter ="aIntVal =
> ".intVal($this->IntVal_Edit->Text);
> $this->mySQLTable->Active = TRUE;
>
> //NexusDB
> $this->NexusTable->Active = FALSE;
> $this->NexusTable->Filter ="aIntVal =
> ".intVal($this->IntVal_Edit->Text);
> $this->NexusTable->Active = TRUE;
>
> $this->SetnameValues();
>
> }
> function Set_ButtonClick($sender, $params)
> {
> //MySQL
> $this->mySQLTable->edit();
> $this->mySQLTable->fieldset('aStrVal',
> $this->NewStrVal_Edit->Text);
> $this->mySQLTable->post();
>
> //nexusdb
> $this->NexusTable->edit();
> $this->NexusTable->fieldset('aStrVal',
> $this->NewStrVal_Edit->Text);
> $this->NexusTable->post();
>
>
> $this->SetnameValues();
> }
> }
>
> global $application;
>
> global $Page2;
>
> //Creates the form
> $Page2=new Page2($application);
>
> //Read from resource file
> $Page2->loadResource(__FILE__);
>
> //Shows the form
> $Page2->show();
>
> ?>
>
>


  #4  
Old 10th June 2013, 03:35 AM
Alexander Telegin [NDX]
 
Posts: n/a
Default Re: Is this a BUG or am stupid

Micael,

This code

$this->mySQLTable->edit();
$this->mySQLTable->fieldset('aStrVal',
$this->NewStrVal_Edit->Text);
$this->mySQLTable->post();

will update ALL records in table with aStrVal equal to
$this->NewStrVal_Edit->Text

HTML5 builder acts not like desktop application where you put the cursor
at record and then set this record into edit mode, update value and
post. Not at all. It won't keep your cursor between requests. You have
to do all operations (open, point and update) during one request and I'd
recommend use only Query component for this when you have full power
over your SQL string. Don't use edit, filter, post, fieldset and other
weird stuff. They all is a pity attempt to make HTML 5 builder looking
closer to Delphi DB Controls and after all they are buggy and
non-universal. If you use them, your resulting application will generate
lots of additional queries to DB server, each page will hammer your
database many times per request just to get the meta scheme. I'm begging
all HTML 5 users, the only way to make this monster somehow useful, is
to use SQL query only. Don't use HTML5 builder if you can, write PHP
scripts that call Nexus drivers directly, in any text editor. Just look
at this, this is the single request:

http://oi39.tinypic.com/29cw5ts.jpg

Regards,
Alex



On 6/7/2013 12:20 PM, Micael wrote:
> I'm using HTML5
>
> I have two databases NexusDB and MySQL. They are both local and works
> fine when working with them in enterprice manager and phpMyAdmin
> nexusDB version: 3.1201
>
> The databases are very simple and Identical
> TableName:Test
> 2 colums: *aIntVal *who is Integer and *aStrVal *who is
> ShortString/Text
> They both have 3 records with aIntVal set to 1,2 and 3
>
> When setting Table->Filter Both Databases get the right record
>
> No to the problem
> Nexus can not save but MySQL works fine
> I have a big system written in delphi and use the nexusDB and I am very
> pleased with nexusDB. But now I want my customers to acces my system
> ower the web and time is running short.
>
> I have changed only aStrVal but when i comes to nexusTable->post() I get
> this message:
>
> _Application_raised_an_exception_class_PDOExceptio n_with_message_'SQLSTATE[H]:_<>:_1_NexusDB:_:_Query_execution_failed:_
> Type_mismatch:_The_source_value_type_(NATIONAL_CHA RACTER_VARYING)_and_the_target_site_type_(column:_ aIntVal,_[INTEGER])_are_not_assignment_compatible<[--!þ$ExceptionData$=BwNFRFYDfH.................._
>
>
> The compleat code follows:
>
> <?php
> require_once("rpcl/rpcl.inc.php");
> //Includes
> use_unit("forms.inc.php");
> use_unit("extctrls.inc.php");
> use_unit("stdctrls.inc.php");
> use_unit("dbtables.inc.php");
>
> //Class definition
> class Page2 extends Page
> {
> public $nexusName = null;
> public $mySQLName = null;
> public $NewStrVal_Edit = null;
> public $IDLabel = null;
> public $IntVal_Edit = null;
> public $NewStrVal_Label = null;
> public $Get_Button = null;
> public $Set_Button = null;
> public $mySQLDatabase = null;
> public $mySQLTable = null;
> public $NexusDatabase = null;
> public $NexusTable = null;
>
> function SetnameValues()
> {
> //mySQL
> $this->mySQLName->Caption =
> $this->mySQLTable->fieldget('aStrVal');
>
> //NexusDB
> $this->nexusName->Caption =
> $this->NexusTable->fieldget('aStrVal');
> }
>
> function Get_ButtonClick($sender, $params)
> {
> //mySQL
> $this->mySQLTable->Active = FALSE;
> $this->mySQLTable->Filter ="aIntVal =
> ".intVal($this->IntVal_Edit->Text);
> $this->mySQLTable->Active = TRUE;
>
> //NexusDB
> $this->NexusTable->Active = FALSE;
> $this->NexusTable->Filter ="aIntVal =
> ".intVal($this->IntVal_Edit->Text);
> $this->NexusTable->Active = TRUE;
>
> $this->SetnameValues();
>
> }
> function Set_ButtonClick($sender, $params)
> {
> //MySQL
> $this->mySQLTable->edit();
> $this->mySQLTable->fieldset('aStrVal',
> $this->NewStrVal_Edit->Text);
> $this->mySQLTable->post();
>
> //nexusdb
> $this->NexusTable->edit();
> $this->NexusTable->fieldset('aStrVal',
> $this->NewStrVal_Edit->Text);
> $this->NexusTable->post();
>
>
> $this->SetnameValues();
> }
> }
>
> global $application;
>
> global $Page2;
>
> //Creates the form
> $Page2=new Page2($application);
>
> //Read from resource file
> $Page2->loadResource(__FILE__);
>
> //Shows the form
> $Page2->show();
>
> ?>
>
>


  #5  
Old 10th June 2013, 04:51 AM
Micael Micael is offline
Member
 
Join Date: Mar 2011
Posts: 78
Default

OK I changed Table to a Query and the update works but from the nexus I get an error message that I do not get from mySQL.

Error message: Cannot perform this operation on a closed dataset

The code is now:
function SetnameValues()
{
//mySQL
$this->mySQLName->Caption = $this->mySQL_Query->fieldget('aStrVal');

//NexusDB
$this->nexusName->Caption = $this->nexus_Query->fieldget('aStrVal');
}

function Get_ButtonClick($sender, $params)
{
//mySQL
$this->mySQL_Query->Active = FALSE;
$this->mySQL_Query->SQL = "SELECT * FROM Test WHERE aintVal = " .$this->IntVal_Edit->Text;
$this->mySQL_Query->Active = TRUE;

//NexusDB
$this->nexus_Query->Active = FALSE;
$this->nexus_Query->SQL = "SELECT * FROM Test WHERE aintVal = " .$this->IntVal_Edit->Text;
$this->nexus_Query->Active = TRUE;

$this->SetnameValues();

}
function Set_ButtonClick($sender, $params)
{
//MySQL
$this->mySQL_Query->Active = FALSE;
$this->mySQL_Query->SQL = "UPDATE Test SET aStrVal = '". $this->NewStrVal_Edit->Text. "' WHERE aintVal = " .$this->IntVal_Edit->Text;
$this->mySQL_Query->Active = TRUE;

//nexusdb
$this->nexus_Query->Active = FALSE;
$this->nexus_Query->SQL ="UPDATE Test SET aStrVal = '". $this->NewStrVal_Edit->Text."-". $this->NewStrVal_Edit->Text. "' WHERE aintVal = " .$this->IntVal_Edit->Text;
$this->nexus_Query->Active = TRUE; // It is here I get the errormessage


$this->SetnameValues();
}
  #6  
Old 10th June 2013, 07:11 PM
Micael Micael is offline
Member
 
Join Date: Mar 2011
Posts: 78
Default

I forgot to say that the error message stops the script and the next line is not executed
  #7  
Old 15th June 2013, 02:18 AM
Micael Micael is offline
Member
 
Join Date: Mar 2011
Posts: 78
Default

Thanks for an updated nexusdb.dll it fixed the problem


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I have a new stupid question Liz nexusdb.public.support 4 10th October 2006 07:43 AM
I'm a little stupid, but... David Guest nexusdb.public.discussions 1 2nd June 2004 12:40 AM


All times are GMT +11. The time now is 08:31 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.