[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
[sqr-users] Re: Connect by clause problem
On Fri, Nov 18, 2005 at 04:40:40PM -0500, Ray, Christine Marie wrote:
> I have some sqr code that works in one environment but will not compile
> to run from the UNIX command line.
What version of SQR is used in the environment that works (and what OS)?
Are you sure the error is a compile time error? For example, did you
pass a value for $folder on the command line? If so, try running the
program without that to see if a prompt for $folder is printed before
the error message shows up. (Normally I would not expect SQR to try to
compile a begin-select block that contained dynamic SQL until run time.)
I don't have a good suggestion as to why the program works in one
environment and not the other... but you may be able to avoid the
problem:
> begin-procedure main
> begin-select
[...]
> from dss.ie_mstr_cat_alph_v
> start with ro_tree_entry_lbl like [$folder]
[...]
> end-select
> end-procedure ! main
>
>
>
> begin-procedure get_input
> Input $folder
> Let $folder = '''' || $folder || ''''
> end-procedure ! get_input
>
Are you sure you need to use dynamic SQL here? I think your select
would work just as well if you said
start with ro_tree_entry_lbl like $folder
(and then didn't add extra ' characters around the input value in
get_input).
(And if the user is never going to enter a folder name with wildcard
characters, you might just want to use "=" instead of "like".)
Nathan
----------------------------------------------------------------------------
Nathan Stratton Treadway - nathanst@ontko.com - Mid-Atlantic region
Ray Ontko & Co. - Software consulting services - http://www.ontko.com/
GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt ID: 1023D/ECFB6239
Key fingerprint = 6AD8 485E 20B9 5C71 231C 0C32 15F3 ADCD ECFB 6239
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users