|
|
Home » U++ Library support » U++ SQL » First Firebird for U++ steps
First Firebird for U++ steps [message #16868] |
Fri, 18 July 2008 09:38 |
aldeacity
Messages: 18 Registered: July 2008 Location: Spain
|
Promising Member |
|
|
Hello,
as I wrote, I'm interesting in Firebird for U++. So, I've starting developping of it. No I've made basic session and connection objects. It's basic now but It works!!!!
At this moment, it connects and disconnects from databases and also begins, commits and executes querys and build columns information.
All process are transactional, so if I execute a sentence, it will be look for a transaction open in session and if there isn't it'll use a transaction for that execute process.
Now I'm working in Fetch and GetColumn functions.
I hoppe it will be useful!!
Regards,
Juan.
|
|
|
|
|
|
|
|
|
|
Re: First Firebird for U++ steps [message #17083 is a reply to message #17082] |
Mon, 28 July 2008 12:35 |
|
luzr wrote on Mon, 28 July 2008 06:09 |
unodgs wrote on Mon, 28 July 2008 04:49 | BTW: I think we could after a bit refactoring adopt you decimal class for upp. It's the only missing type of Value right now IMO.
|
I wonder whether this is implementation is a good tactics.
E.g. .NET seems to implement decimal as 128bit FP number with decimal exponent.
Mirek
|
Well we can start with anything. Implementation can be always changed. What I wanted only to say Decimal type would be very useful (+ plus EditDecimal, EditCurrency...)
|
|
|
Re: First Firebird for U++ steps [message #17088 is a reply to message #17083] |
Mon, 28 July 2008 14:40 |
aldeacity
Messages: 18 Registered: July 2008 Location: Spain
|
Promising Member |
|
|
Hello,
I send a sample testing datagrid. All columns seem to be ok, of course expect salary column that it's decimal(10,2). I.m adapting FireBirdSchema.h now.
Database is Firebird test database (EMPLOYEE.FDB).
Query is:
SELECT EMP_NO, FIRST_NAME, LAST_NAME, SALARY, FULL_NAME FROM EMPLOYEE;
Schema is:
TABLE_(EMPLOYEE)
INT_ (EMP_NO)
STRING_ (FIRST_NAME)
STRING_ (LAST_NAME)
STRING_ (SALARY)
STRING_ (FULL_NAME)
END_TABLE
Code for datagrid is:
frmTest.grdData.SetTable(EMPLOYEE);
frmTest.grdData.AddColumn(EMP_NO, "Emp. No.");
frmTest.grdData.AddColumn(FIRST_NAME, "First Name");
frmTest.grdData.AddColumn(LAST_NAME, "Last Name");
frmTest.grdData.AddColumn(SALARY, "Salary");
frmTest.grdData.AddColumn(FULL_NAME, "Full Name");
frmTest.grdData.Query();
Juan.
-
Attachment: datagrid.zip
(Size: 32.52KB, Downloaded 344 times)
|
|
|
Re: First Firebird for U++ steps [message #17114 is a reply to message #17088] |
Tue, 29 July 2008 16:09 |
|
I have refactored decimal class a bit:
decimal is now Decimal
I think you wanted braces here:
if(sign!=d.sign)
if(sign>d.sign) return 1;
if(sign<d.sign) return -1;
This patch is also included.
I changed
memcpy(number, d.number, D_SIZE * sizeof(int));
to
memcpy(number, d.number, D_SIZE * sizeof(int32));
I also formatted code in upp way (please follow our style in your firebird plugin) and changed throw messages from uppercase to lowercase.
I'm gonna try to use this class in my app and check if it works well. I will also modify postgres plugin to be compatibile with decimal (only a try..)
-
Attachment: Decimal.7z
(Size: 4.08KB, Downloaded 302 times)
|
|
|
|
Re: First Firebird for U++ steps [message #17121 is a reply to message #17118] |
Tue, 29 July 2008 18:06 |
|
aldeacity wrote on Tue, 29 July 2008 11:23 | Hello!
Well, I did'n write decimal code. In Firebird plugin I'm trying to write with Upp style but this is my first Upp adventure I'll try to send code tonight. If not, tomorrow. But, I would like to know how must I lo link with Firebird library, so, what method do you think it's better.
Juan.
|
could you tell what is the source of this decimal class? As for your question I don't fully understand but you should just link dynamicaly.
|
|
|
|
|
|
Goto Forum:
Current Time: Wed May 08 06:45:32 CEST 2024
Total time taken to generate the page: 0.03000 seconds
|
|
|