Re: [SQL] Function .. AS..?

2005-02-09 Thread Michael Fuhr
On Wed, Feb 09, 2005 at 04:57:14PM -0400, Ing. Jhon Carrillo wrote: > Those instructions are good but i want to call this function only > for " select consulta_contacto(1)" nothing more, Is really necesary > to use "AS ..."? > > this is the call: > > select * from consulta_contacto(1) as (c

Re: [SQL] [HACKERS] Function .. AS..?

2005-02-09 Thread Stephan Szabo
On Wed, 9 Feb 2005, Ing. Jhon Carrillo wrote: > Those instructions are good but i want to call this function only for " > select consulta_contacto(1)" nothing more, Is really necesary to use > "AS ..."? If it absolutely needs to be setof record, yes. It may be more appropriate to make a composi

[SQL] Function .. AS..?

2005-02-09 Thread Ing. Jhon Carrillo
Those instructions are good but i want  to call this function  only  for  " select  consulta_contacto(1)"  nothing more,  Is really necesary to use  "AS ..."?   this is  the call:     select * from  consulta_contacto(1) as (cont_codigo  integer,    

Re: [SQL] parsing a string with a hexadecimal notation

2005-02-09 Thread Tom Lane
Achilleus Mantzios <[EMAIL PROTECTED]> writes: > You can do something like > foodb=# SELECT int4(X'FF'::bit varying); > int4 > -- > 255 > (1 row) > but i suspect you must prepare your statement out of sql. No, I think you could do it with a placeholder if you wanted. The secret is the (p

Re: [SQL] How to iterate through arrays?

2005-02-09 Thread John DeSoi
On Feb 9, 2005, at 9:26 AM, NosyMan wrote: I think the problem is not there. I got the following error: 'ERROR: syntax error at or near "[" at character 1234', the line is: RAISE NOTICE '% ...',update_query_params[1]; The problem here is RAISE, NOTICE, etc. can only use simple variables in the f

Re: [SQL] How to iterate through arrays?

2005-02-09 Thread NosyMan
I think the problem is not there. I got the following error: 'ERROR: syntax error at or near "[" at character 1234', the line is: RAISE NOTICE '% ...',update_query_params[1]; May be someone give a code sample... Thanks Pe data de Mie 09 Feb 2005 16:16, ati scris: > - use TEXT instead of CHA

Re: [SQL] How to iterate through arrays?

2005-02-09 Thread PFC
- use TEXT instead of CHAR (what is CHAR without (n) ?) - inintialize your array with '{}' because it is created as NULL if you just declare it without setting it to an empty array. Hi there, I'm trying to iterate through arrays in PL/PGSQL: DECLARE update_query CHAR

[SQL] How to iterate through arrays?

2005-02-09 Thread NosyMan
Hi there, I'm trying to iterate through arrays in PL/PGSQL: DECLARE update_query CHAR; update_query_params CHAR ARRAY[6]; BEGIN update_query_params[1]:='some text';

Re: [SQL] parsing a string with a hexadecimal notation

2005-02-09 Thread Achilleus Mantzios
O KΦPFERL Robert έγραψε στις Feb 9, 2005 : > I intend to retrieve an int value in an integer variable from a string with > a hexadecimal notation of a number. > Which function is appropriate to do > i int4 > i = ???('BEAF') You can do something like foodb=# SELECT int4(X'FF'::bit varying);

[SQL] parsing a string with a hexadecimal notation

2005-02-09 Thread KÖPFERL Robert
I intend to retrieve an int value in an integer variable from a string with a hexadecimal notation of a number. Which function is appropriate to do i int4 i = ???('BEAF') ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [E

[SQL] copy rows

2005-02-09 Thread drdani
Hi, What is the simplest solution in plpgsql to copy some rows in a table? I would like to do something like: select some rows do for each row skip serial field \ modify one field |-- what is the simplest way for this? insert as new row / Is it possible to insert a record t