From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: [babel] Is this supported? Date: Thu, 03 Dec 2009 12:22:22 +0100 Message-ID: <87ws141evl.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Eric and Dan, I'm not sure whether what I'm searching for does already exist (or will eve= r) -- that's why I'm asking. I have to create multiple times a new column in a DB. Being LP-minded, I wa= nna describe the code, tangle it, and be able to execute it at the client side. Here my generic code for create a new column: --8<---------------cut here---------------start------------->8--- #+srcname: add-column-in-table.sql(pTable,pColumn,pDatatype,pAcceptnullvalu= es) #+begin_src sql -- add column `pfiDossierSentToSecteur' (if column does not exist y= et) IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME =3D 'pTable' AND COLUMN_NAME =3D 'pColumn) BEGIN ALTER TABLE pTable ADD pColumn pDatatype pAcceptnullvalues END GO #+end_src --8<---------------cut here---------------end--------------->8--- Is there a way to tangle it with some string replacements being made, such = as: | pTable | dossier | | pColumn | pfiNew | | pDatatype | string | | pAcceptnullvalues | NULL | I've tried the following, with no success: --8<---------------cut here---------------start------------->8--- #+srcname: add-column-in-table(pTable=3Ddossier,pColumn=3DpfiNew,pDatatype= =3Dstring,pAcceptnullvalues=3DNULL) #+begin_src sql :tangle dossier.sql -- add column `pfiDossierSentToSecteur' (if column does not exist y= et) IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME =3D 'pTable' AND COLUMN_NAME =3D 'pColumn) BEGIN ALTER TABLE pTable ADD pColumn pDatatype pAcceptnullvalues END GO #+end_src --8<---------------cut here---------------end--------------->8--- Is such a feature supported, or another way to come down to the same result? Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode