Page 1 of 1

Set define?

Posted: Wed Aug 22, 2012 2:45 pm
by Rick
Is there an alternative to SET DEFINE OFF in vertica? or have I got the syntax incorrect?
Thanks

Re: Set define?

Posted: Wed Aug 22, 2012 3:55 pm
by becky
Hi Rick,

Are you talking about the Oracle SET DEFINE OFF command? If so, why would you need this in Vertica? Can we have substitution variables in our scripts for Vertica?

Re: Set define?

Posted: Fri Aug 24, 2012 9:23 am
by Rick
Yeah, not sure it's just someone sent me an SQL script to load some data into our database and it had some set define off commands in it. I just omitted them, but I was curious as to their purpose and the alternative in vertica. (I don't actually know what it does)

Re: Set define?

Posted: Fri Aug 24, 2012 1:04 pm
by becky
Hi Rick,

In Oracle we use the SET DEFINE OFF command to turn off substitution variables. That is, in a script we can have a variables (defined like &variable_name). When executing the script, if a substitution variable is encountered, Oracle will stop execution of script to ask for a value for the variable. If you are inserting data that has ampersands in it Oracle will think it is a variable when it really isn't. So we use SET DEFINE OFF prior to statements that have data like that so it can be properly inserted.

I don't think this is needed in Vertica because from what I know about vsql it does not not have the ability to prompt for values for variables.

Re: Set define?

Posted: Tue Aug 28, 2012 9:37 am
by Rick
Ah, okay. Thank you for explaining it to me