Using/calling a parameter in the SQL Query!
Hi
How do I use or call a parameter from the parameterform in my SQL query in Reports ??
Thanks in advange *S
/Stig :-)
If you have user parameters of P_BEGINDATE and P_ENDDATE, in your query you would reference them by the following:
FROM auditlog
WHERE (eventtimestamp between :P_BEGINDATE and :P_ENDDATE
or :P_BEGINDATE IS NULL)
If you are using the report through Oracle Applications Concurrent Manager make sure the Token (when setting up parameters for the concurrent program)matches the user parameter exactly.
- Rob
Similar Messages
-
Using a Variable to create the SQL Query
I need to create a "dynamic" Update query. I want to store
the meet of the command in a variable and then reference the
variable in in query.
Example:
<cfquery name="fred" datasource="mydb">
update db_table_name set
pbname = 'Fred Flintstone',
pbnumber = '555-555-1234'
pbage = 25
where recnum = 24
</cfquery>
I would like use code this:
<cfset upst = "pbname = 'Fred Flintstone', pbnumber =
'555-555-1234', pbage = 25">
<cfquery name="fred" datasource="mydb">
update db_table_name set
#upst#
where recnum = 24
</cfquery>
When I run this, I get the following error message:
Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error
(missing operator) in query expression ''Fred Flintstone''.
The SQL line is:
update db_table_name set pbname = ''Fred Flintstone'',
pbnumber = ''555-555-1234'', pbage = 25 where recnum = 24
I know its hard to see, but the '' are 2 ' not 1 " . I have
no idea why Coldfusion (or maybe the ODBC driver??) is placing the
2nd ' in the command which causes the errors.
Can anyone shed some light on this topic?
While this is a simple example, my application is far more
complex. I have over 50 fields in the udpate and depending on
changes to the form values, I may need to update all the fields,
some of the fields or NONE of the fields.
I can use <cfif> to test if any fields have changed and
if so, include them in the update command, but if NONE of the
fields have changed, I would have an empty update command and
therefore get an error. I want to avoid having to test for changes
twice (once to determine if I am doing the update and twice to
perform the update).
Thanks,
Mike.cf automatically escapes the single quotes, so you need to
preserve them
<cfquery name="fred" datasource="mydb">
update db_table_name set
#PreserveSingleQuotes(upst)#
where recnum = 24
</cfquery>
Ken -
How to get cm:search to use the max attribute when creating the SQL query?
When we use the max attribute in the cm:search tag, it does not seem to honor the max attribute when creating the SQL query. However, the result returned from the tag is limited to the number specified by the max attribute. Then the tag seems to work as intended, but the performance will be sub optimal when the SQL query returns unnecessary rows to the application.
We use the cm:search tag to list the latest news (ordered by date), and with the current implementation we have to expect a decrease in performance over time as more news is published. But we can’t live with that. We need to do the constraint in the SQL query, not in the application.
The sortBy attribute of cm:search is translated to “order by” in the SQL query, as expected.
Is it possible to get cm:search to generate the SQL query with an addition of “where rownum <= maxRows”?Hi Erik,
The behavior of a repository in regards to the search tag's max results parameter is dependent on the underlying repository's implementation. That said, the OOTB repository in WLP does augment the generated SQL to limit the number of rows returned from the database. This is done in the parsing logic. This behavior may differ with other repository implementations.
-Ryan -
How to display the out put of the sql query in a text file using forms
I want to display the out put of the sql query in a text file using forms 6.0.Same could be done using spool command in sqlplus but i want it using forms....Fiaz
Have a look at the text_io package:
http://www.oracle.com/webapps/online-help/forms/10g/state?navSetId=_&navId=3&vtTopicFile=f1_help/oraini/c_text_io.html&vtTopicId=
cheers -
Hi,
I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work
(fault number -2147217900)
I want to search for a value in a ms access table , if it exist i want to update it, if not i want to insert a new row.
Working with LabView 7.1, database con. toolset.
Who can HELP?
Thanks a lot
MarcoHello,
I think that If exist is not a standar SQL command (I know it exists I think in Oracle and SQL server), MS access doesn't support it, so I think the best way to do it is first make a Select and then either an Update or an insert, sorry...
Paulo -
Write the sql query to find largest value in row wise without using great
write the sql query to find largest value in row wise without using
greatest fuction?Another not so good way, considering you want greatest of 4 fields from a single record:
SQL> ed
Wrote file afiedt.buf
1 with t as (Select 100 col1,200 col2,300 col3,400 col4 from dual
2 union select 500,600,700,800 from dual
3 union select 900,1000,1100,1200 from dual
4 union select 1300,1400,1500,1600 from dual
5 union select 1700,1800,1900,2000 from dual
6 union select 2100,2200,2300,2400 from dual
7 union select 2800,2700,2600,2500 from dual
8 union select 2900,3000,3100,3200 from dual)
9 SELECT (CASE WHEN col1 > col2 THEN col1 ELSE col2 END) Max_value
10 FROM
11 (SELECT (CASE WHEN col1_col2 > col2_col3 THEN col1_col2 ELSE col2_col3 END) col1,
12 (CASE WHEN col2_col3 > col3_col4 THEN col2_col3 ELSE col3_col4 END) col2,
13 (CASE WHEN col3_col4 > col4_col1 THEN col3_col4 ELSE col4_col1 END) col3
14 FROM
15 (SELECT (CASE WHEN col1 > col2 THEN col1 ELSE col2 END) col1_col2,
16 (CASE WHEN col2 > col3 THEN col2 ELSE col3 END) col2_col3,
17 (CASE WHEN col3 > col4 THEN col3 ELSE col4 END) col3_col4,
18 (CASE WHEN col4 > col1 THEN col4 ELSE col1 END) col4_col1
19* FROM t))
SQL> /
MAX_VALUE
400
800
1200
1600
2000
2400
2800
3200
8 rows selected.
SQL> Edited by: AP on Sep 21, 2010 6:29 AM -
How to view the sql query?
hi,
how to view the sql query formed from the xml structure in the receiver jdbc?You can view SAP Note at
http://service.sap.com/notes
But you require SMP login ID for this which you should get from your company. The content of the notes are as follows:
Reason and Prerequisites
You are looking for additional parameter settings. There are two possible reasons why a feature is available via the "additional parameters" table in the "advanced mode" section of the configuration, but not as documented parameter in the configuration UI itself:
Category 1: The parameter has been introduced for a patch or a SP upgrade where no UI upgrade and/or documentation upgrade was possible. In this case, the parameter will be moved to the UI and the documentation as soon as possible. The parameter in the "additional parameters" table will be deprecated after this move, but still be working. The parameter belongs to the supported adapter functionality and can be used in all, also productive, scenarios.
Category 2. The parameter has been introduced for testing purposes, proof-of-concept scenarios, as workaround or as pre-released functionality. In this case, the parameter may or may not be moved to the UI and documentation, and the functionality may be changed, replaced or removed. For this parameter category there is no guaranteed support and usage in productive scenarios is not supported.
When you want to use a parameter documented here, please be aware to which category it belongs!
Solution
The following list shows all available parameters of category 1 or 2. Please note:
Parameter names are always case-sensitive! Parameter values may be case-sensitive, this is documented for each parameter.
Parameter names and values as documented below must be used always without quotaton marks ("), if not explicitly stated otherwise.
The default value of a parameter is always chosen that it does not change the standard functionality
JDBC Receiver Adapter Parameters
1. Parameter name: "logSQLStatement"
Parameter type: boolean
Parameter value: true for any string value, false only for empty string
Parameter value default: false (empty String)
Available with: SP9
Category: 2
Description:
When implementing a scenario with the JDBC receiver adapter, it may be helpful to see which SQL statement is generated by the JDBC adapter from the XI message content for error analysis. Before SP9, this can only be found in the trace of the JDBC adapter if trace level DEBUG is activated. With SP9, the generated SQL statement will be shown in the details page (audit protocol) of the message monitor for each message directly.
This should be used only during the test phase and not in productive scenarios.
Regards,
Prateek -
How to find out which Tables have been accessed without looking at the SQL query ?
Hi,
I would like to know is there a way to find out what queries have been executed and on which tables without looking at the SQL query.
I have an old C++ code which calls some library functions to access the Oracle database. The source code for the library is not available to me yet. The functions selects/updates/deletes and inserts based on some input parameters I give. I do not know which tables it affects. How do I find out the actual SQL query and/or the tables it accesses ? I was told about V$SQL table that
has the most recently executed queries, but
I did'nt see any queries connected to my process.
Could anybody help me on this ?
Thanks
Jagdeep
[email protected]
nullPRECISE/SQL can help you if you have access to it
2nd option can be that turn on SQL_TRACE
Run executable of ur c++ program
it will create a trace file in user_dump_dest
and then using TKPROF u can see all quesries and their plan also.
HTH
Gagan Deep Singh
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by (jagdeeps):
Hi,
I would like to know is there a way to find out what queries have been executed and on which tables without looking at the SQL query.
I have an old C++ code which calls some library functions to access the Oracle database. The source code for the library is not available to me yet. The functions selects/updates/deletes and inserts based on some input parameters I give. I do not know which tables it affects. How do I find out the actual SQL query and/or the tables it accesses ? I was told about V$SQL table that
has the most recently executed queries, but
I did'nt see any queries connected to my process.
Could anybody help me on this ?
Thanks
Jagdeep
[email protected]<HR></BLOCKQUOTE>
null -
The SQL query is not executing
Hi
I have the following situation: In a project we designed our reports calling a stored procedure the exits in a MS SQL Server 200 database. The Stored Procedures works fine and when they are used in the report everything works perfectly.
The reports are being made with CR DEsigner 11, when the designer ends them, ha pass them to me and we put them in our java web application. I open them and even preview them since the Crystal Reprots Perspective of Eclipse and I can see the data, so everything to this point is OK.
The problem comes when I change of connection, I'm trying to connect every report to the same host and database, and when the reprot is displayed in the browser there is no data. I profile the SQL commands that are executed when the report is requested and I found that the reprot is not executing the stored procedure.
I guess because i'm connectring the report to the same database and host that was used when the report is created and i'm also passing exactly the same parameters of the stored procedure, then report thinks that it doesn't have executing again becuase it will be the same information.
SO, i wonder if there is a way to request to the report to execute the sql query every time i have to display it.
thanks for any help.What happens when you try to view the report using a simple viewer.jsp?without changing the connection?
2009-05-25 14:06:09,250 ERROR com.businessobjects.reports.sdk.JRCCommunicationAdapter - detected an exception: Error de conexión: [SQLServer 2000 Driver for JDBC]Error establishing socket.
But the database server is ok, so i think the rpt needs more information to be connect to the database.
Also what happens if you dont use the data bean and give everything there only?
The same, the rpt is not executing the stored procedure.
Did anything change on the RDBMS side? Additional packages, changes to the schema, ownership, etc?
No, the server is ok and the database is ok.
If you configure Log4J logging to DEBUG, you should see the database invokes from the Crystal Java engine, specifically the queries sent and the number of rowsets returned. Do you notice any errors?
I have a problem here with log4j. In my project i'm using spring and with the help of spring i configure log4j, basically with spring is easier to configure log4j.
I'm telling you this because i have log4j working but when my application reaches the code to change the connection to the rerport, log4j dies and stop sending any message to the stdout or to a log file. I haven't since this behavior in any other app o library. So i want to guess i have something wrong with my log4j or maybe with log4j+spring.
So, i remove all the code of spring referring to log4j, but the problem with log4j wasn't solved.
What i will try now is to remove spring from the project.
This is my log4j.properties:
log4j.rootLogger=DEBUG, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n -
Overflow the SQL query string buffer
Hello,
I have a report that is using a query to determine values for a parameter. In Report Builder everything renders fine, but when I publish the report on the Report Server, it will not render if too many values are entered for the parameter, including "Select
All". The reason for this behavior is likely due to the number of possible values for the parameter being over 2500. My research has shown that this is causing an overflow of the SQL query string buffer. The obvious fix is to not use that column as a
parameter, but the power that be are insisting. My system administrator says he can likely increase the buffer size, but has asked me to find out how and where to do that. Any help would be much appreciated.Hi CrazyAlligator,
According to your description, you have more than 2500 values within a parameter. It throws overflow exception when selecting all values. Right?
Microsoft security update MS11-100 limits the maximum number of form keys, files, and JSON members to
1000 in an HTTP request. Because of this change, ASP.NET applications reject requests that have more than
1000 of these elements. HTTP clients that make these kinds of requests will be denied, and an error message will appear in the web browser. The error message will usually have an HTTP 500 status code. This new limit can be configured on a per-application
basis. Please see the "Resolution" section for configuration instructions. Please refer the KB article:
https://support2.microsoft.com/kb/2661403?wa=wsignin1.0
In this scenario, we need add the setting in the web.config file. Please follow the steps below:
Go to the reporting services installation folder.
Go to the report server folder and make a backup of the file “Web.config”. Once you have the backup, open the original file in notepad and add the following entry under the Configuration section:
<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="10000"/>
</appSettings>
Go to the Report Manager folder and again make a backup of the file “Web.config”. Once you have the backup, open the original file in notepad and add the following entry under the appSettings tag:
<add key="aspnet:MaxHttpCollectionKeys" value="10000"/
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String , for executing the Stored Procedure with Current date as the input .
Hi Srinath,
The below blog might be useful
http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/06/executing-stored-procedure-from-sender-adapter-in-sap-pi-71
PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days
regards,
Harish -
Give me the sql query which calculte the table size in oracle 10g ecc 6.0
Hi expert,
Please give me the sql query which calculte the table size in oracle 10g ecc 6.0.
RegardsOrkun Gedik wrote:
select segment_name, sum(bytes)/(1024*1024) from dba_segments where segment_name = '<TABLE_NAME>' group by segment_name;
Hi,
This delivers possibly wrong data in MCOD installations.
Depending on Oracle Version and Patchlevel dba_segments does not always have the correct data,
at any time esp. for indexes right after being rebuild parallel (Even in DB02 because it is using USER_SEGMENTS).
Takes a day to get the data back in line (never found out, who did the correction at night, could be RSCOLL00 ?).
Use above statement with "OWNER = " in WHERE for MCOD or connect as schema owner and use USER_SEGMENTS.
Use with
segment_name LIKE '<TABLE_NAME>%'
if you like to see the related indexes as well.
For partitioned objects, a join from dba_tables / dba_indexes to dba_tab_partitions/dba_ind_partitions to dba_segments
might be needed, esp. for hash partitioned tables, depending on how they have been created ( partition names SYS_xxxx).
Volker -
ADF BC / Why bind variables are mandatory in the sql query
I got this error during view object excecution in the component browser :
(oracle.jbo.SQLStmtException) JBO-27122: Erreur SQL lors de la préparation d'une instruction. Instruction : SELECT * FROM (Select distinct(socialgroup.socialgroup_i) from socialgroup, socialgroupmember, lodgingallocation, lodge
where socialgroup.socialgroup_i = socialgroupmember.socialgroup_i and socialgroupmember.t_socialgrouprole_i = t_rolegroup_ipar.fgetflextypologyclassitem_i(t_rolegroup_ipar.fisbeneficiary) and socialgroupmember.datefrom <= :DateTo and nvl(socialgroupmember.dateto, :DateFrom) >= :DateFrom and socialgroupmember.requester_i = lodgingallocation.requester_i and lodgingallocation.datefrom <= :DateTo and nvl(lodgingAllocation.DateTo, :DateFrom) >= :DateFrom and lodgingallocation.lodge_i = lodge.lodge_i) QRSLT ORDER BY "SOCIALGROUP_I"
----- LEVEL 1: DETAIL 0-----
(java.sql.SQLException) Tentative de définition d'un nom de paramètre qui ne se trouve pas dans le SQL: T_SICategory_I
The bind variables T_SICategory_I is not yet use in the sql query but will be used later so i defined it for the view object.
Is it a reason that the run time check this ? It would be more convenient to set the bind variables early when defining the view object and add them later during the development iteration.Design-time defined named bind variables can be marked as required, or not.
This is decided by the use in the where clause or in view criteria. In my case the bind variable was not used in where clause neither in view criteria and that causes the error.
May be i would be nice to add a check box (a flag) that enable or disable the bind variables for this checking so we will be able to let it defined even we removed some part of the query corresponding to the corresponding restriction or we defined it earlier for a part of the query that is not yet defined.
In my current case i fully defined the bind variables but would refine my query later ... in that cause i would have to remove this bind variable and loose all the definitions to run this view object.
sorry for my english ... -
Modifying the sql query in doDML of entity
I am using Jdev 11.1.1.4.0 and SQLServer Database
I want to modify the sql query in "doDML(int operation, TransactionEvent e)"
I could check what kind of operation like (operation == DML_UPDATE) and do some additional stuff.. But I want to edit the query because of which we entered doDML..
I want to edit the query because when i use SQLServer database with SQLBuilder as SQL92, the update statement will have table alias like "update table <table alias>" which the SQLServer is not recognizing.. So I want to remove that alias from sql query in doDML..It isn't possible.
However as per the following MSDN page a table alias is fine in an UPDATE statement so are you sure this is your problem?: http://msdn.microsoft.com/en-us/library/aa260662(v=sql.80).aspx
CM. -
Can anybody provide the SQL query to find the files uploaded in a particular folder?
Hi All,
Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
Any help is greatly appreciated.
With best regards,
NevinNevin,
Be great if we could know the version of Portal. For Rel. 1, here's the query
select id,masterthingid from wwv_things
where siteid = &site
and cornerid = &corner
&site - Content Area id
&corner - Folder id
if you don't know the folder id, use
select id from wwv_corners where siteid = &site
and name = &folder
Hope this helps. I have run into this situation before. Usually, the culprits were
one of the following:
1. Junk Characters in description of item (caused due to Copy-Paste)
2. Special Characters in the File name
Hi All,
Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
Any help is greatly appreciated.
With best regards,
Nevin
Maybe you are looking for
-
Hi gurus, I encoutered the error "No stock posting possible for this material" while posting goods receipt with transaction code mb1c. please help immediatly as it is urgent. Tanx. Maureen.
-
About 45 minutes ago my iphone 5S just shut off on its own. I have tried charging it only to have the white screen with the black apple showing. How can this be repaired?
-
Problems with pdf files on OSX10.9
since updating I cannot save files in pdf format to desktop cloud or evernote also cannot save scans from HP 4700 irritating and apparently no fix any help out there?
-
Why do I need the money on my card for the album I had pre- ordered? Without it, now I cannot download the album I ALREADYpurchased
-
Do i seriously need to re-sync my iPod for iTunes 11.0.1??
So, I have nearly 80GB worth of music on my ipod. I recently downloaded this new version of itunes in order to update my ipad. Now, I can no longer retreive anything I've download from itunes and, apparently I have to re-sync my ipod, lose all my m