Re: [GENERAL] Why I cannot call a function from within an SQL function?

2009-02-20 Thread Eus
Hi Ho! --- On Fri, 2/20/09, Marc Schablewski wrote: > You are using old-style function declaration where the > function body is > given as a string enclosed in '. You have to escape all > ' inside the > body by doubling them. Ah, yes, after re-reading the doc, I found: --- 8< --- The syntax of

Re: [GENERAL] Why I cannot call a function from within an SQL function?

2009-02-20 Thread Eus
Hi Ho! --- On Fri, 2/20/09, Ketema Harris wrote: > Use dollar quoting around your fiction body I'd double > up on the single quotes around the dash Yup, I got it. Thank you for your help. > Sent from my iPhone Best regards, Eus (FSF member #4445) In this digital era, where computing technol

Re: [GENERAL] Why I cannot call a function from within an SQL function?

2009-02-20 Thread Eus
Hi Ho! --- On Fri, 2/20/09, A. Kretschmer wrote: > In response to Eus : > > Hi Ho! > > > > The following query works well: > > > > select count (*) > > from item_audit > > where audit_ts >= '2008-05-30 00:00:00' > >and audit_ts <= '2008-10-30 > 00:00:00' > >and 'wst' != (sel

Re: [GENERAL] Why I cannot call a function from within an SQL function?

2009-02-20 Thread Ketema Harris
Use dollar quoting around your fiction body I'd double up on the single quotes around the dash Sent from my iPhone On Feb 20, 2009, at 8:14 AM, Eus wrote: Hi Ho! Sorry, let me revise the query a bit. I copied and pasted the original one from another big query. --- On Fri, 2/20/09, Eus

Re: [GENERAL] Why I cannot call a function from within an SQL function?

2009-02-20 Thread Eus
Hi Ho! --- On Fri, 2/20/09, Miguel Ángel MF wrote: > I'm no expert, but: > i might say U should Escape the ` ' ´ char in > "(select split_part(category, > '-', 2) " using something like "(select > split_part(category, \'-\', 2)" or > however it should be... Yes, you are right! Thank you for tel

Re: [GENERAL] Why I cannot call a function from within an SQL function?

2009-02-20 Thread Marc Schablewski
You are using old-style function declaration where the function body is given as a string enclosed in '. You have to escape all ' inside the body by doubling them. As an alternative, you can use $$ as the begin and end markers of your function body instead of the ' then you don't need to escape. E

Re: [GENERAL] Why I cannot call a function from within an SQL function?

2009-02-20 Thread Miguel Ángel MF
I'm no expert, but: i might say U should Escape the ` ' ´ char in "(select split_part(category, '-', 2) " using something like "(select split_part(category, \'-\', 2)" or however it should be... A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad

Re: [GENERAL] Why I cannot call a function from within an SQL function?

2009-02-20 Thread A. Kretschmer
In response to Eus : > Hi Ho! > > The following query works well: > > select count (*) > from item_audit > where audit_ts >= '2008-05-30 00:00:00' >and audit_ts <= '2008-10-30 00:00:00' >and 'wst' != (select split_part(category, '-', 2) > from description >

Re: [GENERAL] Why I cannot call a function from within an SQL function?

2009-02-20 Thread Eus
Hi Ho! Sorry, let me revise the query a bit. I copied and pasted the original one from another big query. --- On Fri, 2/20/09, Eus wrote: > The following query works well: select count (*) from item_audit as ia where audit_ts >= '2008-05-30 00:00:00' and audit_ts <= '2008-10-30 00:00:0

[GENERAL] Why I cannot call a function from within an SQL function?

2009-02-20 Thread Eus
Hi Ho! The following query works well: select count (*) from item_audit where audit_ts >= '2008-05-30 00:00:00' and audit_ts <= '2008-10-30 00:00:00' and 'wst' != (select split_part(category, '-', 2) from description where split_part(cate