Query works in sqldeveloper but not apex
In my APEX application, have a textfield on a page in which user enters a code in the format 111-000-461. The textfield item is called p1_searchmergecode
My query in a report region is this
select * from t3_mail_piece
where :P1_searchmergecode BETWEEN start_merge_code and end_merge_code
I have tried using syntax for all the different session states, but no matter what I do, the query returns 'no data' in the apex application.
If I run this query in sqldeveloper it returns a correct result
select * from t3_mail_piece
where '111-000-461' BETWEEN start_merge_code and end_merge_code;
RESULT
302 Travel_Check American_TAD_Typed_Template 22-APR-13 30-APR-13 555-2424 Scottsdale 1 1350 111-000-461 111-000-465 17 1 One Thousand Three Hundred Fifty and 00/100
ti3r wrote:
In my APEX application, have a textfield on a page in which user enters a code in the format 111-000-461. The textfield item is called p1_searchmergecode
My query in a report region is this
select * from t3_mail_piece
where :P1_searchmergecode BETWEEN start_merge_code and end_merge_codeWhat are the data types of start_merge_code and end_merge_code columns??
It seems you are comparing varchar columns...
See the usage of between condition
Similar Messages
-
Query working from sqldeveloper but not from aspx
Hello,
Well Im working on an application that has different queries that involve characters such as áéíóú // ÁÉÍÓÚ // ñÑ. Now the problem is that the query works just fine coming from sqldeveloper or toad but when it's called from an aspx file it returns no rows. Any idea why this might be? It only happens when the query has at least one of the above mentioned characters.
Here you can see an example:
SELECT DISTINCT N_DOCUMENTO FROM PROCESOS_METODOLOGIAS WHERE "LINEA DE NEGOCIO" = 'PRODUCCIÓN' AND N_DOCUMENTO IS NOT NULL ORDER BY N_DOCUMENTO ASC;I managed to "bypass" it by using LIKE for the time being
SELECT DISTINCT N_DOCUMENTO FROM PROCESOS_METODOLOGIAS WHERE "LINEA DE NEGOCIO" LIKE '%PRODUCCI%' AND N_DOCUMENTO IS NOT NULL ORDER BY N_DOCUMENTO ASC;But I'm sure there's a solution for that. Any hints would be greatly appreciated.
PS: Query from aspx is made with reference 10g to version 11g on server.Just as I finished osting this, I found out that the problem was ust that, working with the 10g reference on the 11g server version. in case anyone needs that...
-
Query works in preview, but not when added under a Query Group
Hello Experts-
I'm trying to use this query as one of the options under the drop down on the Supplier Search under the Supplier Management.
Error message:
while trying to invoke the method com.sap.odp.comp.query.QueryParamValue.getPromptParamDef() of a null
object loaded from local variable 'paramValue' while trying to invoke the method
com.sap.odp.comp.query.QueryParamValue.getPromptParamDef() of a null object
loaded from local variable 'paramValue'
The query itself is complicated, but it works fine when executed under preview.
Wondering if any one has ever seen this behavior and knows of any typical causes?
Thanks,
MikeThanks for the offer, Vignesh.
Sorry, I'm currently having trouble duplicating it, but next time it happens I'll try to get some screenshots.
I have narrowed it down to blank values in optional string fields when the query loads. I fixed (kind of) the ones I was having trouble with by rearranging the filter parameters so there would not be blanks.
Thanks again,
Mike -
Query works in Report but not during Edit session
I have a report based on an SQL query, and it works perfectly from the menu in Development. It's also in Test and Production, and it works there, too. I want to change the template it's on, so I went in through the Navigator to open up and change the report. The Edit session opens up to the query, but I cannot move to any of the other tags, because it says the query is "not valid".
It won't allow me to save the query 'as is', because it supposedly isn't valid. The report isn't locked, and prior versions (I went back to view five of them) have the same trouble. How can the query work off the menu, but not be 'valid'? We installed a patch recently, but even so, why would the query work in one spot and not another?
Anyone have any ideas on what I can do?
Pat MurrayHi,
Please give me the query and the error the error you are getting.
Thanks,
Sharmila -
XPath query works with CLOB but not with object relational
hi all
i have the following queries,the XQuery work with all, but XPath queries work with XMLType CLOB and Binary XML, but they do not work with XMLType as Object relational,
select extract (object_value,'movies/directorfilms/films/film [studios/studio = "Gaumont"]')
from xorm;
select extract (object_value,'movies/directorfilms[director/dirname = "L.Cohen"]/films/film[position()=2]/t')
from xorm;
they shows this message
ORA-00932: inconsistent datatypes: expectd SYSTEM.name683_COLL got CHAR
thanksHi Marco
fisrt here is my RO
BEGIN
DBMS_XMLSCHEMA.registerSchema(
SCHEMAURL=>'http://......../ORMovies.xsd',
SCHEMADOC=>bfilename('DB','Movies.xsd'),
LOCAL =>false,
GENTYPES=>true,
GENTABLES=>FALSE,
CSID=>nls_charset_id('AL32UTF8'));
END;
create table XORM of xmltype
xmltype store as object relational
XMLSCHEMA "http://......../ORMovies.xsd"
ELEMENT "movies";
INSERT INTO XORM
VALUES(XMLType(BFILENAME('DB','ORMovies.xml'),nls_charset_id('AL32UTF8')));
here the XQuery format that work fine with the OR
A/D
select XMLQuery ('for $a in movies/directorfilms/films/film
where $a/studios/studio = "Gaumont"
return $a'
passing object_value
returning CONTENT)"TitleX"
from xorm;
child element query
select XMLQuery ('for $a in movies/directorfilms/director[dirname = "Feyder"]
let $b:=$a/../films/film[position()=2]
return $b/t'
passing object_value
returning CONTENT)"TitleX"
from xorm;
here is the XPath format which doesn't work
select extract (object_value,'movies/directorfilms/films/film [studios/studio = "Gaumont"]')
from xorm;
select extract (object_value,'movies/directorfilms[director/dirname = "Feyder"]/films/film[position()=2]/t')
from xorm;
by the way all queries work fine with the CLOB or Binary XML
many thanx Marco -
SQL query works for Access but not mySQL
*I'm using the Database Connectivity VIs* Can anyone give me a clue as to why the following query works with an MS Access File DSN but not a mySQL File DSN:
SELECT * FROM (SELECT * FROM WP100598 WHERE SerialNum LIKE '311022-05%' OR SerialNum LIKE '311022-07%') WHERE UTCTime > 1090882800 AND UTCTime < 1092870000 ORDER BY SerialNum desc
Thank you, your help is much appreciatedHi,
I don't think MySQL supports nested queries.
Regards,
Wiebe.
"optobionics" wrote in message
news:[email protected]..
> *I'm using the Database Connectivity VIs* Can anyone give me a clue
> as to why the following query works with an MS Access File DSN but not
> a mySQL File DSN:
> SELECT * FROM (SELECT * FROM WP100598 WHERE SerialNum LIKE
> '311022-05%' OR SerialNum LIKE '311022-07%') WHERE UTCTime >
> 1090882800 AND UTCTime < 1092870000 ORDER BY SerialNum desc
> Thank you, your help is much appreciated -
ORA-01891 - Query works in SQL+ but not in JDev
JDev 9.0.4 / DB 8i...
I run a query in SQL+ and it returns results, I run it in JDev Worksheet and I get "ORA-01891: Datetime/Interval internal error".
The query is a select from a view based on a synonym that links to a table in another DB (database link). I have boiled it down to it's "simplest" form for testing and it looks like:
select * from some_table;
I can also run this query in 9.0.5.2 worksheet.Funny you should mention that. The reason I found this error is because one of my VOs wasn't working, so I tried running the query in the worksheet. Didn't work there either but I was getting this different error (posted above). Anways, turns out the viewobject had the wrong attribute listed so I fixed that but the worksheet doesn't work.
I don't think it's the attribute because the worksheet isn't directly connected to the VO so it shouldn't be aware of it. Additionally, only the VOs that are based on the view/synonym/link are affected.
Thanks for the suggestion though! -
Query works in Access but not CF
I wrote this query initially in access to extract the data I
wanted out of my table. In MS Access, the query works fine, returns
the desired data. When I run the query from my CF page, i get the
following error:
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Too few
parameters. Expected 2.
Can anyone tell me why? Below is my queryAs the IIF function is a valid CF function, it may not be
getting passed as 'plain text' to Access, instead CF
may be attempting to compile the function and pass the
result. If you can turn on debugging and for a short time set it to
include the SQL being passed in error messages, you can see what is
really going on.
Another option is to create/save the query in the Access
database and reference that instead of a table in your CFQUERY
call. Since you are just running a staright query and not passing
anything from CF (unless I am mistaken), calling the Access query
for your results would work fine.
<CFQUERY ...>
SELECT * FROM myQueryName
</CFQUERY>
HTH,
CR -
Coldfusion query works in cfm but not cfc
I have the following query that works just fine in cfm file but cannot seem to get to work in a coldfusion cfc. Any ideas.
Select distinct include.value from xxxxx.authorprofile,
table(authorprofile.uidinclude) include where profilename='#selectedProfile#'No Oracle version
No Cold Fusion version
No explanation of what either CFM or CFC means
My recommendation would be that you ask the people that sold you the tool. It is, after all, their product that is the issue. -
Query working in sql but not if forrms!!!!
I transferred my column apprnum from tblrefstaff to paymast using
SQL>update paymast set paymast.apprnum=(select tblrefstaff.apprnum from tblrefstaff where tblrefstaff.empno=paymast.empno and rownum=1);
5072 rows updated
Now i query for the records in paymast
SQL> select empno from paymast where apprnum='338';
EMPNO
2217
SQL> select apprnum from paymast where empno='2217';
APPRNUM
338
Now in forms when i write this under POST-QUERY
begin
select apprnum
into :paymast.apprnum
from paymast
where empno = :paymast.empno;
exception when no_data_found then null;
end;
no data is retrieved in to the item apprum
its only retrieved when the name of table is that of the previous one like this
begin
select apprnum
into :paymast.apprnum
from tblrefstaff
where empno = :paymast.empno;
exception when no_data_found then null;
end;
2nd CASE: after transferring apprnum to paymast all the items are now under paymast so i just removed the code under POST-QERY and the set the datbase item to yes and column name to APPRNUM but still no use
It only fetches records in apprnum using
select apprnum
into :paymast.apprnum
from tblrefstaff
where empno = :paymast.empno;
exception when no_data_found then null;
end;
how should solve this.?
Edited by: Suhail Faraaz on Nov 10, 2009 2:10 AMi think you forgot to commit; after executing update stmt..
It will work in SQL becoz, you wrote the Query immediately after the select stmt.
But Forms is in another session, it cannot access the data until you commit the SQL session.
Regards
Dora
Edited by: Dora on Nov 10, 2009 2:26 PM -
Multi Value PS Query Works in v2, but not v3 or 4
I have been using the query below (and others like it) for a few years, but it didn't work on v3, and now it doesn't work on v4--which is supposed to be backwards compatible.
Get-ADUser test01 –properties memberof, DisplayName, employeeID | Select-Object SamAccountName, DisplayName, employeeID, @{label="Groups";Expression={[string]::join(";", ($_.memberof))}} | export-csv -notype -force c:\filepath\filename.csv
I must invoke PS with the -version 2 suffix to run it. Any ideas?
Thanks!Hi,
Here's the adjustment I'd make:
Get-ADUser testac1 -Properties memberOf, DisplayName, employeeID |
Select-Object SamAccountName, DisplayName, employeeID, @{label="Groups";Expression={ ($_.memberOf | % { Get-ADGroup $_ }).Name -join ';' }} |
Export-Csv -NoTypeInformation -Force c:\filepath\filename.csv
EDIT: Another option:
Get-ADUser testac1 -Properties DisplayName, employeeID |
Select-Object SamAccountName, DisplayName, employeeID, @{N='Groups';E={(Get-ADPrincipalGroupMembership -Identity $_.SamAccountName).Name -join ';'}} |
Export-Csv -NoTypeInformation -Force c:\filepath\filename.csv
http://ss64.com/ps/get-adprincipalgroupmembership.html
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing) -
Query working in access but not in program
Hello all,
This is a problem I've faced many a times, specially with a table with large no of fields.
I write a query in my programm, and it throws invalid argument exception.I copy the query string from the command prompt and paste it in access query and run it in access, it runs just fine.
any insights , as to why this is happening.It did happen to me before but couldnt get around to solving it that time, but this time i hope to reach to some generic solution to the problem.
any hints, suggestion , ideas would be appreciated.Well I've been staring 30 minutes into crystal ball now, but still your code doesn't show up.
Honestly: without your code, there is no way in telling what is going wrong. Where/when is the InvalidArgumentException thrown? Which method call throws that exception. Which argument is it, that you provide? Did you check the stack trace to find out where it happens? ... -
Query working in sql but not in forms
hi this is my query
insert into sa_prod_temp
select sa_idno,sa_srno_desc,count(*) qty from sa_master,
select sa_code,sa_idno,sa_prod_date,sa_srno,sa_srno1 from
select sa_code,sa_idno,sa_prod_date,sa_srno,sa_srno1 from bom_sa_prod
order by sa_prod_date desc
where rownum <=50
) b
where sa_type = :dummy.sa_code and sa_type = sa_code
and sa_master.sa_srno = b.sa_idno
group by sa_idno,sa_srno_desc ;insert into sa_prod_temp
select sa_idno,sa_srno_desc,count(*) qty from sa_master,
select sa_code,sa_idno,sa_prod_date,sa_srno,sa_srno1 from
select sa_code,sa_idno,sa_prod_date,sa_srno,sa_srno1 from bom_sa_prod
order by sa_prod_date desc
where rownum <=50
) b
where sa_type = :dummy.sa_code and sa_type = sa_code
and sa_master.sa_srno = b.sa_idno
group by sa_idno,sa_srno_desc ;
VALUE CLASS IS MISSING
----------------- -
This query works in TOAD but not in forms 6i,
Hi,
It shows error identifier 'ATTRIBUTES' must be declared. what is this error about ?
BEGIN
select distinct B.TEXT into v_lbl
from
SAMS S, TABLE(ATTRIBUTES) A, TABLE(ATTRIBUTES) B, LOCATIONS LS
where
S.ID = :P_ ID and
A.NAME = 'DISL' and
B.NAME='BL'
SL.ID(+) = S.ID and
SL.STAT(+) = 'HIGH' ;
return(v_lbl);
END;
Thanks
Bcjreturning valueswhat values? 1 or more?
when i compile it shows the errorwhat's the error? -
Custom F4 help in a BSP application working in Mozilla but not in IE
Hi,
I have created a custom F4 help in a BSP application.
It is working in Mozilla but not in IE. I tried enabling javascript as well but still it is not working.
Can someone please suggest a possible solution for this?Hi,
See simmilar discussion in thread /thread/1883519 [original link is broken]
I think this may be helpful for you.
Thanks,
Chandra
Maybe you are looking for
-
How do I manage multiple Iphone accounts on one computer
My wife desperaely needed to back up her iPhone (been over teo years). I didn't want to do this given that she woulde lose two years worth of data, but we decided to plow ahead. I hit the update button and was advised that there was an earlier back
-
HT1689 How to use iTunes gift card instead of debit card on file
Our iPad has a debit card used to purchase things but r daughter has iTunes cards to purchase things on her iPod it keeps defaulting to r card. How do we change that
-
I am setting up my new imac and wanted to transfer info from my old imac. My old imac is a G3 with OS 9.1 When I connect the fire wire cables and start the process it tells me my old imac has to have OS X. Is this true? or is there a way around it? i
-
When i create an apple id option none does not appear
when i create an apple id option none does not appear
-
Hello When I try to Export a Task Sequence I recive the following error in the Export Wizard Error: The filename, Directory name, or volume Label Syntax is incorrect Dos someone now this error or is ther a log with more Information? In the Log TaskSe