Re: [SQL] Select for LEFT JOIN

2001-05-28 Thread Anatoly K. Lasareff
> "LL" == Linh Luong <[EMAIL PROTECTED]> writes: LL> Hi, LL> I am trying to do a 2 joins between 3 tables. LL> ie) LL> select , coalesce(TRR.ABC, SOC.ABC) as newABC, ... LL> from A join (B join C on (..)) on (..)) as TRR LL> left join LL> (D join E on (..)) as SOC on (TRR.Field1=SO

[SQL] ERROR: parser: parse error at or near "$1"

2001-05-28 Thread Najm Hashmi
HI all, I am getting this weird syntax error i.e. parse error at or near "$1" and I am not even passing any arguement to my pl/pgsql function. Here is my function , please someone could elobarte before I go nuts :) drop function populate_art_details(); create function populate_art_details() return

Re: [SQL] Problems with pg_dump (on Debian i386)

2001-05-28 Thread Tom Lane
Joachim Trinkwitz <[EMAIL PROTECTED]> writes: > CREATE TABLE "lplan" ( > ... > "art" character[] NOT NULL, I believe that PG 7.1 interprets that field declaration as "art" character(1)[] NOT NULL, and then truncates your input to match. 7.2-to-be rejects the input with comp

[SQL] Seq Scan

2001-05-28 Thread Linh Luong
Hi, I am trying to execute this query I wrote and it is not returning at a reasonable time to the browser. I took the query and ran EXPLAIN on it and it displayed that every JOIN I do it is doing a Seq Scan on it. I have indexes on that table but it doesn't seem to use it. Is there a way I can

Re: [SQL] SQL specified sort

2001-05-28 Thread [EMAIL PROTECTED]
Jeff, If you want to receive your data in an order which you specify manually, the easiest way to accomplish this is to add a separate field which contains an int4 value used by you to specify the order. E.g. myval | sortint _ H29| 2 214| 1 200| 3

[SQL] sql user management

2001-05-28 Thread Vladislav Breus
With SQL requests I can create, change privileges of the user... Can I access to user information only with sql-requests ? - Is the user a member of group ? - Has he rights to table ? ---(end of broadcast)--- TIP 6: Have you searched our list ar

[SQL] altering date type of a column

2001-05-28 Thread Madness
Hi, I have a table in one of my databases which has a row of type char. I would like to convert it to int data type. Is there an easy way for doing it? With regards, Devrim GÜNDÜZ [EMAIL PROTECTED] ---(end of broadcast)--- TIP 6: Have you sear

[SQL] Recursive select

2001-05-28 Thread Martin Smetak
Hi all! Anyone know if it's possible to make a recursive select from a table ? My problem: I got a table of "some categories" which all points to its parrent one(tree)...shown below. And I want to select all names of parrent categories of one child, lets say "fast[4]". Now I'm solving that with m

[SQL] Re: batch file

2001-05-28 Thread bugi
Create the file for example command.sql and log into the database psql mydbase and write command \i command.sql U¿ytkownik "Milen" <[EMAIL PROTECTED]> napisa³ w wiadomo¶ci [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all!, > > I want to execute several SQL statements one after another. > Do

[SQL] Ynt: corrupted tables !!!

2001-05-28 Thread Madness
Hi, What kind of a corruption? Do you lose data? As far as I tested; bas transactions do not destroy db. With regards, Devrim "J.Fernando Moyano" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > I have big

[SQL] Difficult SQL Statement

2001-05-28 Thread Jim
I have a table that has the following columns: AUTHOR_NO, ASMT_CODE, & STATUS. The table would look something like this: AUTHOR_NO ASMT_CODE STATUS 12345 1 PASSED 12345 2 FAILED 12345 3 FAILED 12345 4 PASSED 12346 1 PASSED 12346 2 PASSED

[SQL] Ynt: where's ALTER TABLE table DROP [ COLUMN ] column???

2001-05-28 Thread Madness
Hi, I want to make a little correction. The correct syntax should be: SELECT [all columns except named] into mytemp1 from [$table_name] ; drop table [$table_name]; SELECT * into [$table_name] from mytemp1; With regards, Devrim GÜNDÜZ Keith Gray <[EMAIL PROTECTED]> wrote in message [EMAIL PROTE

[SQL] sql user management

2001-05-28 Thread Vladislav Breus
With SQL requests I can create, change privileges of the user... Can I access to user information only with sql-requests ? - Is the user a member of group ? - Has he rights to table ? ---(end of broadcast)--- TIP 2: you can get off all lists at

[SQL] Triggers in 7.0.x and SQL syntax.

2001-05-28 Thread D0
Well, after dinking around for serveral hours I decided to beg for help on here about triggers and look like an idiot all in one slew. I have two tables. A and B. Whenever A has a row inserted I want to grab that newly created primary key from it's row in table A and insert it into a field in t

[SQL] SQL specified sort

2001-05-28 Thread jeffrey morrison
I was wondering if you could help me out with a problem I'm having. Say for example I have data coming out like: H29 214 200 099 How would I use a sort to be able to make the output look like 214 H29 200 099 I don't believe their is a way to do an ORDER BY in a specific order. Any help you co

[SQL] Select for LEFT JOIN

2001-05-28 Thread Linh Luong
Hi, I am trying to do a 2 joins between 3 tables. ie) select , coalesce(TRR.ABC, SOC.ABC) as newABC, ... from A join (B join C on (..)) on (..)) as TRR left join (D join E on (..)) as SOC on (TRR.Field1=SOC.Field2) When I run this it says that there is an ambiguous field. Yes after

[GENERAL] Re: Return cursor

2001-05-28 Thread Sergey E. Volkov
If you are planing to use ecpg : exec sql declare cuserbase cursor for select column1, column2, column3 from my_table order by 1; exec sql open cuserbase; exec sql whenever not found do break; while ( true ) { exec sql fetch cuserbase into ... // do same work } exec sql close cuserb

[GENERAL] Re: Return cursor

2001-05-28 Thread Alexander Dederer
Can you send PL/SQL code and back-end code used this PL/SQL code? Myself trubles with CURSOR I resolve use LIMIT ... OFFSET ... Alla wrote: > I am porting our database from Oracle to PostgreSQL > > I know quite a lot about Oracle and pretty much nothing about > PostgreSQL :-)) > > I have a lo

[SQL] Re: Stored Procedures?

2001-05-28 Thread Reinoud van Leeuwen
On Thu, 24 May 2001 13:45:46 + (UTC), [EMAIL PROTECTED] (Tod McQuillin) wrote: >Postgres doesn't have stored procedures in the same way that other >databases like oracle and sybase do. But it does have stored functions, >and they can be used in almost exactly the same way. In Sybase I am us

[SQL] START for SERIAL type?

2001-05-28 Thread jferry
When you create a SEQUENCE, you are allowed to specify a START. Is there a way to specify a START if you use a serial type in a CREATE TABLE statement? I'm envisioning something like: CREATE TABLE foo ( foo_idserial ( 101 ) ); ---(end of broadcast)-

Re: [SQL] Problems with pg_dump (on Debian i386)

2001-05-28 Thread Joachim Trinkwitz
Tom Lane <[EMAIL PROTECTED]> writes: > Could we see a specific example please --- preferably, enough of the > dump file to reproduce the problem? Also, exactly *what* version hop > are we talking about? Example file (extract of my dump file) is attached -- the misbehaviour occurs even when simp