Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Per E. Johannessen

Pages: 1 2 [3] 4 5 ... 17
31
Programming / SQL running total
« on: May 19, 2023, 05:54:52 pm »
Hi,

This statement works with SQLite;

select amount, (select sum(t2.amount) from example t2 where t2.id <= t1.id) as accumulated from example t1 order by id

Does anyone know how to make it work with dBase (IV/V)?

(I've found many examples for other databases but none of them works with dBase.)

32
Programming / Re: Rexx cumulative values
« on: May 16, 2023, 03:20:31 pm »
Well, there is only data from "QRY_2" that is being used in the report.

Writing to a txt-file is OK, like this;
        outfile = data.1 ',' data.2 ',' data.3
        out = lineout(testakkm.txt,outfile)

So, how to define the same data as source for the VPR-report REP_HBAKKM.vpt ?



33
Programming / Re: Rexx cumulative values
« on: May 15, 2023, 10:15:27 pm »
Tried to create a report, which works but it is missing the cumulative values.
I added the following to Lars' code:

    reprows = 0
ok = VRMethod( "QRY_2", "MoveFirst" )
do while( ok = 1 )
    call VRMethod "QRY_2", "RowData", "data."
    reprows=reprows+1
    table.reprows.TEKSTFELT = data.1
    table.reprows.TALLFLT1 = data.2
    table.reprows.TALLFLT2 = data.3

ok = VRMethod( "QRY_2", "MoveNext" )
end

table.0=reprows

DO i=1 TO table.0

END i

hwnd = VRGet( "Window1", "HWnd" )

rc=VpPrintReport(hwnd, 'REP_HBAKKM.vpt', 'table.', '<PREVIEW>' )

call QRY_2_Fini

return

Attached is the resulting report which would be fine if the column now showing data.3 would show the cumulative instead.

34
Programming / Re: Rexx cumulative values
« on: May 15, 2023, 01:35:53 pm »
Thank you both.

Alex, I got this when running your code:
 *** Error 41 Bad aritmetic conversion

Lars, works fine.

Initially I had the idea that the container should display these cumulative values but there is actually no point in that.
Will use the code to create some accounting reports which also can be printed to screen.

35
Programming / Re: Rexx cumulative values
« on: May 15, 2023, 11:20:43 am »
Thanks Mentore, I have already tried with SQL and I think that's the best way. I've been trying various SQL statements that I have found on the net with DBExpert but so far no success. DBE does not come with any documentation of valid SQL-statements and I haven't found any online manual either. However, even if I could make it work with DBE I probably will have trouble making it work with VX-Rexx.

36
Programming / Rexx cumulative values
« on: May 14, 2023, 05:26:48 pm »
In a VX-Rexx program I have this container, QRY_2:

|TEKSTFELT | TALLFLT1 | TALLFLT2 |
|aaa       |     10.00|          |
|aaa       |     10.00|          |
|aaa       |     10.00|          |
|bbb       |    100.00|          |
|bbb       |    100.00|          |
|bbb       |    100.00|          |
|ccc       |   1000.00|          |
|ccc       |   1000.00|          |
|ccc       |   1000.00|          |

Running this code (from a push button):

ok = VRMethod( "QRY_2", "MoveFirst" )
do while( ok = 1 )
    call VRMethod "QRY_2", "RowData", "data."
    str = ""
    do i = 1 to data.0
        str = str data.i
    end
    say str
    ok = VRMethod( "QRY_2", "MoveNext" )
end

Results in:

aaa 10.00 DATA.3
aaa 10.00 DATA.3
aaa 10.00 DATA.3
bbb 100.00 DATA.3
bbb 100.00 DATA.3
bbb 100.00 DATA.3
ccc 1000.00 DATA.3
ccc 1000.00 DATA.3
ccc 1000.00 DATA.3

The problem is that I need the third column in the container, TALLFLT2 (displayed as DATA.3 above), to get updated with cumulative values from column TALLFLT1, also it must «reset» when the value in TEKSTFELT changes, like this:

|TEKSTFELT | TALLFLT1 | TALLFLT2|
|aaa       |     10.00|    10.00|
|aaa       |     10.00|    20.00|
|aaa       |     10.00|    30.00|
|bbb       |    100.00|   100.00|
|bbb       |    100.00|   200.00|
|bbb       |    100.00|   300.00|
|ccc       |   1000.00|  1000.00|
|ccc       |   1000.00|  2000.00|
|ccc       |   1000.00|  3000.00|


Ideas are welcome.

37
Off Topic discussions / Re: Car rides etc, was Re: Qt6 Development
« on: May 07, 2023, 11:07:16 pm »
The front leather seat belonged to my now departed cat, the back leather seats belong to my 18 year old dog.
What kind of dog is that, impressive age. I've got two malamutes. 12 and nearly 14 years old, too big for the car seat though.

38
Utilities / Re: Intersolv/ODBC
« on: May 06, 2023, 02:13:22 pm »
OK, but aren't the sources available? Perhaps someone could do necessary modifications to make it work with other programs than OpenOffice?

39
Utilities / Re: Intersolv/ODBC
« on: May 05, 2023, 03:09:31 pm »
Does anyone if the odbc driver included with OpenOffice or the one in iODBC could be used?

40
Utilities / Re: Intersolv/ODBC
« on: April 28, 2023, 08:48:03 pm »
I built unixodbc many years ago, but our toolset wasn't as mature back then, so I'm not sure the modules ever actually worked. Happy to have another look at it.
That was back in 2015 and I still have some notes about the project. Part of the problem seemed to be lack of source code for odbc drivers, and the one supplied with unixodbc 010 had some bugs. What about the one that is included with OpenOffice or iODBC?

41
Utilities / Re: Intersolv/ODBC
« on: April 27, 2023, 02:00:16 pm »
What about porting? Does anyone know about some open source package that could be used?
The old unixodbc 010 included a query tool which, at least for simple queries, worked with the provided samples  and the supplied odbc driver.
(Tried to use that odbc driver with VX-Rexx and VP-Rexx but could not make it work.)

I'd be happy to sponsor a project that would include an odbc driver that works with dBase files.

42
Utilities / Re: Intersolv/ODBC
« on: April 20, 2023, 04:59:49 pm »
Found a link to ODBCINST3.ZIP at http://www.os2ezine.com/20010916/page_7.html but the link does not work anymore.
Not found at Hobbes either.

43
Utilities / Re: Intersolv/ODBC
« on: April 18, 2023, 10:51:18 pm »
The one you found on ebay is the same as the one I bought and it contains no os/2 software,
despite listing OS2.x under system requirements.

44
Utilities / Re: Intersolv/ODBC
« on: April 18, 2023, 12:32:33 pm »
Do you know if the demo Intersolv SQL Server ODBC driver is available somewhere?

45
Utilities / Intersolv/ODBC
« on: April 17, 2023, 09:36:17 pm »
Some time ago I bought the Intersolv DataDirect ODBC Pack and I got it in unopened condition.
The software came on three diskettes and they turn out to be for Windows only!
On the box it is clearly stated "OS/2 2.x " under "System Requirements".

Does anyone know where I can obtain the ODBC drivers for OS2?



Pages: 1 2 [3] 4 5 ... 17