[SQL] What libraries need to be included in C program for encrypt and decrypt functions?

2005-08-16 Thread The One
Hi,   Can some body tell me what I need to include in the makefile for my C program so it will call the correct encrypt/decrypt functions.   This is what I have in the makefile testcrypto:  ${CC} -o ${BIN}/testcrypto.exe testcrypto.c -I/usr/include/postgresql/server/libpq -L/lib/postgresql -lpq -lc

Re: [SQL] ARRAYs and INDEXes ...

2005-08-16 Thread Greg Stark
"Marc G. Fournier" <[EMAIL PROTECTED]> writes: > SELECT * FROM customers WHERE monthly_balance[6] = 0.00; This, like the other poster said, can be accomplished with a set of simple expression indexes. > As an example ... or > > SELECT * FROM customers WHERE 0.00 = any (monthly_balance); This w

Re: [SQL] What libraries need to be included in C program for encrypt and decrypt functions?

2005-08-16 Thread Owen Jacobson
As I mentioned in email, the function "encrypt" exposed by libcrypt (the -lcrypt part of your command line) has nothing to do with the "encrypt" function available in pgcrypto.sql, which You Cannot Call From C.  You have to embed calls to it inside an SQL query like   INSERT INTO some_table

[SQL] how to do a select * and decrypt a column at the same time?

2005-08-16 Thread The One
Hello,   I have a table with one encrypted column. How can I do a select statement such that it will select all columns from the table and at the same time will decrypt it too?__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection ar

Re: [SQL] how to do a select * and decrypt a column at the same time?

2005-08-16 Thread Bruno Wolff III
On Tue, Aug 16, 2005 at 12:53:51 -0700, The One <[EMAIL PROTECTED]> wrote: > Hello, > > I have a table with one encrypted column. > How can I do a select statement such that it will select all columns from the > table and at the same time will decrypt it too? You want to explicitly list all o

[SQL] converting varchar to integer

2005-08-16 Thread tv
Hi, I have a varchar column, and I need to 1) check the value in it is an integer 2) get the integer value (as integer) The problem is I can't suppose the're only correct values - ie there can be something like 'xssdkjsd', '230kdd' or even an empty string etc. I've been loo

Re: [SQL] converting varchar to integer

2005-08-16 Thread Josh Berkus
Tomas, >I've written two on my own (see the functions below), >but maybe there's something faster? Nope. 'cept I'd combine those two functions into a single function that returns NULL if the value isn't an integer. -- --Josh Josh Berkus Aglio Database Solutions San Francisco ---