Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.


Writing SQL statements directly in IMPROMPTU

Writing SQL statements directly in IMPROMPTU


as a real newbie to IMPROMPTU I am wondering wether one can write SQL statements similar to TOAD or ACCESS?

Thanks for useful help on this;-))



PS.: Is there any good literatur on the market about IMPROMPTU or CognosReport?

RE: Writing SQL statements directly in IMPROMPTU

Generally, no. After writing a basic Impromptu query/report, you can view the SQL generated by Impromptu and even change it. However, once you change the SQL, you can no longer go back to the GUI development environment.

There are no good (maybe none at all) third party literature/books on Cognos. Only what Cognos supplies.

The reasonable man adapts himself to the world. The unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. - George Bernard Shaw

RE: Writing SQL statements directly in IMPROMPTU

Impromptu provides a SQL window here you can directly enter SQL into the window.  You can click the verify button to verify your SQL code before excution.  If it checks out Impromptu will return your query results based on the SQL statements entered.

Mark Stewart
Senior Analyst
Consultants Club Corp.
Windsor, Ontario

RE: Writing SQL statements directly in IMPROMPTU


thanks for the first answers on my question. Now it is a bit more tricky because a colleage wants to transfer an IMPROMPTU query in plain SQL. But there seem to be certain IMPROMPTU specific features that don't find their equivalent in SQL (e.g. xsum).

Can you help on this one as well?

Looking forward to read interesting answers


RE: Writing SQL statements directly in IMPROMPTU

You'll want the 'Magic SQL' display from the Profile tab.
To quote a fellow member of this forum, DoubleD

Hold [CTRL]+[ALT]+[SHIFT] and click Edit. You must hold all three keys or you will not enter "Magic Query" screen.

Now you can see the SQL that is being sent to the DB.

soi la, soi carré

RE: Writing SQL statements directly in IMPROMPTU


Wow!!! I've been developing Cognos for almost 2 yrs now, and I didn't know that!!!  Thanks for the great tip!!!  A star for you!!


RE: Writing SQL statements directly in IMPROMPTU

Thanks DrLex. That was really something.
Question: Can this sql (in Magic Query) be edited and re-edited?

RE: Writing SQL statements directly in IMPROMPTU

How do I take an existing IQD and open this so I can see the SQL and THEN use the "magic" command to see the actual SQL being sent to the DB?

Also - is there a way to find out what generated an IQD file???

RE: Writing SQL statements directly in IMPROMPTU

The IQD can be opened in Notepad or any text editor. It is merely the SQL that will be sent to the DB with a short header that contains connection information. AFAIK, it is the same SQL as that seen in the Magic SQL window of impromptu.

One cannot open the IQD in Impromptu so as to generate the IMR file (or other Cognos file type); for Impromptu-sourced IQDs, the TITLE line in the header will reveal the report source of the file and the DATASOURCETYPE should be the full path to the original source.

soi la, soi carré

RE: Writing SQL statements directly in IMPROMPTU

Thanks!  I found the IMR file.  The only problem remaining is when I am in the profile tab (Report/Querey/ Profile tab), I hit the [CTRL] + [ALT] + [SHIFT] and see no edit key to click.  I am trying to see what the equivilant SQL statement is for Impromtu's XSUM.

What am I missing?

Once again - Thanks

RE: Writing SQL statements directly in IMPROMPTU

Have you clicked on the SQL radio button?

soi la, soi carré

RE: Writing SQL statements directly in IMPROMPTU

Yes, I clicked on the SQL radio button.  I have a COPY button, but no EDIT button.  Possiblyan authority issue of some kind(?).

I saw another thread asking the same question, but never saw a reply.

Thanks for any assistance you can provide.

RE: Writing SQL statements directly in IMPROMPTU

Hmm. Your suggestion sounds likely  - I recall that this is a user permission set by the catalogue administrator. Either check with the administrator or create a new catalogue and try from scratch.
I recall a Cognos KnowledgeBase article that suggested closing Impromptu, renaming the Impromptu.ini file before re-opening (a new .ini file is created)

soi la, soi carré

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close