• Welcome, Guest. Please login.
 
August 12, 2020, 09:27:46 am

News:

Welcome to the SQLitening support forums!


Recent posts

Pages 1 2 3 4 ... 10
11
General Board / Join 2D arrays with a column a...
Last post by cj - April 21, 2020, 08:59:39 am
Enables a column delimiter and a new row delimiter in new JOIN2$ function.
This makes it easy to display a string from a 2-dimensional array with a $CR  or other characters as a row delimiter.

Improved money macro to automatically display passed column name instead of printf statement.
SQlite "AS" is optional so just appended colname to the money macro.
Don't like leading 0 displaying on money columns so used ltrim to remove it.

Enjoy!

#DIM ALL
MACRO money(colname)= CHR$("ltrim(printf('%.2f',",colname,"*.01),'0')",colname)
#INCLUDE "sqlitening.inc"

FUNCTION PBMAIN () AS LONG

 LOCAL sql,sColDel,sRowDel,rs() AS STRING
 slopen "sample.db3"
 sql = "select manuf,redref,"+ money("PRICE") + " from parts limit 20"
 slselary sql,rs()
 sColDel = "   "
 sRowDel = $CR
 ? JOIN2(rs(),sColDel,sRowDel),,USING$("Rows #_, Cols #",UBOUND(rs,2),UBOUND(rs))

END FUNCTION

FUNCTION JOIN2(rs() AS STRING,sColumnDelimiter AS STRING,sRowDelimiter AS STRING) AS STRING
 LOCAL sb AS ISTRINGBUILDERA
 sb = CLASS "STRINGBUILDERA"
 'sb.capacity = 1024*1000 'does well without capacity

 LOCAL c              AS LONG
 LOCAL LowCol         AS LONG
 LOCAL HighCol        AS LONG
 LOCAL HighCol_minus1 AS LONG

 LOCAL r              AS LONG
 LOCAL LowRow         AS LONG
 LOCAL HighRow        AS LONG

 LowCol = LBOUND(rs,1)
 HighCol= UBOUND(rs,1)
 HighCol_minus1 = HighCol-1
 LowRow = LBOUND(rs,2)
 HighRow= UBOUND(rs,2)

 FOR r = LowRow TO HighRow
  FOR c= LowCol TO HighCol_minus1
   sb.add  rs(c,r)
   sb.add sColumnDelimiter
  NEXT c
  sb.add rs(c,r)
  sb.add sRowDelimiter
 NEXT r
 FUNCTION = sb.string
END FUNCTION
12
After a few changes to my program, everything works as it should. Which of the changes that corrected the error I do not know.
13
In my system, I handle all processing of a Sql database via a special IO module, a module for each table. Everything works as I had imagined. But in a special case I get error code 7. I have done some tests and it seems I do NOT get error if I make all SQL calls directly in a program without going through an io module.
I get the error after 3732 calls with function GU (get unique).

FUNKTION_GU:
'===========
'
GU_SELECT:
    slOpen TRIM$(KOM.DATABAS)
    SET_NUMMER = slGetUnusedSetNumber
    SEL_STRANG = "SELECT * FROM ART WHERE ARTNR= " + $SQ + TRIM$(ART.ARTNR) + $SQ
    SVAR = slSel(SEL_STRANG, SET_NUMMER) ' Ska ge noll
    IF SVAR <>  0 THEN
        KOM.FELTEXT = "SYSTEMFEL i ARTIO GU slSel=" + STR$(SVAR)  <<============
        GOTO SYSTEMFELHANTERING
        EXIT SUB
    END IF

Tips where to look for errors are gratefully received.
/Fim W.



14
You've got Questions? We've got Answers! / Re: slSelBind
Last post by Fim - January 15, 2020, 08:50:05 am
Thank you, that looks good.
Right now I have other problems.
Will return.
15
You've got Questions? We've got Answers! / Re: Beep Notification
Last post by Fredrick Ughimi - January 03, 2020, 01:48:12 pm
Hello Cj,

>>sUsers  = "127.0.0.1, mycomputer"

I need a little explanation here. Is 127.0.0.1 IP address of the computer I am notifying? I guess 'mycomputer' stands for the name of my computer (the sending conputer)?
16
You've got Questions? We've got Answers! / Re: Beep Notification
Last post by Fredrick Ughimi - January 02, 2020, 08:29:41 pm
Hello Cj,

This would serve as well.

Thanks for the codes. Would try it out.
17
You've got Questions? We've got Answers! / Re: Beep Notification
Last post by Bern Ertl - December 30, 2019, 05:20:11 pm
SQLiteningServer doesn't have any methods for pushing notifications to connected clients that I recall.

Your best bet is probably to have connected clients read a transaction file on the server periodically to check for saved updates.
18
You've got Questions? We've got Answers! / Re: slSelBind
Last post by Fim - December 29, 2019, 06:15:06 am
Thanks,
I'll dig into this and see if I understand it.
/Fim W.
19
You've got Questions? We've got Answers! / slSelBind
Last post by Fim - December 28, 2019, 09:17:41 am
What I'm getting is slSelBind is a method of using "Prepared Statement Object" in SQLite
In an ERP system there is something called "requirements explosion" and I have programmed it, works ok, but it takes time.
This slSel-sts is executed 220 times for a particular item:
"SELECT MTRLNR, POS, QUANT, FROM_VECKA, TOM_VECKA, SORT_1 FROM STR WHERE ARTNR =" + $ SQ + TRIM $ (ARTNR) + $ SQ + "ORDER BY MTRLNR"
Instead, I've tried this:
slFIX = slBuildBindDat ("$ SQ + TRIM $ (ARTNR) + $ SQ")
..
..
slSelBind ("SELECT MTRLNR, POST, QUANTITY, FROM_VECKA, TOM_VECKA, SORT_1 FROM STR WHERE ARTNR =? ORDER BY MTRLNR", slFIX, SET_NUMMER_TABELL (NIVA))

But it does not work, I think wrong, but I do not know what.
20
You've got Questions? We've got Answers! / Beep Notification
Last post by Fredrick Ughimi - December 26, 2019, 04:32:55 am
Hello,

Running SQLitening in Client/Server mode, is it possible to send a notification (a Beep or play a wave file) to another computer on the network when I save a file?

Anyone done this before?

Best regards.
Pages 1 2 3 4 ... 10