Re: [firebird-support] substring
>Hello Mark, > >Here the code of the sub-Procedure: > >create or alter procedure P_U_CN_TO_INT ( >CN_IN varchar(30)) >returns ( >INT_OUT integer, >STATUS smallint) >AS >declare variable I_ISNUMERIC smallint; >BEGIN > select true_param from p_u_isnumeric(:cn_in) into :i_isnumeric; > if(i_isnumeric = 1) then > begin >int_out = cast(cn_in as integer); >status = 1; > end > else > begin >int_out = 0; >status = 0; >if(cn_in is null) then cn_in = 'NULL!'; >execute procedure p_db_ins_error('P_U_CN_TO_INT','CN_IN: '|| :cn_in,11); > end > SUSPEND; > when any do > begin >execute procedure p_db_ins_error('P_U_CN_TO_INT','CN_IN: '|| :cn_in || ' >SQL-Fehler: ' || sqlcode ,10); >status = 0; >int_out = 0; >suspend; > end >END > >If I call it with '1234', I get 1234 as integer. For example 'AB12' - and I >get as status 0 an not an integer value. > >Dat is a string with many digits. I would spit it. When I do it with: >s_digits = substring(:dat from 1 for 4); and give the stored (sub) procedure >the :s_digits for input parameter, it works. Otherwise I give the stored >(sub) procedure the substring... directly, I get a sql-error -802. But it is >the same content in the variable. And then I get not an integer value, for >example 1234, it ends with this error. I wrote two tiny stored procedures without noticing the problem you are mentioning, that is, one stored procedure contained a substring when calling the other stored procedure. However, it was very basic procedures (no tables involved, nor conversion to numbers), so it could just be that my test doesn't cover your situation. What Firebird version are you using and how are you determining there is an error (e.g. I know that IB Expert and Hopper has some kind of stored procedure emulation, and errors in emulating Firebird is not the same as an error in Firebird)? Do you get the same error when using isql, IB_SQL or FlameRobin? Set
[firebird-support] Re: Firebird 2.5 conf for high load multiple and quick connections
Missed the prime number comment on the setting, thank you.
AW: [firebird-support] substring
Hello Mark, Here the code of the sub-Procedure: create or alter procedure P_U_CN_TO_INT ( CN_IN varchar(30)) returns ( INT_OUT integer, STATUS smallint) AS declare variable I_ISNUMERIC smallint; BEGIN select true_param from p_u_isnumeric(:cn_in) into :i_isnumeric; if(i_isnumeric = 1) then begin int_out = cast(cn_in as integer); status = 1; end else begin int_out = 0; status = 0; if(cn_in is null) then cn_in = 'NULL!'; execute procedure p_db_ins_error('P_U_CN_TO_INT','CN_IN: '|| :cn_in,11); end SUSPEND; when any do begin execute procedure p_db_ins_error('P_U_CN_TO_INT','CN_IN: '|| :cn_in || ' SQL-Fehler: ' || sqlcode ,10); status = 0; int_out = 0; suspend; end END If I call it with '1234', I get 1234 as integer. For example 'AB12' - and I get as status 0 an not an integer value. Dat is a string with many digits. I would spit it. When I do it with: s_digits = substring(:dat from 1 for 4); and give the stored (sub) procedure the :s_digits for input parameter, it works. Otherwise I give the stored (sub) procedure the substring... directly, I get a sql-error -802. But it is the same content in the variable. And then I get not an integer value, for example 1234, it ends with this error. Thanks in Advance. Best regards Olaf -Ursprüngliche Nachricht- Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Gesendet: Freitag, 18. Juli 2014 14:33 An: firebird-support@yahoogroups.com Betreff: Re: [firebird-support] substring On 18-7-2014 14:00, 'checkmail' check_m...@satron.de [firebird-support] wrote: > If I use the following code to extract a part of a string, it works fine: > > s_datum = substring(:dat from 13 for 4); s_datum = char(4) > > Now I would give the same a stored procedure, the first input > parameter is XXX varchar(30), it returns me the integer-value and the > status (passed or not) > > select int_out, status from P_u_cn_to_int(substring(:dat from 13 for > 4)) into :i_z1, i_status1; > > The second thing it does not work why? If I set the > input-parameter to 1234, it works, but the substring? "It does not work" is a bit vague. What is the value of dat, and what is the result of the substring? Does it match the expectations of the stored procedure? Mark -- Mark Rotteveel ++ Visit http://www.firebirdsql.org and click the Documentation item on the main (top) menu. Try FAQ and other links from the left-side menu there. Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ ++ Yahoo Groups Links
Re: [firebird-support] Firebird 2.5 connection issue
On 18-7-2014 15:55, 'E. D. Epperson Jr' dixonepper...@gmail.com [firebird-support] wrote: > If he were to use the alias.conf file on his client, would that solve > the issue and wouldn't be the best way to do this? Using aliases.conf is the better option for specifying a database. However it won't solve the problem if the alias is pointing to a non-existent file, or a file the user of the database service has no access to. Mark -- Mark Rotteveel
Re: [firebird-support] Firebird 2.5 connection issue
Mark, If he were to use the alias.conf file on his client, would that solve the issue and wouldn't be the best way to do this? -- Dixon Epperson
Re: [firebird-support] Firebird 2.5 connection issue
On 18-7-2014 14:34, Tim Ward t...@telensa.com [firebird-support] wrote: > On 18/07/2014 13:31, Mark Rotteveel m...@lawinegevaar.nl > [firebird-support] wrote: >> >> >> That would give an entirely different error. The database file either >> doesn't exist, or the user account running the Firebird service does not >> have access to this folder. >> > Yes, I've noticed that on Linux - you get the "file not found" message > when actually what it should say is "access denied". That is usually an intentional design of the security of the operating system. For example if you don't have access rights to a file and you also have no rights to list files in the parent folder, then you are not allowed to know if the file exists or not, therefor the error given is not access denied, but file not found. An Access denied error would leak knowledge about the existence of a file. However if you would have rights to list files in the folder, but no read and write rights on the file, you might get an Access denied instead. However, Firebird simply communicates the error given by the Operating System. Mark -- Mark Rotteveel
Re: [firebird-support] Firebird 2.5 connection issue
On 18/07/2014 13:31, Mark Rotteveel m...@lawinegevaar.nl [firebird-support] wrote: That would give an entirely different error. The database file either doesn't exist, or the user account running the Firebird service does not have access to this folder. Yes, I've noticed that on Linux - you get the "file not found" message when actually what it should say is "access denied". -- Tim Ward
Re: [firebird-support] substring
On 18-7-2014 14:00, 'checkmail' check_m...@satron.de [firebird-support] wrote: > If I use the following code to extract a part of a string, it works fine: > > s_datum = substring(:dat from 13 for 4); > s_datum = char(4) > > Now I would give the same a stored procedure, the first input parameter > is XXX varchar(30), it returns me the integer-value and the status > (passed or not) > > select int_out, status from P_u_cn_to_int(substring(:dat from 13 for 4)) > into :i_z1, i_status1; > > The second thing – it does not work – why? If I set the input-parameter > to ‘1234’, it works, but the substring? "It does not work" is a bit vague. What is the value of dat, and what is the result of the substring? Does it match the expectations of the stored procedure? Mark -- Mark Rotteveel ++ Visit http://www.firebirdsql.org and click the Documentation item on the main (top) menu. Try FAQ and other links from the left-side menu there. Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ ++ Yahoo Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/firebird-support/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/firebird-support/join (Yahoo! ID required) <*> To change settings via email: firebird-support-dig...@yahoogroups.com firebird-support-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: firebird-support-unsubscr...@yahoogroups.com <*> Your use of Yahoo Groups is subject to: https://info.yahoo.com/legal/us/yahoo/utos/terms/
Re: [firebird-support] Firebird 2.5 connection issue
On 18-7-2014 13:53, Σπύρος Μπιμπίλας bibi...@gmail.com [firebird-support] wrote: > FbConnection conn = new > FbConnection(@"Server=172.X.XX.XX;User=SYSDBA;Password=masterkey;Database=D:\ng\DATA\CUSTOMER.FDB"); > > But I get the following error: > > I/O error during "CreateFile (open)" operation for file > "D:\NG\DATA\CUSTOMER.FDB" > -Error while trying to open file > -The system cannot find the file specified > > Firewall port open on both pc ?? That would give an entirely different error. The database file either doesn't exist, or the user account running the Firebird service does not have access to this folder. Mark -- Mark Rotteveel
[firebird-support] substring
Hello, If I use the following code to extract a part of a string, it works fine: s_datum = substring(:dat from 13 for 4); s_datum = char(4) Now I would give the same a stored procedure, the first input parameter is XXX varchar(30), it returns me the integer-value and the status (passed or not) select int_out, status from P_u_cn_to_int(substring(:dat from 13 for 4)) into :i_z1, i_status1; The second thing - it does not work - why? If I set the input-parameter to '1234', it works, but the substring? Thanks in Advance Best regards Olaf
Re: [firebird-support] Firebird 2.5 connection issue
[firebird-support] Re: Firebird 2.5 connection issue
On 17 Jul 2014 22:02:59 -0700, agus_dela...@yahoo.com.mx [firebird-support] wrote: > > FbConnection conn = new > FbConnection(@"Server=172.X.XX.XX;User=SYSDBA;Password=masterkey;Database=D:\ng\DATA\CUSTOMER.FDB"); > > But I get the following error: > > I/O error during "CreateFile (open)" operation for file > "D:\NG\DATA\CUSTOMER.FDB" > -Error while trying to open file > -The system cannot find the file specified > According to the error, there is not databse file "D:\NG\DATA\CUSTOMER.FDB" in the server computer. Recheck the location and file name. -- Virgo Pärna virgo.pa...@mail.ee