Re: [SQL] how to concatenate in PostgreSQL

2012-03-26 Thread Steve Crawford
On 03/24/2012 04:43 AM, Rehan Saleem wrote: hi , how can we concatinate these lines and execute sql command In what? Psql? A PL/pgSQL function. C/Java/PHP/Python/Perl/Erlang/Lua? setsql = 'select user,username, firstname ' set sql += ' lastname, cardno from table1 where userid=' +

Re: [SQL] MS-SQL to PostgreSql

2012-03-26 Thread Robins Tharakan
Hi Rehan, p.s.: Please send all mails to list, so that all can see the response. The function returns for all, probably because you see to be RETURN'ing the values before any processing. In the MSSQL you generate the SQL in a string and then execute the SQL. However, for some reason you seem t

Re: [SQL] how to concatenate in PostgreSQL

2012-03-26 Thread Robins Tharakan
Hi, Probably you're looking for these set of articles. http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL#Microsoft_SQL_Server The second article (by Ethan) has good small hints for things such as the query that you ask in this thread, when migrating from MSSQL to P

Re: [SQL] MS-SQL to PostgreSql

2012-03-26 Thread Robins Tharakan
Hi, What all have you tried? What are you getting stuck at? Let us see some samples and may be someone could provide some input. -- Robins On 03/26/2012 01:19 PM, Rehan Saleem wrote: hi, i am trying to convert this mssql store procedure to postgresql function but it is not giving me the desire

[SQL] Postgresql function with temporary tables

2012-03-26 Thread Rehan Saleem
hi everyone , i have converted a ms-sql store procedure into PostgreSQL function , but my PostgreSQL function is not giving the same output as my ms-sql procedure does, in this ms-sql store procedure putting the result of 2 queries in two temporary tables and displaying those column values which

[SQL] MS-SQL to PostgreSql

2012-03-26 Thread Rehan Saleem
hi, i am trying to convert this mssql store procedure to postgresql function but it is not giving me the desired output ,this function is returning a table and you dont need to worry about what it is returning all i concern the body part of the function how to transform the ms-sql code into post