Create a outer Join for a @SecondaryTable in EJB 3.0
Hello
I need to create a outer Join for a @SecondaryTable in EJB 3.0, any can help me?
Thanks in Advance…
Yes, I have this relations in the entity:
@Table(name = "RF_HTRANSACTION")
@SecondaryTables({
@SecondaryTable(name="RF_CLIENTS",
pkJoinColumns={@PrimaryKeyJoinColumn(name="NUMERO_CLIENTE", referencedColumnName="NUMERO_CLIENTE")}
@SecondaryTable(name="RF_SUPPLIER",
pkJoinColumns={@PrimaryKeyJoinColumn(name="NUMERO_PROVEEDOR", referencedColumnName="NUMERO_PROVEEDOR")}
@SecondaryTable(name="RFSUPPLIER_PROY",
pkJoinColumns={@PrimaryKeyJoinColumn(name="NUMERO_PROYECTO", referencedColumnName="NUMERO_PROYECTO")}
@SecondaryTable(name="RF_REFAGENTS",
pkJoinColumns={@PrimaryKeyJoinColumn(name="NUMERO_RA", referencedColumnName="NUMERO_RA")}
I need to create a outer join between RF_HTRANSACTION and RF_REFAGENTS.
Similar Messages
-
Outer join for a database view
Dear Experts,
Could you tell me what is the outer join and the example of this?
Is it possible I can create an outer join view for generic extraction?
Thanks.
ArthurThis is what a nested loops would look like in ABAP. It is not a function module, but it could be made into one very easily.
REPORT zz_temp.
DATA: l_t_tstc TYPE TABLE OF tstc,
l_t_tstct TYPE TABLE OF tstct,
l_s_tstc TYPE tstc,
l_s_tstct TYPE tstct.
SELECT *
INTO CORRESPONDING FIELDS OF l_s_tstc
FROM tstc AS t.
SELECT tt~ttext
INTO CORRESPONDING FIELDS OF l_s_tstct
FROM tstct AS tt
WHERE tt~tcode = l_s_tstc-tcode
AND tt~sprsl = sy-langu.
ENDSELECT.
WRITE:/ l_s_tstc-tcode,l_s_tstct-ttext.
ENDSELECT. -
Alternative for OUTER Join for use in fast refresh materialized view
Hi ,
I have two tables as :
CREATE TABLE TEST_SANDY1
COL1 NUMBER
CREATE TABLE TEST_SANDY2
COL1 NUMBER,
COL2 VARCHAR2(10 BYTE)
Data for the tables are :
INSERT INTO TEST_SANDY1 ( COL1 ) VALUES (
1);
INSERT INTO TEST_SANDY1 ( COL1 ) VALUES (
2);
INSERT INTO TEST_SANDY1 ( COL1 ) VALUES (
3);
COMMIT;
INSERT INTO TEST_SANDY2 ( COL1, COL2 ) VALUES (
1, 'a');
INSERT INTO TEST_SANDY2 ( COL1, COL2 ) VALUES (
2, 'b');
INSERT INTO TEST_SANDY2 ( COL1, COL2 ) VALUES (
4, 'd');
COMMIT;
Now when I run the following select statement :
select
b.col1
from
test_sandy1 a,
test_sandy2 b
where
b.COL1 = a.COL1(+)
I get :
COL1
1
2
4
I want to build a materialized view to generate the same values but it has to be fast refresh. But since I am using outer join I am unable to create a fast refresh one.
Can someone suggest an alternate select to create fast refresh materialized view.
Thanks,
SandipanThe select statement was not fitting my problem , so I'll change it as :
select
a.col1, nvl(b.col2, 'DEFAULT')
from
test_sandy1 a,
test_sandy2 b
where
b.COL1(+) = a.COL1
I get :
COL1 VAL
1 a
2 b
3 DEFAULT
How do I this ? -
Creating fly-out menus for website in InDesign CS5
Hi all, I've just upgraded to CS5, and am looking into the new release of InDesign CS5. In the past, I had created websites in MS Publisher, and then exported the publication as website as html. I then uploaded the resulting HTML to my website using Cute FTP.
I dabbled around with Adobe Contribute, and still found it rather restrictive, as I could not create coloured text boxes, text frames, roll-over buttons and etc.
Hoping that I'll have better luck with InDesign CS5. I'm intending to create my website from scratch, and when finished, hope I can export the publication in InDesign as HTML.
Just wondering if there is a feature in InDesign CS5 that can create drop down or fly-out menus for a website?
ThanksIt might be easier to invest in something like Quite Imposing, an impostion plugin for Acrobat. It's far less expensive than a full-blown professional imposition program and if you need to impose a lot of PDFs, it will pay for itself quickly.
-
How to find Inner join or (Left)outer join for Infoset
Dear Experts,
We have one Infoset which is based on the Master data and DSO. It is linked 0BPARTNER field From the Master Data and SOLD TO PARTY field from the DSO.
Here Could you please suggest me how can we able to find that whether this Infoset is based on Inner Join or (Left) outer join.
Thanks and Regards,
Suresh.HI Suresh,
If the infoset is based on left outer join , you see the respective table shaded in a dirrerent colour and also displays
that it is a left outer join in the connection
refer the below link for the details on left outer join , you can make a join as left outer from the context menu of the
object required
http://help.sap.com/erp2005_ehp_04/helpdata/EN/21/af0942b9dc9c39e10000000a155106/frameset.htm
Regards,
Sathya -
Handling Outer Join for hard coded values in the Logical Table Source
Has anyone tried to apply an outer join in the Logical Table Source Content Tab?
I have to add this APPLSYS.FND_LOOKUP_VALUES.LANGUAGE (+)= 'US' but the outer join is not allowed. I get this message.... [nQSError: 27002] Near <(>: Syntax error [nQSError: 26012] .
Could you tell me please how this should be handled? I have a lot of this cases in my project and without this being set-up affects the expected output of my report.
Thank you in advance.hi Ap,
Pull only Dim_W_LOV_D_Acty_Src column into answers and check whether u r able to see CUST_SRC_ACT or not .Of course, you need to check sql query too
Thanks,
Saichand.v -
Outer Join for 2 Tables?
Hi,
i have 3 Tables, one is the "main" table.
Table1
Col1
Col2
Col3
Table2
Col2
Col4
Col5
Table3
Col4
Col6
Now i want all hits from Table 1, all outer join hits from table 2 and the regarding rows from table 3.
The join from Table1 to Table2 is no problem, but how to add table3?
SELECT *
FROM table1 AS t1
LEFT OUTER JOIN table2 AS t2
ON t2col2 = t1col2
INTO CORRESPONDING FIELDS OF TABLE result
WHERE t1~col1 IN so_col1.Hi,
a right table in an outer join cannot become a part of an inner join or an outer join. So you will have to use some other technique.
meaing table1 connects to table2 with an outer join resulting in all rows table1 and cooresponding if existing from table2, now table2 is the right table it cannot make a join with table3. inner or outer.
regards,
Khusro Habib -
Outer join query for SQL server from Oracle
Hi All,
My question is regarding making queries from Oracle to SQL Server database thorugh DBLink.
In my oracle database I have a DBLink emp.world for SQL Server database.
I need to query SQL Server data from oracle (so that this query can be combined with other oracle tables).
Query is given below:
SELECT
a."EmpID" as "Employee ID",
a."EmpStatus" "Employee Status"
b."EmpSub" as "Employee Subjects"
FROM
[email protected] a
left outer join [email protected] b on a."EmpID" = b."suEmpID"
ORDER BY a."EmpID";My problem is when I run the same query from oracle, it does not show the EmpID that does not exist in Subjects table, but when run from actual SQL Server database, it shows all the records.
Samples are given below:
Run from Oracle
Employee ID Employee Status Employee Subjects
101 Active Maths
102 Active Maths
102 Active Physics
104 Inactive Chemistry
Run form SQL Server
Employee ID Employee Status Employee Subjects
101 Active Maths
102 Active Maths
102 Active Physics
103 Active NULL
104 Inactive ChemistryI am not sure why in oracle outer join for SQL server tables is not working. What is the right way for outer join in this case.
I am using oracle database 10gR2 and SQL Server 2005.
Please Help.
Thanks.SELECT
a."EmpID" as "Employee ID",
a."EmpStatus" "Employee Status"
b."EmpSub" as "Employee Subjects"
FROM
[email protected] a
left outer join [email protected] b on a."EmpID" = b."suEmpID"
ORDER BY a."EmpID";
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm#sthref3175
From your description, it appears you may need a right outer join. You want to get back all the rows from 'B', not from 'A'. Try a right join and let us know. -
BI Infoset left outer join (NW04s)
I created an Infoset using a left outer join for infoproviders:
- 0FIGL_O10 (GL transaction figures - DSO )
- 0CCA_C03 (CCA Statistical key figures - CUBE)
DSO 0FIGL_O10 is the left table with joins on:
- 0COSTCENTER
- 0FISCPER
The data set returned by Infoset appears to be based on a SQL using an
inner join.
This appears to be a bug.
We are on BI 700 SP 15.Hi Raynald - I did a demo with few records and it works fine for me. We are on 7, SP14.
-
How to create a F4 help for a report selection screen field
hi,
can any one guide me to create F4 help for a field in a selection screen in a report program,plz give me a sample codehi,
Here are the following ways
1.with the help of match code objects we can create the F4 Functionality for Field.
Syntax is :
PARAMETERS: p_org LIKE t527x-orgeh MATCHCODE OBJECT zorg.
2. One more thing is we can do it with Search Help's also.
3. Even we can do it HELP Views also.
Help Views:
You have to create a help view if a view with outer join is needed as selection method of a search help
The selection method of a search help is either a table or a view. If you have to select data from several tables for the search help, you should generally use a database view as selection method. However, a database view always implements an inner join. If you need a view with outer join for the data selection, you have to use a help view as selection method.
All the tables included in a help view must be linked with foreign keys. Only foreign keys that have certain attributes can be used here. The first table to be inserted in the help view is called the primary table of the help view. The tables added to this primary table with foreign keys are called secondary tables.
The functionality of a help view has changed significantly between Release 3.0 and Release 4.0. In Release 3.0, a help view was automatically displayed for the input help (F4 help) for all the fields that were checked against the primary table of the help view. This is no longer the case in Release 4.0.
As of Release 4.0, you must explicitly create a search help that must be linked with the fields for which it is offered (see Linking Search Helps with Screen Fields ).
Existing help views are automatically migrated to search helps when you upgrade to a release higher than 4.0.
A help view implements an outer join, i.e. all the contents of the primary table of the help view are always displayed. You therefore should not formulate a selection condition for fields in one of the secondary tables of the help view. If records of these secondary tables cannot be read as a result of this selection condition, the contents of the corresponding fields of the secondary table are displayed with initial value.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 15, 2008 3:15 PM -
Outer join with Filter condition
Hi there,
I need some help with Data Services. I am creating an outer join between two tables and one of them has filter condition but it creates and outerjoin and apply the filter condition to the whole result set.
SELECT "IWFMR13T_VEH_NTK_TMP1"."ACTY_DT" , "IWFMR13T_VEH_NTK_TMP1"."VEH_CL" , "IWFMR13T_VEH_NTK_TMP1"."VEH_NO" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_NO" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_STRT_DT" , "IWFMR13T_VEH_NTK_TMP1"."FR_SRVC_SEQ_NO" , "IWFMR13T_VEH_NTK_TMP1"."TO_SRVC_SEQ_NO" , "IWFMR13T_VEH_NTK_TMP1"."FR_ACTY_TS" , "IWFMR13T_VEH_NTK_TMP1"."TO_ACTY_TS" , "IWFMR13T_VEH_NTK_TMP1"."MINS_ON_TRN" , "IWFMR13T_VEH_NTK_TMP1"."VEH_STA_CD" , "IWFMR13T_VEH_NTK_TMP1"."MAJ_VEH_CD" , "IWFMR13T_VEH_NTK_TMP1"."VEH_DIST_KM" , "IWFMR13T_VEH_NTK_TMP1"."VEH_NET_TN" , "IWFMR13T_VEH_NTK_TMP1"."VEH_GROS_TN" , "IWFMR13T_VEH_NTK_TMP1"."VEH_NTK" , "IWFMR13T_VEH_NTK_TMP1"."VEH_GTK" , "IWFMR13T_VEH_NTK_TMP1"."HLNG_LOCO_MPU" , "IWFMR13T_VEH_NTK_TMP1"."09_HLNG_LOCO_FL" , "IWFMR13T_VEH_NTK_TMP1"."LOCO_MPU" , "IWFMR11T_SGMT_LCNT"."SUM_LOCO_MPU" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_BUS_GRP_CD" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_COAL_MRKR_CD"
FROM "DBO"."IWFMR13T_VEH_NTK_TMP1" "IWFMR13T_VEH_NTK_TMP1"
LEFT OUTER JOIN "DBO"."IWFMR11T_SGMT_LCNT" "IWFMR11T_SGMT_LCNT"
ON ( "IWFMR11T_SGMT_LCNT"."SRVC_NO" = "IWFMR13T_VEH_NTK_TMP1"."SRVC_NO" ) AND( "IWFMR11T_SGMT_LCNT"."SRVC_STRT_DT" = "IWFMR13T_VEH_NTK_TMP1"."SRVC_STRT_DT" ) AND( "IWFMR11T_SGMT_LCNT"."FR_SRVC_SEQ_NO" = "IWFMR13T_VEH_NTK_TMP1"."FR_SRVC_SEQ_NO" ) AND( "IWFMR11T_SGMT_LCNT"."TO_SRVC_SEQ_NO" = "IWFMR13T_VEH_NTK_TMP1"."TO_SRVC_SEQ_NO" )
WHERE ( "IWFMR13T_VEH_NTK_TMP1"."09_HLNG_LOCO_FL" = 'Y')
While, what I need is as under
SELECT "IWFMR13T_VEH_NTK_TMP1"."ACTY_DT" , "IWFMR13T_VEH_NTK_TMP1"."VEH_CL" , "IWFMR13T_VEH_NTK_TMP1"."VEH_NO" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_NO" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_STRT_DT" , "IWFMR13T_VEH_NTK_TMP1"."FR_SRVC_SEQ_NO" , "IWFMR13T_VEH_NTK_TMP1"."TO_SRVC_SEQ_NO" , "IWFMR13T_VEH_NTK_TMP1"."FR_ACTY_TS" , "IWFMR13T_VEH_NTK_TMP1"."TO_ACTY_TS" , "IWFMR13T_VEH_NTK_TMP1"."MINS_ON_TRN" , "IWFMR13T_VEH_NTK_TMP1"."VEH_STA_CD" , "IWFMR13T_VEH_NTK_TMP1"."MAJ_VEH_CD" , "IWFMR13T_VEH_NTK_TMP1"."VEH_DIST_KM" , "IWFMR13T_VEH_NTK_TMP1"."VEH_NET_TN" , "IWFMR13T_VEH_NTK_TMP1"."VEH_GROS_TN" , "IWFMR13T_VEH_NTK_TMP1"."VEH_NTK" , "IWFMR13T_VEH_NTK_TMP1"."VEH_GTK" , "IWFMR13T_VEH_NTK_TMP1"."HLNG_LOCO_MPU" , "IWFMR13T_VEH_NTK_TMP1"."09_HLNG_LOCO_FL" , "IWFMR13T_VEH_NTK_TMP1"."LOCO_MPU" , "IWFMR11T_SGMT_LCNT"."SUM_LOCO_MPU" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_BUS_GRP_CD" , "IWFMR13T_VEH_NTK_TMP1"."SRVC_COAL_MRKR_CD"
FROM "DBO"."IWFMR13T_VEH_NTK_TMP1" "IWFMR13T_VEH_NTK_TMP1"
LEFT OUTER JOIN "DBO"."IWFMR11T_SGMT_LCNT" "IWFMR11T_SGMT_LCNT"
ON ( "IWFMR11T_SGMT_LCNT"."SRVC_NO" = "IWFMR13T_VEH_NTK_TMP1"."SRVC_NO" ) AND( "IWFMR11T_SGMT_LCNT"."SRVC_STRT_DT" = "IWFMR13T_VEH_NTK_TMP1"."SRVC_STRT_DT" ) AND( "IWFMR11T_SGMT_LCNT"."FR_SRVC_SEQ_NO" = "IWFMR13T_VEH_NTK_TMP1"."FR_SRVC_SEQ_NO" ) AND( "IWFMR11T_SGMT_LCNT"."TO_SRVC_SEQ_NO" = "IWFMR13T_VEH_NTK_TMP1"."TO_SRVC_SEQ_NO" ) AND ( "IWFMR13T_VEH_NTK_TMP1"."09_HLNG_LOCO_FL" = 'Y')
Please let me know, how to fix this issue. If you have come across such issue before. If need be I can send you the ATL file for this data flow.
BTW, I am using Data Services XI 3.2 (12.2.0.0) and the database is SQL 2005, both on Windows Platform.
Thanks & regards,
Doshi BhaveshHi,
Use two query transforms;
First will only connect to IWFMR13T_VEH_NTK_TMP1 and use it to apply filter "IWFMR13T_VEH_NTK_TMP1"."09_HLNG_LOCO_FL" = 'Y'
In second query transform perform outer join on IWFMR11T_SGMT_LCNT and output of first query.
This should give required result.
If you are using single query transform join will be performed at DB level and if you use custom sql in query transform it will not have increased load on DB. I will recommend to use custom sql to get good performance.
Sachin -
Conditions on Outer Joined Tables
I'm trying to understand how Discoverer handles conditions created on outer joined tables. We're using Discoverer Plus 11.1.1.3.
I have a query using two tables connected by an outer join. While I want all records back from the first table, I don't want all records back from the outer joined table. So, if I typed the SQL directly in a SQL Editor, I would put the '(+)' in each condition. However, I find that in Discoverer, sometimes it does this, and sometimes it doesn't. If it does not put the '(+)' on all conditions as well as the join, that essentially nullifies the outer join and makes it an standard join.
For example, I expanded an item on the outer joined table in the Items dialog to see its list of values, and selected one, to add the column to the worksheet and create a condition. No (+). But when I deleted this and created the condition using the Condition dialog, I got a (+). Then I created another condition using the condition dialog. I used the IN operator and pasted in a list (this item had no item class to choose from)--no (+).
When I tried manually adding (+) after the item name in the condition dialog, it put quotes around the whole thing and treated it as a string.
I can find nothing in the documentation that discusses this. Is is possible to control whether or not it uses the (+)?
Thank you, Scott NewmanDear Michael,
Last night I had a call from user who was experiencing a very strange behaviour of her Discoverer workbook.
I replicated the issue on my machine and could not believe my eyes. A condition on an item was being ignored. I then analysed the workbook and realised it was due to a condition on an item from an outer-joined folder. I did not have the strength after a long day to deal with it and was looking forward to having some fun the next day. Firstly, I tried few tricks such as NVL, LENGTH functions in a test query in Toad. I hate to give up but I did and searched threads on this forum and opened few. The very first thread I read was this one and I laughed when I read your advice. Only until the moment I tested it in the troubled workbook. It worked like a charm. I take my hat off to you Michael. I have rarely experienced such a satisfaction when solving a tricky problem during my 9-year-long Oracle Discoverer journey. This goes straight to my little text file with interesting problems and solutions.
Thank you very much. I owe you a beer or two.
It is great to have an expert like you, always ready to share his knowledge with his colleagues.
P.S.
My apologies for this massive post, I could not resist expressing my joy and gratitude.
Jozef Hlavaty -
How to create a left join view in se11??
I would like to create a view which contains KNA1,KONA,KNVV,KNVH(four tables) , I want to use this view to create a search help for Tcode 'VBO3'.
but when I join table KNVH, there is no data in view, because there is no customer hierarchy, so I want to create a left join view. could you please tell me how to create a left join view? Thank you very much.Hello,
yes, in general, maint. view and help view could be created as outer join view.
but it should obey relationship.
my fourt tables:
KONA -
> I want to get agreement number and type from this table
KNA1 -
>I want to get customer name, city, country from this table
KNVH -
>I want to get customer hierarchy from this table.
KNVV -
>I want to get customer group 1 from this table.
but in help view, I can only get relationship between KONA and KNA1.
I could not find the relationship for KNVH and KNVV.
if it's required to add a search help exit, then how to write the code in the function?
Could somebody please give me any solutions? thank you. -
Peoplesoft Query Outer join with MAX EFFDT
I have this criteria in my PS Query
where A.emplid = B.emplid
and B.effdt = (select max( B1.effdt ) from PS_TABLE_B B1 where B1.effdt <= SYSDATE )
Need to do an OUTER JOIN for B.
Ie. If no row found in B, then return blank so that row in A can be returned by query.
It's OK for A.emplid = B.emplid(+)
But how to approach for and B.effdt = (select max ... ?
Please adviseIf I remember it right, if you write outer joins using ( + ), there shouldn't be any other non-outer join criteria in your SQL, otherwise it will negate its being an 'outer join'.
so for your (1) this highlighted SQL block negates your 'outer join' condition
AND A.EMPLID = C.EMPLID(+)
AND ( C.EFFDT = (SELECT MAX( D.EFFDT)
FROM PS_D D
WHERE D.EMPLID = C.EMPLID
AND D.ACTION_REASON = 'MAT'
AND ( D.RETURN_DT IS NULL OR D.RETURN_DT > SYSDATE))
OR C.EFFDT IS NULL) )
you should see more from here http://docs.oracle.com/cd/B28359_01/server.111/b28286/queries006.htm#SQLRF52336
From that article, it says.. "If A and B are joined by multiple join conditions, then you must use the operator in all of these conditions. If you do not, then Oracle Database will return only the rows resulting from a simple join, but without a warning or error to advise you that you do not have the results of an outer join."
What I suggest, create a SQL view to replace C that retrieves exactly what C has to retrieve.. probably something like this
SELECT D.*
FROM PS_D D
WHERE D.ACTION_REASON = 'MAT'
AND( D.RETURN_DT IS NULL OR D.RETURN_DT > SYSDATE )
AND D.EFFDT = (SELECT MAX(EFFDT) ... )
and reference that new SQL view for C.. so that in your query, it should only look something like
AND A.EMPLID = C.EMPLID(+)
AND( C.EFFDT =
(SELECT MAX( D.EFFDT )
FROM PS_D D
WHERE D.EMPLID = C.EMPLID
AND D.ACTION_REASON = 'MAT'
AND( D.RETURN_DT IS NULL
OR D.RETURN_DT > SYSDATE )
OR C.EFFDT IS NULL ) )
Hope this helps -
Problems using multiple joins for search
I am new to dreamweaver and coding and I am battling to get my head around joining tables and using multiple joins to create a search result recordset.
I have a the following tables setup;
Venues table
venueID
name
category (text)
city
provinceID (numeric)
country
maxcapacity
Province table
provinceID
province (text)
Category Table
categoryID
category (text)
Max Conference Table
conferencefacilitiesID
venueID
maxcapacity
I am passing the search $_POST variables via a form and displaying it in a results page.
I have successfully done the search using only one table the problem results in using multiple joins. I cam not sure of the syntax to use but have successfully created the results page, using the outer join to link the province, category and maxcapacity to the venues table. Not all the venues have conferencing so I think need to use outer join for conferencing.
I can't seem to access the search and not sure if I can use the WHERE command to set varialbe 'category' = varCategory
Below is my code which doesn't work;
SELECT wp_dbt_venues.venuesID, wp_dbt_venues.name, wp_dbt_venues.category, wp_dbt_venues.province, wp_dbt_venues.city, wp_dbt_province.provinceID, wp_dbt_province.province, wp_dbt_conferencefacilties.venueid, wp_dbt_conferencefacilties.maxcapacity
FROM ((wp_dbt_venues LEFT OUTER JOIN wp_dbt_province ON wp_dbt_venues.province = wp_dbt_province.provinceID) LEFT OUTER JOIN wp_dbt_conferencefacilties ON wp_dbt_venues.venuesID = wp_dbt_conferencefacilties.venueid)
WHERE 'category'=varCategory
I would like to get on variable working and then expand onto the others like WHERE maxcapacity < varCapacityHi bregent
Thank you for all the help, below is the code. I have clened it up as best I could as dreamweaver seems to add recordset everytime I edit it. I then have to delete the old code. It also seems adds a totalRows variable and moves one of the runtime variables to the totalRows variable. Its all very confusing but its working.
Results Page
<?php require_once('Connections/tova.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
if (isset($_POST['delegates'])) {
$varDel_results = $_POST['delegates'];
$varProv_results = "-1";
if (isset($_POST['province'])) {
$varProv_results = $_POST['province'];
$varCat_results = "-1";
if (isset($_POST['category'])) {
$varCat_results = $_POST['category'];
mysql_select_db($database_tova, $tova);
$query_results = sprintf("SELECT wp_dbt_venues.venuesID, wp_dbt_venues.name, wp_dbt_venues.category, wp_dbt_venues.province, wp_dbt_venues.city, wp_dbt_province.provinceID, wp_dbt_province.province, wp_dbt_conferencefacilties.venueid, wp_dbt_conferencefacilties.maxcapacity FROM ((wp_dbt_venues LEFT OUTER JOIN wp_dbt_province ON wp_dbt_venues.province = wp_dbt_province.provinceID) LEFT OUTER JOIN wp_dbt_conferencefacilties ON wp_dbt_venues.venuesID = wp_dbt_conferencefacilties.venueid) WHERE wp_dbt_venues.category = %s AND wp_dbt_venues.province = %s AND wp_dbt_conferencefacilties.maxcapacity < %s", GetSQLValueString($varCat_results, "text"),GetSQLValueString($varProv_results, "int"),GetSQLValueString($varDel_results, "int"));
$results = mysql_query($query_results, $tova) or die(mysql_error());
$row_results = mysql_fetch_assoc($results);
$totalRows_results = mysql_num_rows($results);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p>Search Results</p>
<table width="200" border="1">
<tr>
<td> </td>
<td>Name</td>
<td>Category</td>
<td>City</td>
<td>Province</td>
<td>Delegates</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_results['venuesID']; ?></td>
<td><?php echo $row_results['name']; ?></td>
<td><?php echo $row_results['category']; ?></td>
<td><?php echo $row_results['city']; ?></td>
<td><?php echo $row_results['province']; ?></td>
<td><?php echo $row_results['maxcapacity']; ?></td>
</tr>
<?php } while ($row_results = mysql_fetch_assoc($results)); ?>
</table>
<p> </p>
</body>
</html>
<?php mysql_free_result($results);
?>
Search Page
<?php require_once('Connections/tova.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
mysql_select_db($database_tova, $tova);
$query_category = "SELECT category FROM wp_dbt_categories ORDER BY category ASC";
$category = mysql_query($query_category, $tova) or die(mysql_error());
$row_category = mysql_fetch_assoc($category);
$totalRows_category = mysql_num_rows($category);
mysql_select_db($database_tova, $tova);
$query_province = "SELECT * FROM wp_dbt_province ORDER BY province ASC";
$province = mysql_query($query_province, $tova) or die(mysql_error());
$row_province = mysql_fetch_assoc($province);
$totalRows_province = mysql_num_rows($province);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search</title>
</head>
<body>
<p><strong>Advanced Search</strong></p>
<form action="results.php" method="post" name="form1" target="_blank" id="form1">
<p>
<label>Category
<select name="category" id="category">
<?php
do {
?>
<option value="<?php echo $row_category['category']?>"<?php if (!(strcmp($row_category['category'], $row_category['category']))) {echo "selected=\"selected\"";} ?>><?php echo $row_category['category']?></option>
<?php
} while ($row_category = mysql_fetch_assoc($category));
$rows = mysql_num_rows($category);
if($rows > 0) {
mysql_data_seek($category, 0);
$row_category = mysql_fetch_assoc($category);
?>
</select>
</label>
</p>
<p>
<label>Province
<select name="province" id="province">
<?php
do {
?>
<option value="<?php echo $row_province['provinceID']?>"<?php if (!(strcmp($row_province['provinceID'], $row_province['provinceID']))) {echo "selected=\"selected\"";} ?>><?php echo $row_province['province']?></option>
<?php
} while ($row_province = mysql_fetch_assoc($province));
$rows = mysql_num_rows($province);
if($rows > 0) {
mysql_data_seek($province, 0);
$row_province = mysql_fetch_assoc($province);
?>
</select>
</label>
</p>
<p>
<label>Delegates
<input name="delegates" type="text" id="delegates" value="" />
</label>
</p>
<p>
<label>
<input type="checkbox" name="Facilities" value="golf" id="Facilities_0" />
Golf</label>
<br />
<label>
<input type="checkbox" name="Facilities" value="game" id="Facilities_1" />
Game</label>
<br />
</p>
<p>
<label>Search
<input type="submit" name="submit" id="submit" value="Submit" />
</label>
</p>
</form>
<p> </p>
</body>
</html>
<?php
mysql_free_result($category);
mysql_free_result($province);
?>
Maybe you are looking for
-
Error #1034 Type Coercion fail with registerClassAlias and nested Vectors
I'm attempting to use flash.net.registerClassAlias and ByteArray.writeObject in order to serialize/deserialize data with static type information. It works as you'd expect in the general case but I've run into problems with some nested Vectors that I
-
My system won't boot past POST after I plugged in my new SATA drive. (SATA noob
I have a MSI K8n Neo 2 Platinum mobo with a Athlon64 +3500 and 1gig dual channel DDR 400. I currently have 2 drives set up a IDE primary (MAxtor 6Y120) and a IDE slave (Maxtor 6L080). I recently purchased a Maxtor DiamondMax 10 6L300S0 300GB Serial
-
I am working on a Mac OS X Server, version 10.6.8 I use my Adobe applications - Indesign, PhotoShop, Illustrator, and a couple of others - primarily for school work (graphic design). I download the applications from my Adobe Application Man
-
Block return sales orders or credit notes?
Hi, Could someone please explain how I block return sales orders or credit notes? Also is there a way of searching which sales order documet types have been used for credit notes? Thanks
-
ORA-06512: at "APPS.HR_SALARY_BASIS_API", line 353
Hi there, I am trying to do data migration to Oracle HRMS using the above mentioned API and its erroring out. Any input on this? Thanks Jo