Click here to Skip to main content
16,016,301 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Query enhancement Pin
Corporal Agarn5-Mar-12 0:32
professionalCorporal Agarn5-Mar-12 0:32 
AnswerRe: SQL Query enhancement Pin
datakeyword8-Apr-12 20:19
datakeyword8-Apr-12 20:19 
QuestionMySql Connection Suddenly Broken Pin
PDTUM28-Feb-12 7:11
PDTUM28-Feb-12 7:11 
AnswerRe: MySql Connection Suddenly Broken Pin
Mycroft Holmes28-Feb-12 12:02
professionalMycroft Holmes28-Feb-12 12:02 
GeneralRe: MySql Connection Suddenly Broken Pin
PDTUM28-Feb-12 12:07
PDTUM28-Feb-12 12:07 
QuestionOracle 11g: Dynamic query exception Pin
USAFHokie8028-Feb-12 7:06
USAFHokie8028-Feb-12 7:06 
AnswerRe: Oracle 11g: Dynamic query exception Pin
Chris Meech28-Feb-12 8:02
Chris Meech28-Feb-12 8:02 
GeneralRe: Oracle 11g: Dynamic query exception Pin
USAFHokie8028-Feb-12 8:37
USAFHokie8028-Feb-12 8:37 
I'm relatively new to oracle... so I'll assume you're right. I modified the proc a bit so it doesn't use the bind variable and instead just concats the string together. Now I get a different exception...
ORA-00909: invalid number of arguments
ORA-06512: at SINC.EQUIPMENT_MGMT_PKG, line 116
ORA-06512: at line 1

where line 116 is again the whitespace line just before opening the cursor. I'm basing this off of this - see section "Sample Multiple-Row Query Using Native Dynamic SQL". Maybe i'm just going about this wrong.. ?

procedure FetchItemTechData_PRC
( c_items out T_CURSOR,
p_Niin IN CHAR,
p_Fsc IN CHAR,
p_Description in VARCHAR2,
p_Idn IN CHAR,
p_Tam IN CHAR,
p_Cos IN CHAR,
p_Scos IN CHAR,
p_Ec IN VARCHAR2,
p_LocalTam in VARCHAR2,
p_Status in Number,
p_PageNum in Number
) AS
v_where varchar2(2000);
BEGIN
if p_Niin is not null then
v_where:= ' itd.niin like ''%' || p_Niin || '%''';
end if;
if p_Fsc is not null then
v_where:= v_where || ' and itd.fsc like ''%' || p_Fsc || '%''';
end if;
if p_Description is not null then
v_where:= v_where || ' and lower(itd.description) like lower(''%' || p_Description || '%'')';
end if;
if p_Idn is not null then
v_where:= v_where || ' and lower(itd.idn) like lower(''%' || p_Idn || '%'')';
end if;
if p_Tam is not null then
v_where:= v_where || ' and lower(itd.tam) like lower(''%' || p_Tam || '%'')';
end if;
if p_Cos is not null then
v_where:= v_where || ' and lower(itd.cos) like lower(' || p_Cos || ')';
end if;
if p_Scos is not null then
v_where:= v_where || ' and lower(itd.scos) like lower(' || p_Scos || ')';
end if;
if p_Ec is not null then
v_where:= v_where || ' and lower(itd.ec) like lower(''%' || p_Ec || '%'')';
end if;
if p_LocalTam is not null then
v_where:= v_where || ' and lower(itd.local_tam) like lower(''%' || p_LocalTam || '%'')';
end if;
if p_PageNum > -1 then
v_where:= v_where || ' and rownum > ' || (p_PageNum * 100);
v_where:= v_where || ' and rownum < ' || ((p_PageNum+1) * 100);
end if;

v_where:= ltrim(v_where, ' and');
v_where:= 'where ' || v_where;

open c_items for
('select
itd.niin,
itd.fsc,
itd.description,
itd.idn,
itd.tam,
itd.cos,
itd.scos,
itd.ec,
itd.local_tam,
itd.local_ind,
itd.serialized_ind,
itd.ui,
itd.unit_price,
itd.status,
itd.created_id,
itd.created_dt,
itd.modified_id,
itd.modified_dt
from item_tech_data itd '
|| v_where);

END FetchItemTechData_PRC;
GeneralRe: Oracle 11g: Dynamic query exception Pin
Chris Meech28-Feb-12 8:59
Chris Meech28-Feb-12 8:59 
GeneralRe: Oracle 11g: Dynamic query exception Pin
USAFHokie8028-Feb-12 9:02
USAFHokie8028-Feb-12 9:02 
AnswerRe: Oracle 11g: Dynamic query exception Pin
jschell28-Feb-12 14:05
jschell28-Feb-12 14:05 
GeneralRe: Oracle 11g: Dynamic query exception Pin
USAFHokie8029-Feb-12 2:57
USAFHokie8029-Feb-12 2:57 
Questiondisallow multiple connections for a login Pin
Danzy8326-Feb-12 13:13
Danzy8326-Feb-12 13:13 
AnswerRe: disallow multiple connections for a login Pin
Mycroft Holmes26-Feb-12 13:36
professionalMycroft Holmes26-Feb-12 13:36 
GeneralRe: disallow multiple connections for a login Pin
Danzy8326-Feb-12 13:51
Danzy8326-Feb-12 13:51 
AnswerRe: disallow multiple connections for a login Pin
PIEBALDconsult26-Feb-12 15:25
mvePIEBALDconsult26-Feb-12 15:25 
AnswerRe: disallow multiple connections for a login Pin
jschell27-Feb-12 8:32
jschell27-Feb-12 8:32 
GeneralRe: disallow multiple connections for a login Pin
Danzy8327-Feb-12 10:40
Danzy8327-Feb-12 10:40 
GeneralRe: disallow multiple connections for a login Pin
Mycroft Holmes27-Feb-12 12:06
professionalMycroft Holmes27-Feb-12 12:06 
GeneralRe: disallow multiple connections for a login Pin
jschell28-Feb-12 13:50
jschell28-Feb-12 13:50 
GeneralRe: disallow multiple connections for a login Pin
Danzy8329-Feb-12 2:18
Danzy8329-Feb-12 2:18 
GeneralRe: disallow multiple connections for a login Pin
jschell29-Feb-12 11:32
jschell29-Feb-12 11:32 
AnswerRe: disallow multiple connections for a login Pin
OChristiaanse29-Feb-12 20:34
OChristiaanse29-Feb-12 20:34 
AnswerRe: disallow multiple connections for a login Pin
foxyland7-Mar-12 17:54
foxyland7-Mar-12 17:54 
Question[Solved]vb.Net front end, Access back end in Multi User App = bad idea? Pin
Richard.Berry10024-Feb-12 17:10
Richard.Berry10024-Feb-12 17:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.