Set define?

Moderator: NorbertKrupa

Post Reply
Rick
Newbie
Newbie
Posts: 23
Joined: Thu Jul 26, 2012 2:46 pm

Set define?

Post by Rick » Wed Aug 22, 2012 2:45 pm

Is there an alternative to SET DEFINE OFF in vertica? or have I got the syntax incorrect?
Thanks

User avatar
becky
Intermediate
Intermediate
Posts: 118
Joined: Sat Apr 28, 2012 11:37 am

Re: Set define?

Post by becky » Wed Aug 22, 2012 3:55 pm

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?
THANKS - BECKSTER

Rick
Newbie
Newbie
Posts: 23
Joined: Thu Jul 26, 2012 2:46 pm

Re: Set define?

Post by Rick » Fri Aug 24, 2012 9:23 am

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)

User avatar
becky
Intermediate
Intermediate
Posts: 118
Joined: Sat Apr 28, 2012 11:37 am

Re: Set define?

Post by becky » Fri Aug 24, 2012 1:04 pm

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.
THANKS - BECKSTER

Rick
Newbie
Newbie
Posts: 23
Joined: Thu Jul 26, 2012 2:46 pm

Re: Set define?

Post by Rick » Tue Aug 28, 2012 9:37 am

Ah, okay. Thank you for explaining it to me

Post Reply

Return to “Vertica SQL”