[SQL] ERROR: unterminated quoted string... help

2005-05-17 Thread Postgres Admin
Hi
I'm trying to insert encrypted data into the database and I'm noticing 
error dealing with quotes. Below is the error print out...

suggestions and/or at least point me in the direction to find a solution,
Thanks,
J

INSERT INTO sample.users (user_name, first_name) VALUES 
('jokers', '=ïµiF!¶6(ÖŸã?¾óˆÌ‘'-Iw‰iDÖiJÐÿ† %')

Warning: pg_query() [function.pg-query]: Query failed: ERROR: 
unterminated quoted string at or near "'=ïµi" at character 68 in 
/usr/local/apache2/htdocs/php/5/Theirry_DB.php on line 162

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [SQL] ERROR: unterminated quoted string... help

2005-05-17 Thread Postgres Admin
Scott Marlowe wrote:
Use a bytea field and use pg_escape_bytea() to prepare the data for
insertion.
 

Thanks Scott, I will try it now.
J
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
 subscribe-nomail command to [EMAIL PROTECTED] so that your
 message can get through to the mailing list cleanly


[SQL] PostgreSQL and Delphi 6

2005-06-15 Thread Postgres Admin
I have a client who wants to use Delphi as a front end to a Database, I
would like to use PostgreSQL over MSSQL and have been looking at the
psqlodbc project.  Will psqlodbc connect with Delphi 6? Basically, I'm
wondering if anyone has experience with it?   Any help will be appreciated.

Thanks,
J


---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


Re: [SQL] PostgreSQL and Delphi 6

2005-06-16 Thread Postgres Admin
So you installed psqlodbc 8 on the client machine with Delphi installed,
correct?  What problems did you have with cursors?  Any other suggestions?

Thanks a lot for the help!
J

Din Adrian wrote:
> we are using postgresql8 +psqlodbc8+ delphi7 ... the only problem is
> the  server side cursor = doesn't work properly ... so we are using
> client side  for datasets  :)
>
>


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


[SQL] Data insert

2005-08-20 Thread Postgres Admin
Sorry for the attachment, but copying and pasting this data does not work.

I don't have any idea how to insert the type of data into PostgreSQL. 
Basically, it's encrypted data in which I would like that keep raw format.

Thanks for any help,
J


sample_data.pdf
Description: Adobe PDF document

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


[SQL] plpgsql question

2005-08-30 Thread Postgres Admin
Can I do something like this:

CREATE TABLE sample (id SERIAL, node INTEGER, parent INTEGER);
INSERT INTO sample(node,parent) VALUES(1,0);
INSERT INTO sample(node,parent) VALUES(2,0);
INSERT INTO sample(node,parent) VALUES(3,1);
INSERT INTO sample(node,parent) VALUES(4,3)

CREATE OR REPLACE FUNCTION article_display(anyelement, anyelement)
RETURNS SETOF samle AS $$
DECLARE
articleRow sample%ROWTYPE;
BEGIN
FOR articleRow IN SELECT comments
FROM theirry.articles
ORDER BY article_id
DESC LIMIT $1
OFFSET $2 LOOP
RETURN NEXT articleRow;
END LOOP;
RETURN;
END;
$$ LANGUAGE plpgsql;

Thanks,
J

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [SQL] [ADMIN] plpgsql question

2005-08-30 Thread Postgres Admin
I have data in one table called articles and I would like to make a
function in which takes certain data from it and display the results.

Example:

CREATE TABLE articles (
article_id serial,
title varchar(200),
posted timestamp,
article_subject varchar(200),
article_body text,
allow_comments boolean,
comments smallint
);

I understand one way to display a results I would like is creating a
TYPE with the columns needed.

CREATE TYPE articles_output AS (
article_id int
title varchar(200),
article_body text,
comments smallint
);

Now I would like the function to display data using the LIMIT and OFFSET
option
ex: SELECT title, article_body, comments FROM articles ORDER BY
article_id DESC *LIMIT 4 OFFSET 0*;

this is function I created:

CREATE OR REPLACE FUNCTION article_display(integer, integer)
RETURNS SETOF article_output AS $$
DECLARE
articleRow article_output%ROWTYPE;
sampleRow RECORD;
BEGIN
FOR sampleRow IN SELECT title, article_body, comments
FROM articles
ORDER BY article_id
DESC LIMIT $1
OFFSET $2 LOOP
RETURN NEXT sampleRow;
END LOOP;
RETURN;
END;
$$ LANGUAGE plpgsql;

this is the error ->
ERROR:  set-valued function called in context that cannot accept a set
CONTEXT:  PL/pgSQL function "article_sample" line 10 at return next

Can I do this or are there better options?

Thanks for the help,
J

---(end of broadcast)---
TIP 6: explain analyze is your friend