vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi I am trying to append text onto the end of a text variable. I have the text variable P_IDT_ID, I want to add the letter S to the end of it, so I tried the following line in my code: P_IDT_ID := P_IDT_ID && cast(''S'' as text); However, I got the following error message: ERROR: operator does not exist: text && text HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts. CONTEXT: SQL statement "SELECT $1 && cast('S' as text)" PL/pgSQL function "f_create_index_currency_inversion" line 28 at assignment Note I am using PL/pgSQL. Can you help? Thanks Adam Adam Lawrence Mediasculpt Direct Line: +64 6 3546038 Email: adam@mediasculpt.com |
| |||
| decibel=# select 'moo' || 'cow'; moocow decibel=# What database uses &&? Access? I seem to recall seeing that somewhere before, but don't remember where... Note that || is ANSI SQL. On Thu, Oct 06, 2005 at 11:30:53AM +1300, Adam Lawrence wrote: > Hi > > I am trying to append text onto the end of a text variable. > > I have the text variable P_IDT_ID, I want to add the letter S to the end of it, so I tried the following line in my code: > > P_IDT_ID := P_IDT_ID && cast(''S'' as text); > > However, I got the following error message: > > ERROR: operator does not exist: text && text > HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts. > CONTEXT: SQL statement "SELECT $1 && cast('S' as text)" > PL/pgSQL function "f_create_index_currency_inversion" line 28 at assignment > > Note I am using PL/pgSQL. > > > Can you help? > > Thanks > Adam > > Adam Lawrence > Mediasculpt > > Direct Line: +64 6 3546038 > Email: adam@mediasculpt.com -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461 ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |
| |||
| On Wed, 2005-10-05 at 17:30, Adam Lawrence wrote: > Hi > > I am trying to append text onto the end of a text variable. > > I have the text variable P_IDT_ID, I want to add the letter S to the > end of it, so I tried the following line in my code: > > P_IDT_ID := P_IDT_ID && cast(''S'' as text); > > However, I got the following error message: > > ERROR: operator does not exist: text && text > HINT: No operator matches the given name and argument type(s). You > may need to add explicit type casts. > CONTEXT: SQL statement "SELECT $1 && cast('S' as text)" > PL/pgSQL function "f_create_index_currency_inversion" line 28 at > assignment Did you try using the || concatenation operator there? ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| ||||
| On Thu, Oct 06, 2005 at 11:30:53AM +1300, Adam Lawrence wrote: > Hi > > I am trying to append text onto the end of a text variable. > > I have the text variable P_IDT_ID, I want to add the letter S to the end of it, so I tried the following line in my code: > > P_IDT_ID := P_IDT_ID && cast(''S'' as text); Try standard SQL: P_IDT_ID || cast(''S'' as text) Hope this helps, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQFDRFsBIB7bNG8LQkwRAoyrAJwO+YhS0fGIICq6VZDxkh 2/FutggACeIZsb RQFXzkr3wf2ysd8UftWp40k= =OmXt -----END PGP SIGNATURE----- |