[plt-scheme] SrPersist and bind-parameter

From: ifconfig (ifconfignslookup at hotmail.com)
Date: Thu Feb 19 14:29:15 EST 2004

Why the "AND rel = ?"?

ifconfig
BAGOS
http://bagos.sourceforge.net


----- Original Message ----- 
From: "Alex Peake" <alex.peake at comac.com>
To: <plt-scheme at list.cs.brown.edu>
Sent: Thursday, February 19, 2004 2:12 AM
Subject: [plt-scheme] SrPersist and bind-parameter


>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> Could someone please help with this?
>
> (define table-select
>   (string-append
>     "SELECT rel, attr, domain, domlength, domprec, nullable, PKCOLSEQNUM
AS pkpos, fkpos, fktable,
> fkattr "
>     " FROM Gen_Schema, syspkconstraints PK"
>     " WHERE Gen_Schema.rel = PK.Name (+)"
>     " AND Gen_Schema.attr = PK.ColName (+)"
>     " AND rel = ?"))
>
> (define tname-buffer (make-buffer '(sql-c-char 18)))
> (define tname-indicator (make-indicator))
> (write-buffer! tname-buffer "INVENTORY")
> (prepare hstmt table-select)
> (bind-parameter hstmt 1 'sql-param-input 'sql-varchar 18 tname-buffer
tname-indicator)
> (sql-execute hstmt)
>
> returns no rows, even though a check of tname-buffer reveals "INVENTORY".
The database gets a NULL
> binding - the parameter is empty.
>
>
> and yet with:     " AND rel = 'INVENTORY'"))
>
> I get all the appropriate rows.
>
> I obviously have the process wrong, but cannot find what.
>
> Alex
>
>


Posted on the users mailing list.