Access 2013 vba ability to grab a parameterized queries current SQL - sql

Is there a way to get the SQL of the current query if that query has parameters? EX. say SELECT * FROM Orchard WHERE AppleCount=[how many apples]; and the user wrote in 5. I would want to get SELECT * FROM Orchard WHERE AppleCount=5; My current method is to ask the user with input boxes for the parameter but I may be told thats not acceptable, don't ask why.

The proper way to do it is to use your own traps for input - either input boxes or a form, then take those results and pass them to a querydef object via parameters (yourquerydef.parameters("param name") = <user input>
You get the parameters from the user, and pass them to the query yourself - no more popups will be presented to user

Related

How to make a Splunk Dashboard dynamic?

I have a query lets call it query1 that looks at sales and I have storenumber=1 in that query I have query2 that looks at returns with storenumber=1 in the second query
I want to add these queries to my store's dashboard. Now in the dashboard, I want to have a box (text, dropdown, anything) where I can enter a new store number and run both those queries.
If I enter say 2 in that box how does that 2 get replaced in the queries where store number =1 to be storenumber=2 now?
I thought it would be some token like variable? but I'm not sure how to get that to work so that the number entered is populated where the storenumber= is in the queries?
Any help will be appreciated
Thank You
It is a token-like variable. When you create your input (dropdown, text, etc.) is it given a name. The value of that input is referenced simply by putting the token name within $s.
... | where storenumber = $store$ | ...

Typo3 9.5 Powermail - How can I insert dynamic input fields in frontend, using javascript or/and ajax

I`m using Typo3 9.5 with powermail. I want to generate dynamic input fields, based to a selectfield. For example: "How many members you want to register?" Then you get a selectbox, where you can choose from 1 to 10. If you select 10, 9 further new input fields should appear.
How can I solve this? If I do it only with jquery, the input fields arent registered and dont get send to the recepient.
Is there a way to integrate dynamic input fields?
This should not be possible because it is a security risk. Everbody could inject code in this case an send them to TYPO3 / DB. But there is a extension "Powermail Condition" which can help you solving your problem:
https://extensions.typo3.org/extension/powermail_cond/
If it is a select box with a max amount of dynamic fields: Why not inserting all of them and change the view via javascript according to the selected value? If you want a dynamic Validation, you have to write that too, like: https://docs.typo3.org/typo3cms/extensions/powermail/ForDevelopers/WriteOwnValidators/ServersideValidation/Index.html

sql oracle search by multiple terms in business object report

I am writing a report where i would like the end user to be able to search by multiple terms (ie. UK, CZ)
but my code it does not fetch any results
like #variable('2. COUNTRY (UK, CZ, AT or use % for all)')
It works when just using just one term (ie. UK) but not when the user tries to search for more than one value.
I have tried using different statements before the variable but still get no results.
Is a search like this possible?
I'm writing this for Business Objects 5
Thanks
Matt
You're trying to perform a wildcard search (by using the LIKE keyword) in combination with a prompt (I take it it's a multi-value prompt).
Lets go through a few possible scenarios:
Wildcard
Example: the user enters % in the prompt.
SQL translation: Country LIKE '%'
Result: the query returns all records due to the wildcard
Single-value
Example: the user enters UK in the prompt.
SQL translation: Country LIKE 'UK'
Result: the query returns all records with the Country column matching the value UK
Multiple values
Example: the user selects UK and AT in the prompt.
SQL translation: Country LIKE 'UK,AT'
Result: the query returns no records because there is no record that contains the value UK,AT (literally) for the Country column.
What you're trying to do, as far as I can determine, is to allow the user to select multiple values or skip the selection altogether and return all values (for which you used the combination of the LIKE keyword and % wildcard).
However, with multiple values, you need to use the IN keyword instead. In current versions of BusinessObjects (you're using a very old version), it's possible to make prompts optional.
As you don't have this feature, the only alternative is to create a universe condition in which you build a CASE around your #prompt function, to determine if the user entered a % or selected multiple values and then construct your WHERE clause accordingly.
Have a look at this article for an example how to build such a condition.

Set value dynamic action not working in apex

I have a problem creating sql dynamic action in oracle apex v4.2. I have two fields, Department number and department name. Department number is a text field with autocomplete. The department name is a display field. On changing the department number, the department name should be displayed by an sql query.
I created a set value dynamic action on department number, giving the correct values in page item to submit and the correct sql query referencing P3_DEPARTMENT_NO.
When i run the page, after select a department number, the department name is not coming up automatically.
Could you please suggest on what i might be missing.
Thanks in advance.
You can try use this way:
First step: In the Shared Components -> Application Processes: create a process myProcess an put your sql dynamic in.
Second step: Create a javascript function myFunction to call the process myProcess.
Third step: Use onChange event to call your javascript function myFunction.
Also you can find a lot of exemples on Denes Kubicek app: https://apex.oracle.com/pls/otn/f?p=31517:101:116042570427567.
Best regards,
iulian
The exact behaviour of autocomplete lists is probably browser dependent, but generally speaking, don't rely on the "Change" event, as it won't necessarily fire when you select from the list.
You'll need to experiment to get the behaviour you want in your particular situation, but as a starting point you might want to try replacing the "Change" event type on your dynamic action with "Lose focus". That way the dynamic action should always be triggered when you tab or click away from P3_DEPARTMENT_NO.
In similar situations in the past, I've used "Key release" instead of "Lose focus", and I've created a second dynamic action which does the same thing, but triggered by "Get focus". That combination ensures that the display field stays synchronised with the user's selection, whether a value is keyed in or selected from the autocomplete list. Whether or not you go this route depends on how happy you are about the database being hit with your department name query every time a user interacts with P3_DEPARTMENT_NO in any way.

Rails 3 Saving User Searches DataModel

I am working on a piece of my app where the client is wanting the ability for user searches to be saved (these searches are completed by the user completing a set of dropdowns and then entering in a value in an input field).
I was curious to know if the use for an HSTORE could be beneficial here or should I just simply save out each piece of the search?
For Example (from a UI perspective):
User Selects a category, the next select is populated with stats tied to the selected category, the next select drop down is displayed which allows the user to select a predicate (greater than, less than, equal to, not equal to, etc) and then the input field is shown where the user can enter in their value they are searching for. If the user would like to add another search filter, they can click a button and then the user follows the same pattern as the first
The server side params look like this:
Parameters: {"utf8"=>"✓","authenticity_token"=>"FCvOdXuxtEhEchwDn8U2yaEPShfHW2VosgSoR8eSzV8=", "refresh"=>"1", "search"=>{"0"=>{"category"=>"1", "stat_type_id"=>"5", "predicate"=>"Greater Than", "q"=>"200", "type"=>"stat"}}, "unselected"=>""}
These searches won't really be updated, when a user enters in a new search, it will be saved explicitly.
Once we figure out the best route for this project, I will post the code as the answer