You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Adriano Crestani (JIRA)" <tu...@ws.apache.org> on 2007/04/21 09:46:15 UTC
[jira] Created: (TUSCANY-1220) FK columns name retrieved by dbms
contain invalid characters
FK columns name retrieved by dbms contain invalid characters
------------------------------------------------------------
Key: TUSCANY-1220
URL: https://issues.apache.org/jira/browse/TUSCANY-1220
Project: Tuscany
Issue Type: Task
Components: C++ DAS
Affects Versions: Wish list
Reporter: Adriano Crestani
Priority: Minor
Fix For: Wish list
The method ResultSet* Database::getFKs(std::string tableName) const returns a ResultSet containing information about the tableName foreign keys. When getting specially the pk column name and fk column name, it is returning the column name surrounded by " ' ". For example:
std::cout << "FK Column Name = " << fksResultSet->getSQLVarchar(7); // 7th column contains the fk column name
std::cout << "\nPK Column Name = " << fksResultSet->getSQLVarchar(3); // 3th column contains the fk column name
std::cout << "\nPK Table Name = " << fksResultSet->getSQLVarchar(2); // 2nd column contains the pk table name
output:
FK Column Name = 'COMPANY_ID'
PK Column Name = 'ID'
PK Table Name = DEPARTMENT
As seen on the output, only the pk and fk column name are surrounded by " ' " . I'm actually solving this problem removing the " ' " from the string:
std::string fkColumnName = fksResultSet->getSQLVarchar(7);
std::string pkTableName = fksResultSet->getSQLVarchar(2);
std::string pkColumnName = fksResultSet->getSQLVarchar(3);
fkColumnName = fkColumnName.substr(1, fkColumnName.size() - 2);
pkColumnName = pkColumnName.substr(1, pkColumnName.size() - 2);
I'm using MySQL server. I don't know if it happens only with MySQL server or if there are others which do the same.
I propose to test it using others DBMSs to test if it happens only on MySQL server or not.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Closed: (TUSCANY-1220) FK columns name retrieved by dbms
contain invalid characters
Posted by "Adriano Crestani (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-1220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adriano Crestani closed TUSCANY-1220.
-------------------------------------
Resolution: Won't Fix
DAS C++ is no more using the class Database.
> FK columns name retrieved by dbms contain invalid characters
> ------------------------------------------------------------
>
> Key: TUSCANY-1220
> URL: https://issues.apache.org/jira/browse/TUSCANY-1220
> Project: Tuscany
> Issue Type: Task
> Components: C++ DAS
> Reporter: Adriano Crestani
> Priority: Minor
> Fix For: Cpp-Next
>
>
> The method ResultSet* Database::getFKs(std::string tableName) const returns a ResultSet containing information about the tableName foreign keys. When getting specially the pk column name and fk column name, it is returning the column name surrounded by " ' ". For example:
> std::cout << "FK Column Name = " << fksResultSet->getSQLVarchar(7); // 7th column contains the fk column name
> std::cout << "\nPK Column Name = " << fksResultSet->getSQLVarchar(3); // 3th column contains the fk column name
> std::cout << "\nPK Table Name = " << fksResultSet->getSQLVarchar(2); // 2nd column contains the pk table name
> output:
> FK Column Name = 'COMPANY_ID'
> PK Column Name = 'ID'
> PK Table Name = DEPARTMENT
> As seen on the output, only the pk and fk column name are surrounded by " ' " . I'm actually solving this problem removing the " ' " from the string:
> std::string fkColumnName = fksResultSet->getSQLVarchar(7);
> std::string pkTableName = fksResultSet->getSQLVarchar(2);
> std::string pkColumnName = fksResultSet->getSQLVarchar(3);
> fkColumnName = fkColumnName.substr(1, fkColumnName.size() - 2);
> pkColumnName = pkColumnName.substr(1, pkColumnName.size() - 2);
> I'm using MySQL server. I don't know if it happens only with MySQL server or if there are others which do the same.
> I propose to test it using others DBMSs to test if it happens only on MySQL server or not.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org