Posted: Thu Dec 07, 2006 3:01 pm Post subject: database query question
Newbie
Joined: 07 Dec 2006 Posts: 4 Location: Kansas City MO
I am trying to query an Oracle table with the controlling column defined as varchar2 so I need to have my where variable in quotes. This code
is not working:
SET unit.info[] = select x.ag_id
,x.unid
from Database.def_unit as x
where x.unid = 'hcrew';
But performing the query in sqlplus works. So does it lose the quotes around the variable hcrew in passing and send something like 9011B instead of '9011B' or does it send 'hcrew' as the test value?
Is there anyway to load a variable to the value '
I'm using 6.0 version of the Broker and it appears that setting a variable to this ''' does not work. (SET quot = '''
I was going to try building the SQL in a variable and use PASSTHRU, and that is when I discovered the ''' did not work. _________________ VLBurch
If hcrew is a variable then you need not put single quotes around it. Broker automatically puts single quotes around it. You need to use single quotes only when you are hard-coding the value.
What happens if you do send the query by not providing the single quotes around your variable?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum