Dbaccess: display a message in dbaccess
Posted in 2010
The poster asked how to print an "echo"-style message from within DB-Access. Replies gave several workarounds: use the shell escape `!echo whatever` in a script run as `dbaccess dbname scriptname`; or `SELECT 'my message' [AS message] FROM systables WHERE tabid=1;` since there is no native echo command. Art Kagel also suggested running scripts with `dbaccess -e` to echo the statements themselves, and others pointed to SQSL and SQLCMD, which have real echo/error commands. The poster confirmed the `!echo` trick worked.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Stored Procedures & SPL, Server Administration
How do I display messages in dbaccess (similar to the Unix "echo" command) ?
I don't know what to search for. I searched for:
informix dbaccess display messages
informix dbaccess echo messages
....... but no luck
--0016e6d99daa98d229047f4ec327
Dirk Moolman wrote:
> How do I display messages in dbaccess (similar to the Unix "echo" command) ?
>
> I don't know what to search for. I searched for:
>
> informix dbaccess display messages
> informix dbaccess echo messages
>
> ........ but no luck
!echo whatever
If my memory serves. This may only work if you are doing
dbaccess dbname scriptname
--
Cheers,
Obnoxio The Clown
http://obotheclown.blogspot.com
I will now proceed to pleasure myself with this fish.
--
This message has been scanned for viruses and
dangerous content by OpenProtect(http://www.openprotect.com), and is
believed to be clean.
On 11 February 2010 08:19, Obnoxio The Clown <obnoxio@serendipita.com> wrote:
> Dirk Moolman wrote:
>> How do I display messages in dbaccess (similar to the Unix "echo" command) ?
>>
>> I don't know what to search for. I searched for:
>>
>> informix dbaccess display messages
>> informix dbaccess echo messages
>>
>> ........ but no luck
>
> !echo whatever
>
> If my memory serves. This may only work if you are doing
>
> dbaccess dbname scriptname
>
> --
> Cheers,
> Obnoxio The Clown
>
> http://obotheclown.blogspot.com
> I will now proceed to pleasure myself with this fish.
>
> --
> This message has been scanned for viruses and
> dangerous content by OpenProtect(http://www.openprotect.com), and is
> believed to be clean.
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
Dirk
You could try
SELECT " .. output text .... " FROM systables WHERE tabid=1;
I use this frequently, with 'current' as well, to time certain sql
statements and determine the progress of mutiple statements.
Keith
Thanks OB, will try this quickly ......
From:
"Obnoxio The Clown" <obnoxio@serendipita.com>
To:
ids@iiug.org
Date:
2010/02/11 10:20 AM
Subject:
Re: Dbaccess: display a message in dbaccess [19011]
Sent by:
ids-bounces@iiug.org
Dirk Moolman wrote:
> How do I display messages in dbaccess (similar to the Unix "echo"
command) ?
>
> I don't know what to search for. I searched for:
>
> informix dbaccess display messages
> informix dbaccess echo messages
>
> ........ but no luck
!echo whatever
If my memory serves. This may only work if you are doing
dbaccess dbname scriptname
--
Cheers,
Obnoxio The Clown
http://obotheclown.blogspot.com
I will now proceed to pleasure myself with this fish.
--
This message has been scanned for viruses and
dangerous content by OpenProtect(http://www.openprotect.com), and is
believed to be clean.
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
From:
"Obnoxio The Clown" <obnoxio@serendipita.com>
To:
ids@iiug.org
Date:
2010/02/11 10:20 AM
Subject:
Re: Dbaccess: display a message in dbaccess [19011]
Sent by:
ids-bounces@iiug.org
Dirk Moolman wrote:
> How do I display messages in dbaccess (similar to the Unix "echo"
command) ?
>
> I don't know what to search for. I searched for:
>
> informix dbaccess display messages
> informix dbaccess echo messages
>
> ........ but no luck
[Obnoxio]
>!echo whatever
>
>If my memory serves. This may only work if you are doing
>
>dbaccess dbname scriptname
>
>--
>Cheers,
>Obnoxio The Clown
>
>http://obotheclown.blogspot.com
>I will now proceed to pleasure myself with this fish.
>
*******************************************************************************
[Dirk]
Cool, this one is quite neat :-)
Example: (I used !echo, and then selected the first row from systables)
Database selected.
Dropping and creating trigger xXx
tabname msisdn_mtel_new
owner informix
partnum 39845955
tabid 28740
rowsize 42
ncols 3
nindexes 0
nrows 65535
created 18/11/1999
version 1883571140
tabtype T
locklevel R
npused 1525
fextsize 16
nextsize 16
flags 0
site
dbname
type_xid 0
am_id 0
pagesize 2048
1 row(s) retrieved.
Database closed.
Dirk Moolman wrote:
> How do I display messages in dbaccess (similar to the Unix "echo" command) ?
>
> I don't know what to search for. I searched for:
>
> informix dbaccess display messages
> informix dbaccess echo messages
>
> ........ but no luck
>
<BRAG>
try SQSL (see sig) it will do that and a host of other neat things
</BRAG>
--
Ciao,
Marco
______________________________________________________________________________
Marco Greco /UK /IBM Standard disclaimers apply!
Structured Query Scripting Language http://www.4glworks.com/sqsl.htm
4glworks http://www.4glworks.com
Informix on Linux http://www.4glworks.com/ifmxlinux.htm
There's no such command. The best you could do is:
SELECT 'This is my message'
FROM systables
WHERE tabid = 1;
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
See you at the 2010 IIUG Informix Conference
April 25-28, 2010
Overland Park (Kansas City), KS
www.iiug.org/conf
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Thu, Feb 11, 2010 at 3:16 AM, Dirk Moolman <dirk.moolman@gmail.com>wrote:
> How do I display messages in dbaccess (similar to the Unix "echo" command)
> ?
>
> I don't know what to search for. I searched for:
>
> informix dbaccess display messages
> informix dbaccess echo messages
>
> ........ but no luck
>
> --0016e6d99daa98d229047f4ec327
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--0023545309889fa8db047f5344fe
If you just want to see the progress of an SQL script, just execute it with
the '-e' flag.
dbaccess -e mydatabase - <myscript.sql
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
See you at the 2010 IIUG Informix Conference
April 25-28, 2010
Overland Park (Kansas City), KS
www.iiug.org/conf
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Thu, Feb 11, 2010 at 3:55 AM, Dc Dirk Moolman <DIRK@za.ibm.com> wrote:
> From:
> "Obnoxio The Clown" <obnoxio@serendipita.com>
> To:
> ids@iiug.org
> Date:
> 2010/02/11 10:20 AM
> Subject:
> Re: Dbaccess: display a message in dbaccess [19011]
> Sent by:
> ids-bounces@iiug.org
>
> Dirk Moolman wrote:
> > How do I display messages in dbaccess (similar to the Unix "echo"
> command) ?
> >
> > I don't know what to search for. I searched for:
> >
> > informix dbaccess display messages
> > informix dbaccess echo messages
> >
> > ........ but no luck
>
> [Obnoxio]
>
> >!echo whatever
> >
> >If my memory serves. This may only work if you are doing
> >
> >dbaccess dbname scriptname
> >
> >--
> >Cheers,
> >Obnoxio The Clown
> >
> >http://obotheclown.blogspot.com
> >I will now proceed to pleasure myself with this fish.
> >
>
>
>
>
*******************************************************************************
>
> [Dirk]
>
> Cool, this one is quite neat :-)
>
> Example: (I used !echo, and then selected the first row from systables)
>
> Database selected.
>
> Dropping and creating trigger xXx
>
> tabname msisdn_mtel_new
> owner informix
> partnum 39845955
> tabid 28740
> rowsize 42
> ncols 3
> nindexes 0
> nrows 65535
> created 18/11/1999
> version 1883571140
> tabtype T
> locklevel R
> npused 1525
> fextsize 16
> nextsize 16
> flags 0
> site
> dbname
> type_xid 0
> am_id 0
> pagesize 2048
>
> 1 row(s) retrieved.
>
> Database closed.
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--0015174480d07fd0f9047f534cf9
On Thu, Feb 11, 2010 at 01:26, Marco Greco <marco@4glworks.com> wrote:
> Dirk Moolman wrote:
> > How do I display messages in dbaccess (similar to the Unix "echo"
> command) ?
> >
> > I don't know what to search for. I searched for:
> >
> > informix dbaccess display messages
> > informix dbaccess echo messages
> >
> > ........ but no luck
> >
>
> <BRAG>
> try SQSL (see sig) it will do that and a host of other neat things
> </BRAG>
>
And SQLCMD too...
echo
error
Etc. See IIUG Software Archive...
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2008.0513 -- http://dbi.perl.org/
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
NB: Please do not use this email for correspondence.
I don't necessarily read it every week, even.
Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html>
- "May you live every day of your life."
--000e0cd1a882156c98047f9db7f6
Hi,
if you find no better way, you could display a message with the
following SQL command:
select 'this is my message ...' as message from systables where tabid=1;
Not very elegant, but it will show your text. The 'as message' part is
optionally, of cousre - it look a little bit better than (constant) .
Regards,
Andreas
> Von: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] Im Auftrag von
> Jonathan Leffler
> Gesendet: Montag, 15. Februar 2010 07:28
> An: ids@iiug.org
> Betreff: Re: Dbaccess: display a message in dbaccess [19043]
>
> On Thu, Feb 11, 2010 at 01:26, Marco Greco <marco@4glworks.com> wrote:
>
> > Dirk Moolman wrote:
> > > How do I display messages in dbaccess (similar to the Unix "echo"
> > command) ?
> > >
> > > I don't know what to search for. I searched for:
> > >
> > > informix dbaccess display messages
> > > informix dbaccess echo messages
> > >
> > > ........ but no luck
> > >
> >
> > <BRAG>
> > try SQSL (see sig) it will do that and a host of other neat things
> > </BRAG>
> >
>
> And SQLCMD too...
>
> echo
> error
>
> Etc. See IIUG Software Archive...
>
> --
> Jonathan Leffler #include <disclaimer.h>
> Email: jleffler@earthlink.net, jleffler@us.ibm.com
> Guardian of DBD::Informix v2008.0513 -- http://dbi.perl.org/
> "Blessed are we who can laugh at ourselves, for we shall never cease
to be
> amused."
> NB: Please do not use this email for correspondence.
> I don't necessarily read it every week, even.
> Jonathan
> Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html>
> - "May you live every day of your life."
>
> --000e0cd1a882156c98047f9db7f6
>
>
>
************************************************************************
**
> *****
> Forum Note: Use "Reply" to post a response in the discussion forum.
-------------------------------------------
SPAR Osterreichische Warenhandels-AG
Hauptzentrale
A - 5015 Salzburg, Europastrasse 3
FN 34170 a
Tel: +43 662 4470 84923
Fax:
Mobile: +43 664 6259575
E-Mail: Andreas.KUTSCHE@spar.at
Internet: http://www.spar.at
Wichtiger Hinweis: Der Inhalt dieser E-Mail kann vertrauliche und rechtlich
geschutzte Informationen, insbesondere Betriebs- oder Geschaftsgeheimnisse,
enthalten, zu deren Geheimhaltung der Empfanger verpflichtet ist. Die
Informationen in dieser E-Mail sind ausschlie?lich fur den Adressaten
bestimmt. Sollten Sie die E-Mail irrtumlich erhalten haben so ersuchen wir
Sie, die Nachricht von Ihrem System zu loschen und sich mit uns in Verbindung
zu setzen.
Uber das Internet versandte E-Mails konnen leicht manipuliert oder unter
fremdem Namen erstellt werden. Daher schlie?en wir die rechtliche
Verbindlichkeit der in dieser Nachricht enthaltenen Informationen aus. Der
Inhalt der E-Mail ist nur rechtsverbindlich, wenn er von uns schriftlich
bestatigt und gezeichnet wird.
Sollte trotz der von uns verwendeten Virus-Schutzprogramme durch die Zusendung
von E-Mails ein Virus in Ihre Systeme gelangen, haften wir nicht fur evtl.
hieraus entstehende Schaden.
Wir danken fur Ihr Verstandnis.
Important notice: The contents of this e-mail may contain confidential and
legally protected information that is in particular related to operational and
trade secrets, which the recipient is obliged to treat as confidential. The
information in this e-mail is made available exclusively for use by the
addressee. In the event that the e-mail may have been sent to you in error, we
would ask you to kindly delete this communication from your system and to
contact us.
E-mails sent via the Internet can be easily manipulated or sent out under
someone else's name. We therefore do not accept legal liability for the
information contained in this communication. The contents of the e-mail are
only legally binding if they have been confirmed and signed by us in writing.
If, in spite of our using Antivirus protection software, a virus may have
penetrated your system through the sending of this e-mail, we do not accept
liability for any damage that may possibly arise as a result of this.
We trust that you appreciate our position.
-------------------------------------------