Meandyou
2645 pts. | Nov 20 2009 3:18PM GMT
Some products for some RDBMSes do allow for this - for example QMF for DB2 on z/OS has this capability (and has had for 20+ years). One codes the SQL with question marks instead of values and upon execution the user is prompted for the value(s).
Steve
CompEng
645 pts. | Nov 20 2009 3:56PM GMT
So what you are saying is to substute ? like this ‘??’ or like this ‘?’ or with out the quotation marks?
Where INMSP300.M3CLS =’ ??’ and INMSP100.MSRDTY = ‘??’ and INMSP100.MSRDTM = ”??’ order by INMSP100.MSMPC
so this should look like>>>
Where INMSP300.M3CLS ="??’ and INMSP100.MSRDTY = ‘09′ and INMSP100.MSRDTM = ‘11′ order by INMSP100.MSMPC
Carlosdl
32715 pts. | Dec 2 2009 4:56PM GMT
Rklanke, could you please tell us more about that “pop up” feature of T-SQL ?
Thanks,
CompEng
645 pts. | Dec 2 2009 6:34PM GMT
I know that this has nothing to do with “CarlosdI” question. I know that it was directed toward “Rkianke”. I just want to clarify what I am trying to do and ask a few more questions. I am using MS Access 2000 and doing the SQL statements in the query sections of a passthrough query of MS Access. Access is pulling some of the information for an AS400 midranges Server and there are some information form other Access tables. I mention this to let you know where all my information is coming form. I know that there are other software called SQL-Server and other types of programming software too. What I am trying to do with access on the SQL side of the query is to be able to prompt a box to come up asking for a qualifier that would normally be typed into the where statesmen. Is there any way to address this or any symbol that would allow this? As for knowing any thing about the T-SQL I don’t but am it possible to explain the difference between the SQL-Server and the T-SQL? In the last three months that I have been learning to work with databases and have the ability to manipulate them with SQL, I know that I have not even touch the surface. What I would like to know is where can all this take me and what are the other possible applications with SQL and databases? So the more I know the better it is. I would appreciate a rather detailed response if possible. If not that is fine too.
Darryn
435 pts. | Dec 3 2009 2:21PM GMT
In MSAccess, you can use prompts enclosed by [] in queries i.e.
where INMSP300.M3CLS = [Enter M3CLS] and INMSP100.MSRDTY = [Enter MSRDTY] and INMSP100.MSRDTM = [Enter MSRDTM]
Darryn
CompEng
645 pts. | Dec 3 2009 3:52PM GMT
Thanks I will try this and let you know how it works. Is there any way you could answere the second part of the question “Where can this take me?”
Randym
1445 pts. | Dec 4 2009 8:54PM GMT
Parameters may not work in pass through queries. Because the query is actually run on the server that you are passing through to. Therefore the SQL statement syntax needs to be that of the server you are running against. An option would be to use VBA to build that sql text. You could either use inputbox to get the parameters or use a form to enter all the parameters.
Carlosdl
32715 pts. | Dec 10 2009 7:09PM GMT
“Where can this take me ?”
If you are planning to work on the software development or database administration areas, SQL is something you will certainly need to know very well.






