[firebird-support] service_mgr is not defined - calling from PHP
Hi I am trying to write a PHP script to create a new Firebird user but when I run the code I get the following: Service DB - Could not connect: Cannot attach to services manager service var/lib/firebird/2.5/data/grip.fdb:service_mgr is not defined I am running Firebird 2.5 on Ubuntu. This is the PHP code: // connect to the service database if (($service = ibase_service_attach($host, $username, $password)) == FALSE) { $smarty-assign('msg', 'Service DB - Could not connect: ' . ibase_errmsg()); $smarty-display('feedback.tpl'); break;} Can I do this on Firebird and if so how? Thanks Neil [Non-text portions of this message have been removed]
[firebird-support] Re: service_mgr is not defined - calling from PHP
Seems that the rich text editor doesn't work and has stripped out all the formatting so here is the error message and code again: * Service DB - Could not connect: Cannot attach to services manager service var/lib/firebird/2.5/data/grip.fdb:service_mgr is not defined * // connect to the service database if (($service = ibase_service_attach($host, $username, $password)) == FALSE) { $smarty-assign('msg', 'Service DB - Could not connect: ' . ibase_errmsg()); $smarty-display('feedback.tpl'); break; } Thanks Neil --- In firebird-support@yahoogroups.com, grip_2ls lists@... wrote: Hi I am trying to write a PHP script to create a new Firebird user but when I run the code I get the following: Service DB - Could not connect: Cannot attach to services manager service var/lib/firebird/2.5/data/grip.fdb:service_mgr is not defined I am running Firebird 2.5 on Ubuntu. This is the PHP code: // connect to the service database if (($service = ibase_service_attach($host, $username, $password)) == FALSE) { $smarty-assign('msg', 'Service DB - Could not connect: ' . ibase_errmsg()); $smarty-display('feedback.tpl'); break;} Can I do this on Firebird and if so how? Thanks Neil [Non-text portions of this message have been removed]
[firebird-support] Re: service_mgr is not defined - calling from PHP
Thomas That is the error message you are referring to, the call is: --- if (($service = ibase_service_attach($host, $username, $password)) == FALSE) { --- the host is defined as: --- $host = '192.168.10.109:/var/lib/firebird/2.5/data/grip.fdb'; --- So I think that it is correct. Also if I query the database this works fine - only attaching to the service db is a problem. Neil --- In firebird-support@yahoogroups.com, Thomas Steinmaurer ts@... wrote: Seems that the rich text editor doesn't work and has stripped out all the formatting so here is the error message and code again: * Service DB - Could not connect: Cannot attach to services manager service var/lib/firebird/2.5/data/grip.fdb:service_mgr is not defined * I've no idea about the PHP usage, but the string above looks a bit weird. The first part shouldn't be the path to database, but the server/port information. E.g. the following is valid: localhost:service_mgr or localhost/3051:service_mgr Perhaps you are mixing something related to a database connection path vs. server name when using the ibase_service_attach call? -- With regards, Thomas Steinmaurer http://www.upscene.com/ // connect to the service database if (($service = ibase_service_attach($host, $username, $password)) == FALSE) { $smarty-assign('msg', 'Service DB - Could not connect: ' . ibase_errmsg()); $smarty-display('feedback.tpl'); break; } Thanks Neil --- In firebird-support@yahoogroups.com, grip_2ls lists@ wrote: Hi I am trying to write a PHP script to create a new Firebird user but when I run the code I get the following: Service DB - Could not connect: Cannot attach to services manager service var/lib/firebird/2.5/data/grip.fdb:service_mgr is not defined I am running Firebird 2.5 on Ubuntu. This is the PHP code: // connect to the service database if (($service = ibase_service_attach($host, $username, $password)) == FALSE) { $smarty-assign('msg', 'Service DB - Could not connect: ' . ibase_errmsg()); $smarty-display('feedback.tpl'); break;} Can I do this on Firebird and if so how? Thanks Neil [Non-text portions of this message have been removed] ++ Visit http://www.firebirdsql.org and click the Resources item on the main (top) menu. Try Knowledgebase and FAQ links ! Also search the knowledgebases at http://www.ibphoenix.com ++ Yahoo! Groups Links
[firebird-support] Re: service_mgr is not defined - calling from PHP
Lester/Thomas Thanks for your help - you are right as soon as I took out the db name it worked! Thanks again Neil --- In firebird-support@yahoogroups.com, Lester Caine lester@... wrote: grip_2ls wrote: * Service DB - Could not connect: Cannot attach to services manager service var/lib/firebird/2.5/data/grip.fdb:service_mgr is not defined * // connect to the service database if (($service = ibase_service_attach($host, $username, $password)) == FALSE) { $smarty-assign('msg', 'Service DB - Could not connect: ' . ibase_errmsg()); $smarty-display('feedback.tpl'); break; } What are you putting in $host? It should just be the machine name ... Services run on the server so do not need any reference to a particular database. -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php
[firebird-support] Is it possible to suspend a generator?
Hi I need to insert some data with fixed IDs. The table that I am inserting into already has data and a generator for the IDs. The new data is below the value of the generator and the IDs do not already exist. Can I suspend the generator while I insert these new rows and if so how? Thanks Neil
[firebird-support] Passing process name via jdbc
Hi I want to be able to pass the process name when connecting from JSP. Currently my code is setup as follows: String DB = jdbc:firebirdsql://123.123.123.123:3050/C:\\grip\\data\\grip.fdb; java.sql.Connection con = java.sql.DriverManager.getConnection(DB, user, password); Is it possible to add the process name to this and if so how? Thanks Neil
[firebird-support] Re: Passing process name via jdbc
Thanks for the info I will give it a go. Thanks Neil --- In firebird-support@yahoogroups.com, Mark Rotteveel mark@... wrote: On Tue, 24 Jan 2012 13:55:23 -, grip_2ls lists@... wrote: Hi I want to be able to pass the process name when connecting from JSP. Currently my code is setup as follows: String DB = jdbc:firebirdsql://123.123.123.123:3050/C:\\grip\\data\\grip.fdb; java.sql.Connection con = java.sql.DriverManager.getConnection(DB, user, password); Is it possible to add the process name to this and if so how? You can set the processname, but it is not possible to pass this in the connection string itself. To get Jaybird to pass a process name, you need to set the *system* property org.firebirdsql.jdbc.processName, eg by passing -Dorg.firebirdsql.jdbc.processName=processid on the commandline used to start your application (or somewhere in the startup scripts of your applicationserver). This is documented in the Jaybird 2.1.6 releasenotes (section What's new in Jaybird 2.1.6). A similar option is available for the pid. BTW: There is a separate mailinglist for questions on Jaybird: Firebird-Java, see http://www.firebirdsql.org/en/mailing-lists/ Mark
[firebird-support] Re: UK based Firebird on Linux expert
Lester It is the exact opposite of what we expected too! I should state up front that I did not setup this machine and the person that did has left. However, I do know that the system is running Firebird Classic 2.1 and that we are connecting from a Delphi client running on Windows 7. Looking at the Linux machine if I run blkid I get the following: /dev/cciss/c0d0p1: UUID=53d1653c-eb39-4f38-8291-942cd918694f TYPE=xfs /dev/cciss/c0d0p5: UUID=61c6f303-0576-4bbc-8f56-164968ac9684 TYPE=swap /dev/sda1: LABEL=HP v210w UUID=D06E29286E2908B4 TYPE=ntfs This implies that the majority of the disk is formatted as ntfs. I believe that this is because the machine is also used as samba mounts for Windows, but I could be wrong on this point. Does any of the above provide any pointers? Thanks Neil --- In firebird-support@yahoogroups.com, Lester Caine lester@... wrote: grip_2ls wrote: We have a client running Firebird on a dedicated multi-core Ubuntu server. For some reason the performance is awful compared to the Windows test server that we have. Queries are taking a few seconds on the windows machine are taking one and a half minutes on the Linux machine. Even a gbak is taking 3 hours on Linux compared to 45 minutes for the equivalent sized database on windows. I am looking for someone that is UK based that could do some paid consultancy to look at the issues and help us find a resolution. Does anyone have someone that they would recommend? I have to say that is the exact opposite of what I am finding on machines. Even where same machine is dual booted, windows is substantially slower than an SUSE linux setup. First question would have to be what 'setup' are you using on the linux box ... I still prefer classic but then it's running into PHP as the access layer. And what file system have you installed ... I believe that does have a strong bearing on performance. -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php
[firebird-support] Feature not supported on ODS version older than 11.1 - how to find out what?
Hi I am trying to create the following SP but am receiving the message Feature not supported on ODS version older than 11.1 but I cannot work out what it is that it doesn't like about the SP. For information this is a Firebird 2.1 database but it is an ODS v10 SET AUTODDL OFF; SET TERM ^ ; CREATE PROCEDURE SP_LATEST_VACANCY_STATUS ( VACID INTEGER ) RETURNS ( STAUSNAME VARCHAR(500), LASTUPDATE DATETIME ) AS BEGIN FOR SELECT FIRST 1 VST.STATUSNAME, VCH.LASTUPDATE FROM VACCONT VCO, VACSTATUS VST, VACCONTHIST VCH WHERE VCO.VACID = :VACID AND VCO.STATUS = VST.STATUSID AND VCH.VACID = VCO.VACID AND VCO.CONTID = VCH.CONTID AND VCO.STATUS = VCH.STATUS ORDER BY VCO.STATUS DESC INTO :STATUSNAME, :LASTUPDATE DO SUSPEND; END ^ SET TERM ; ^ COMMIT WORK;
[firebird-support] Re: Help with trigger syntax
Thank you all for your help and advice. N --- In firebird-support@yahoogroups.com, Mark Rotteveel mark@... wrote: On Tue, 01 Nov 2011 10:00:38 +1300, Helen Borrie helebor@... wrote: At 07:56 AM 1/11/2011, you wrote: On 31-10-2011 17:46, grip_2ls wrote: Hi Mark Thanks for the advise but I don't think that is the issue. If you remove the second select statement it compiles and runs fine. That was exactly the issue I was pointing out. You are using SELECT without INTO to call SendMail. That doesn't work as Sean also pointed out. Furthermore, invoking that Sendmail procedure as a select procedure is not sensible in this environment or any other. Make it an executable procedure and, in the trigger code, call it with EXECUTE PROCEDURE (:var1, :var2, etc.) Selectable procedures are intended to return sets and shouldn't be used to execute DML. Helen, it was actually a singleton select against RDB$DATABASE calling the SendMail UDF in the column list.
[firebird-support] Help with trigger syntax
Once again I am struggling with the syntax of a trigger. When I run the following I get the error: Error at line 3: Dynamic SQL ErrorSQL error code = -104Token unknown - line 19, column 25; There isn't even a semi-colon on line 19! Any advice gratefully received. Neil SET TERM ^ ; /* Triggers only will work for SQL triggers */ CREATE TRIGGER TRGAIBOOKING_STAGE_HISTORY FOR BOOKING_STAGE_HISTORYACTIVE AFTER INSERT POSITION 0AS DECLARE EMAIL VARCHAR(255); DECLARE DESCRIPTION VARCHAR(50); BEGIN SELECT BST.EMAIL, BST.DESCRIPTION FROM BOOKING_STAGE BST WHERE BST.ID = NEW.STAGEID INTO :email, :description; SELECT SendMail('ale...@2ls.com', :email, 'Change of status for booking '||NEW.BOOKINGID, 'Just to let you know that booking '||NEW.BOOKINGID||' has now reached stage '||:description, 'auth.smtp.1and1.co.uk', '25', 'b...@2ls.com', '8Burgess') FROM rdb$database; END ^ COMMIT WORK ^SET TERM ;^ [Non-text portions of this message have been removed]
[firebird-support] Re: Help with trigger syntax
Mark For some reason I cannot get the pre/code html tags to work so I have put the code here: http://pastebin.com/p3kt7bud Line 19/25 is the second character of the smtp server. Thanks for pointing out my lack of security - I will change that now. Thanks N --- In firebird-support@yahoogroups.com, Mark Rotteveel mark@... wrote: On Mon, 31 Oct 2011 15:19:30 -, grip_2ls lists@... wrote: Once again I am struggling with the syntax of a trigger. When I run the following I get the error: Error at line 3: Dynamic SQL ErrorSQL error code = -104Token unknown - line 19, column 25; There isn't even a semi-colon on line 19! Any advice gratefully received. Neil SET TERM ^ ; /* Triggers only will work for SQL triggers */ CREATE TRIGGER TRGAIBOOKING_STAGE_HISTORY FOR BOOKING_STAGE_HISTORYACTIVE AFTER INSERT POSITION 0AS DECLARE EMAIL VARCHAR(255); DECLARE DESCRIPTION VARCHAR(50); BEGIN SELECT BST.EMAIL, BST.DESCRIPTION FROM BOOKING_STAGE BST WHERE BST.ID = NEW.STAGEID INTO :email, :description; SELECT SendMail('alerts@...', :email, 'Change of status for booking '||NEW.BOOKINGID, 'Just to let you know that booking '||NEW.BOOKINGID||' has now reached stage '||:description, 'auth.smtp.1and1.co.uk', '25', 'bulk@...', '8Burgess') FROM rdb$database; END ^ COMMIT WORK ^SET TERM ;^ Could you post it with a better formatted version of both the error message and the query, and indicate what is line 19, column 25? BTW: It looks like you posted the username and password for the mailaccount that can be used for bulk-emailing at your ISP. If that is the case you might want to change the password of account bulk@... before it gets abused.
[firebird-support] Re: Help with trigger syntax
Hi Mark Thanks for the advise but I don't think that is the issue. If you remove the second select statement it compiles and runs fine. N --- In firebird-support@yahoogroups.com, Mark Rotteveel mark@... wrote: On Mon, 31 Oct 2011 17:06:34 +0100, Mark Rotteveel mark@... wrote: I am a bit rusty in my PSQL and trigger code, but as far as I know you can do SELECT without INTO like you are doing when calling that SendEmail function (or procedure?). Uhm, that should have been '.. you can't do SELECT without INTO'. I really need to learn to proofread before clicking send. Mark
[firebird-support] Re: Find out how a user has connected to the database
Thomas We would be connected from Delphi and all our clients are on 2.1. But before I get this implemented in code I would like to see it in SQL. I have tried in both IBQuery and isql but whenever I run the following: select * from MON$ATTACHMENT; I always get an error that the table is unknown. Should I be able to run that statement from isql? Thanks Neil --- In firebird-support@yahoogroups.com, Thomas Steinmaurer ts@... wrote: Hi Neil, Thanks for the quick response. I have a few further questions... When I try and select from this table I get a message to say that it doesn't exist. I am logged in as sysdba - do I need to do anything else? My db is 2.1.3.18185 and the GDS32.dll is version 6.3.3.18185 I assume that the remote process property has to be set as part of the connection string? And finally, I assume that this is available via an api? The following is from the 2.1 release notes. - columns MON$REMOTE_PID and MON$REMOTE_PROCESS contains non-NULL values only if the client library is version 2.1 or higher - column MON$REMOTE_PROCESS can contain a non-pathname value if an application has specified a custom process name via DPB But I know from Jaybird for instance, that one needs to specify specific properties, see: http://tracker.firebirdsql.org/browse/JDBC-118 But I guess this is related to the thin driver not communicating via the client library. What access technology do you use and is your mentioned gds32.dll version the one on the client or do we speak about a local installation here anyway? -- With regards, Thomas Steinmaurer * Upscene Productions - Database Tools for Developers http://www.upscene.com/ * My Blog http://blog.upscene.com/thomas/index.php * Firebird Foundation Committee Member http://www.firebirdsql.org/en/firebird-foundation/ Thanks Neil --- In firebird-support@yahoogroups.com, Thomas Steinmaurerts@ wrote: Neil, I know that it is possible to see who is currently connected to a database but is it possible to see how they have connected? By which I mean is it possible to see whether they are connected from, say, IBConsole, IBQuery or an application? MON$REMOTE_PROCESS in MON$ATTACHMENT, but AFAIK this needs at least V2.1 of the client libraries. -- With regards, Thomas Steinmaurer * Upscene Productions - Database Tools for Developers http://www.upscene.com/ * My Blog http://blog.upscene.com/thomas/index.php * Firebird Foundation Committee Member http://www.firebirdsql.org/en/firebird-foundation/ ++ Visit http://www.firebirdsql.org and click the Resources item on the main (top) menu. Try Knowledgebase and FAQ links ! Also search the knowledgebases at http://www.ibphoenix.com ++ Yahoo! Groups Links
[firebird-support] Re: Find out how a user has connected to the database
Hi Thanks all for the information. The database is ODS 10.1 so I guess that is the problem. Thanks you all for your help. I will upgrade the db. Neil --- In firebird-support@yahoogroups.com, Thomas Steinmaurer ts@... wrote: Hello Neil, We would be connected from Delphi and all our clients are on 2.1. But before I get this implemented in code I would like to see it in SQL. I have tried in both IBQuery and isql but whenever I run the following: select * from MON$ATTACHMENT; I always get an error that the table is unknown. Should I be able to run that statement from isql? Yes, but it's MON$ATTACHMENTS and not MON$ATTACHMENT, sorry. This also requires a database with an ODS 11.1 or higher database. To check the ODS, e.g. use gstat -h or AFAIR a: SHOW DATABASE; in isql shows the ODS as well. So, if you are connecting with a 2.1 server to an older (pre ODS 11.1) database, the monitoring tables aren't available. To upgrade a database to the server ODS, run a backup with the old Firebird server and a restore with 2.1. HTH. -- With regards, Thomas Steinmaurer * Upscene Productions - Database Tools for Developers http://www.upscene.com/ * My Blog http://blog.upscene.com/thomas/index.php * Firebird Foundation Committee Member http://www.firebirdsql.org/en/firebird-foundation/ Thanks Neil --- In firebird-support@yahoogroups.com, Thomas Steinmaurerts@ wrote: Hi Neil, Thanks for the quick response. I have a few further questions... When I try and select from this table I get a message to say that it doesn't exist. I am logged in as sysdba - do I need to do anything else? My db is 2.1.3.18185 and the GDS32.dll is version 6.3.3.18185 I assume that the remote process property has to be set as part of the connection string? And finally, I assume that this is available via an api? The following is from the 2.1 release notes. - columns MON$REMOTE_PID and MON$REMOTE_PROCESS contains non-NULL values only if the client library is version 2.1 or higher - column MON$REMOTE_PROCESS can contain a non-pathname value if an application has specified a custom process name via DPB But I know from Jaybird for instance, that one needs to specify specific properties, see: http://tracker.firebirdsql.org/browse/JDBC-118 But I guess this is related to the thin driver not communicating via the client library. What access technology do you use and is your mentioned gds32.dll version the one on the client or do we speak about a local installation here anyway? -- With regards, Thomas Steinmaurer * Upscene Productions - Database Tools for Developers http://www.upscene.com/ * My Blog http://blog.upscene.com/thomas/index.php * Firebird Foundation Committee Member http://www.firebirdsql.org/en/firebird-foundation/ Thanks Neil --- In firebird-support@yahoogroups.com, Thomas Steinmaurerts@ wrote: Neil, I know that it is possible to see who is currently connected to a database but is it possible to see how they have connected? By which I mean is it possible to see whether they are connected from, say, IBConsole, IBQuery or an application? MON$REMOTE_PROCESS in MON$ATTACHMENT, but AFAIK this needs at least V2.1 of the client libraries. -- With regards, Thomas Steinmaurer * Upscene Productions - Database Tools for Developers http://www.upscene.com/ * My Blog http://blog.upscene.com/thomas/index.php * Firebird Foundation Committee Member http://www.firebirdsql.org/en/firebird-foundation/ ++ Visit http://www.firebirdsql.org and click the Resources item on the main (top) menu. Try Knowledgebase and FAQ links ! Also search the knowledgebases at http://www.ibphoenix.com ++ Yahoo! Groups Links ++ Visit http://www.firebirdsql.org and click the Resources item on the main (top) menu. Try Knowledgebase and FAQ links ! Also search the knowledgebases at http://www.ibphoenix.com ++ Yahoo! Groups Links
[firebird-support] Re: Find out how a user has connected to the database
Thanks Helen, I have just been looking at your Firebird 2 Supplement to work out just exactly how I do it! Neil --- In firebird-support@yahoogroups.com, Helen Borrie helebor@... wrote: At 09:31 PM 20/10/2011, grip_2ls wrote: Hi Thanks all for the information. The database is ODS 10.1 so I guess that is the problem. Thanks you all for your help. I will upgrade the db. ...after CAREFULLY studying the v.2.1 release notes and migration/compatibility guide, natch. ;-) You have a major ODS upgrade taking a v.1.5 database through to ODS 11.0 and another leap to 11.1. ./heLen
[firebird-support] Re: What to install for Firebird client on Ubuntu
Hi Mark Coming from a Windows background what you are suggesting sounds counter intuitive but it does seem like the simplest approach. Thanks Neil --- In firebird-support@yahoogroups.com, markopetejan marko.petejan@... wrote: Yes, manually. It's much harder and you en up saving nothing. On the contrary: you might need even more disk space. I suggest using installation as it is and simply not starting the server at the end.