Re: Question about "prepare statements"
Posted in 1993
From A. J. Dibbins: * * Hi, * * My question is this, I am assured that both of these examples work on most * machines, but my Sun running Sunos 4.1.1 and I4GL v4.0 complains about the * first example. * * Eg1 * * prepare s1 from "insert into fred values (?,?,?,?) * execute s1 using "andy_d","CUSTOMER","JUNK","JUNK") * * Eg2 * * define str char(80) * * let str = "insert into fred values (?,?,?,?)" * prepare s1 from str * execute s1 using "andy_d","CUSTOMER","JUNK","JUNK" * * * The manual uses example 2 style code, but I am assured by the programmer * that Eg1 has worked on other machines/setups. * * Would somebody like to offer any explanation. I don't have an explanation, it's possibly a known bug, but I have a work around. Change Eg2 to: define str char(80), var1 char(6), var2 char(8), var3 char(4) let str = "insert into fred values (?,?,?,?)" let var1 = "andy_d" let var2 = "CUSTOMER" let var3 = "JUNK" prepare s1 from str execute s1 using var1, var2, var3, var3 Hope this helps, Robert Minter |Data Systems Support| \\\\\\_/// Programmer, Software Development | Orange, CA | ( _ _ ) internet: rob@dssmktg.com | Tel: 714.771.0454 | (| ^ |) bangpath: uunet.uu.net!dssmktg!rob| Fax: 714.771.3028 | \\`-'/ I used to not know, now I know I don't know. \\_/