emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [babel] Some variables with no default value don't provoke an er


From: Sebastien Vauban
Subject: Re: [O] [babel] Some variables with no default value don't provoke an error
Date: Fri, 16 Sep 2011 11:42:20 +0200
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.3 (windows-nt)

Hi Eric,

Eric Schulte wrote:
> "Sebastien Vauban" <address@hidden> writes:
>> Weirdly enough, in the following code block, I must add a default value for
>> vars `table', `column' and `type' but not for the var `nullability'.
>>
>> I've even been able to add fake vars `something' and `else' with no error
>> being reported (at ingestion time):
>>
>> #+srcname: add-column-in-table(table="", column="", something, type="", 
>> else, nullability)
>> #+begin_src sql
>> -- add column `$column' (if column does not exist yet)
>> IF NOT EXISTS (SELECT *
>>                FROM INFORMATION_SCHEMA.COLUMNS
>>                WHERE TABLE_NAME = '$table'
>>                AND COLUMN_NAME = '$column')
>> BEGIN
>>     ALTER TABLE $table
>>     ADD $column $type $nullability
>> END
>> #+end_src
>>
>> Note that, in the above state, the code block is ingested with no error, but,
>> if I remove the default value of var `table', it then generates back an
>> error...
>
> I've just pushed up a check for these functional-syntax variables which
> will ensure that each is given a default value.  Since this check takes
> place at the location of the code block it /does/ include the name of
> the code block in the error message.

If you have a couple of minutes, can you clarify some points to be sure I can
understand:

- What do you call functional-syntax vars?  The ones in the #+srcname, next to
  the block name, as opposed to the ones declared as :var arguments?

  The fact, then, that we can get a clearer message in case of error, seems to
  me an incentive to use that type of declaration...

- Why was `nullability' not detected to have no default value?  Why were
  `table', `column' and `type' well correctly detected?

Best regards,
  Seb

-- 
Sebastien Vauban




reply via email to

[Prev in Thread] Current Thread [Next in Thread]