Which is the best way to get data from user difine tables with condition
Hi everyone,
I would like using SBO DIAPI to get UDT data rows, there is a method of UserTable.getbykey can get one row information, but I like to get a list of rows from UDT, and the get list have its condition such as: field1="Type_A" ect.
also I want to avoid using doquery get data from DB, because there is direct access DB potential Suspect.
I am using SBO 2005 PL09 & visual studio(VB.net) 2005 and I only using DIAPI do not using UIAPI.
Thanks for any advice.
Kathy
Hi Kathy,
Unfortunately SBObob.GetObjectKeyBySingleValue only works for the B1 business objects as listed in the documentation.
So, when you don't know the keys (= Code) of the records you want to get from your UDT - there's no way around using Recordset object's DoQuery method!
Sorry,
Frank
Similar Messages
-
What is the best way to get data from a spreadsheet into an HTML table?
I am using libreoffice, and I have it set to collate all the information I enter and output it to a simple table within the program like this:
http://imageshack.us/a/img717/5144/spreadsheeta.jpg
I want to get this information after sorting it and put it into the following html table within dreamweaver:
http://imageshack.us/a/img28/8872/htmls.jpg
what is the best method for getting the info from A to B?before:
<table id="tbl-m">
<tr class="tbl-hd">
<td class="tbl-pos-width">pos</td>
<td class="tbl-team-width">team</td>
<td class="tbl-p-w-d-l-p">pld</td>
<td class="tbl-p-w-d-l-p">won</td>
<td class="tbl-p-w-d-l-p">drwn</td>
<td class="tbl-p-w-d-l-p">lost</td>
<td class="tbl-p-w-d-l-p">pts</td>
</tr>
<tr class="tbl-row-b">
<td class="tbl-pos-width">1</td>
<td class="tbl-team-width">Team Name 1</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-a">
<td class="tbl-pos-width">2</td>
<td class="tbl-team-width">Team Name 2</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-b">
<td class="tbl-pos-width">3</td>
<td class="tbl-team-width">Team Name 3</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-a">
<td class="tbl-pos-width">4</td>
<td class="tbl-team-width">Team Name 4</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-b">
<td class="tbl-pos-width">5</td>
<td class="tbl-team-width">Team Name 5</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-a">
<td class="tbl-pos-width">6</td>
<td class="tbl-team-width">Team Name 6</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-b">
<td class="tbl-pos-width">7</td>
<td class="tbl-team-width">Team Name 7</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-a">
<td class="tbl-pos-width">8</td>
<td class="tbl-team-width">Team Name 8</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-b">
<td class="tbl-pos-width">9</td>
<td class="tbl-team-width">Team Name 9</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-a">
<td class="tbl-pos-width">10</td>
<td class="tbl-team-width">Team Name 10</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-b">
<td class="tbl-pos-width">11</td>
<td class="tbl-team-width">Team Name 11</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-a">
<td class="tbl-pos-width">12</td>
<td class="tbl-team-width">Team Name 12</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-b">
<td class="tbl-pos-width">13</td>
<td class="tbl-team-width">Team Name 13</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-a">
<td class="tbl-pos-width">14</td>
<td class="tbl-team-width">Team Name 14</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-b">
<td class="tbl-pos-width">15</td>
<td class="tbl-team-width">Team Name 15</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
<tr class="tbl-row-a">
<td class="tbl-pos-width">16</td>
<td class="tbl-team-width">Team Name 16</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
<td class="tbl-p-w-d-l-p">0</td>
</tr>
</table>
after:
<table>
<tr>
<td>Pos</td>
<td>Team</td>
<td>Pld</td>
<td>Won</td>
<td>Drwn</td>
<td>Lost</td>
<td>Pts</td>
</tr>
<tr>
<td>1</td>
<td>Team 1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>2</td>
<td>Team 2</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>3</td>
<td>Team 3</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>4</td>
<td>Team 4</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>5</td>
<td>Team 5</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>6</td>
<td>Team 6</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>7</td>
<td>Team 7</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>8</td>
<td>Team 8</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>9</td>
<td>Team 9</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>10</td>
<td>Team 10</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>11</td>
<td>Team 11</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>12</td>
<td>Team 12</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>13</td>
<td>Team 13</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>14</td>
<td>Team 14</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>15</td>
<td>Team 15</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>16</td>
<td>Team 16</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
</table> -
Best way to get data from multiple table
hi
i would like to know which is the best way of getting the data in the final table from multiple read statements which are inside loop.
for exm
loop at itab.
read ....
read....
read....
read ....
data into final_itab
endloop.
thanx
manojHi.....
Say we are having two data base tables.. ZMODEL1 and ZMODEL2...
Now decalre intrenal tables and work areas and before that structures for these two and also declare one final output table for display the data...
>types: begin of ty_model1,
> za(10),
> zb type netwr,
> zc(10),
> zd(10),
> ze(10),
> zf(10),
> end of ty_model1,
> begin of ty_model2,
> za1(10),
> zb1(10),
> zc1(10),
> zd1(10),
> za(10),
> end of ty_model2,
> begin of ty_output,
> za(10),
> zb type netwr,
> zc(10),
> zd(10),
> ze(10),
> zf(10),
> za1(10),
> zb1(10),
> zc1(10),
> zd1(10),
> end of ty_output.
>
>data: t_model1 type standard table of ty_model1 initial size 0,
> t_model2 type standard table of ty_model2 initial size 0,
> t_output type standard table of ty_output initial size 0,
> w_model1 type ty_model1,
> w_model2 type ty_model2,
> w_output type ty_output.
Now in the start of selection.. event...
>select <field names in the same order as in database table> from zmodel1 into table t_model1 where za in s_comp. (s_comp is select-option for that field)>
>if sy-subrc = 0.
>select <field names in the same order as in database table> from zmodel2 into table t_model2 for all entries in t_model1 where za = >t_model1-za.
>endif.
After that now fill the final output table...
>loop at t_model1 into w_model1.
> w_output-za = w_model1-za.
> w_output-zb = w_model1-zb.
> w_output-zc = w_model1-zc.
> w_output-zd = w_model1-zd.
> w_output-ze = w_model1-ze.
> w_output-zf = w_model1-zf.
>
>read table t_model2 into w_model2 with key za = w_model1-za.
>if sy-subrc = 0.
> w_output-za1 = w_model2-za1.
> w_output-zb1 = w_model2-zb1.
> w_output-zc1 = w_model2-zc1.
> w_output-zd1 = w_model2-zd1.
>endif.
> append w_output to t_output.
> clear w_output.
> end loop.
and now display the final out table...
This is the best way..
Thanks,
Naveen.I -
How is the best way to read data from an iphone if you lost your itunes data after a crash?
How is the best way to read data from an iphone if you lost your itunes data after a crash?
How is the best way to read data from an iphone if you lost your itunes data after a crash?
-
Hi All
What could be the best way to Export data from 11.5.8 instance to 12.1.2?
Release: 11.5.8
OS: Oracle Solaris on SPARC (32-bit) verison 9
DB: 9.2.0.1
Thanks in advanceWhat kind of data you are looking to move?
Database export/import is only supported for full database export/import and the application release should be the same on the source/target nodes.
You can move the setup using iSetup or FNDLOAD.
Thanks,
Hussein -
What is the best way to get a time capsule to work with a new network name?
What is the best way to get a time capsule to work with a new network name?
Well it seems that you did not explain to us the full story. Did you change ISP's or something? Why would it not show up anymore?
What colour is the light on the time-capsule? If it's blinking amber, then you probably need to do a factory-reset. That should get it to show up again in AirPort Utility. -
What is the best way to transfer data from a PC to an iMac?
What is the best way to transfer data from a PC to an iMac?
If you know how to set up a computer-to-computer Ethernet network, then you can give that a try, but a hard drive will be faster than Ethernet unless you don't have a lot to transfer.
Mac OS X 10.6 Help- Creating a computer-to-computer network -
What is the best way to get data to a user interface?
Hi,
I'm using labview 6i. I have an application with a handful of "core" vi's that actually run my application, doing the data acquisition, analysis, and control. I am currently using these same vi's for my user interface. I also have a number of vi's that contain menu's for configuring the "core" vi's. My questions is, what is the best way to seperate the "core" vi's from the user interface vi's. Global's, data socket, control references, others?
Thanks for the help.Hi Sal,
I have been a strong advocate of control refnums ever since LV 6i hit the streets. I recomend you look into using them to provide this conectivity.
You could accomplish this by using a variation on the following.
In your UI, create refnums for each of the controls or indicators that must be monitored or updated. Pass the appropriate refnums to each of the "core.i's" at program init time. Inside each of the core.vi's, use property nodes to read the control's values when appropriate and similarly for display purposes. (Note: Not all boolean mechanical actions are compatible with this technique. In those case you will have to explicitly write false values after find the control to be true or vise versa).
By using this technique, you can keep the UI diagrams clea
n. Depending on your app. the UI diagram could consist of the init's I mentioned above, and a while loop that watches if it's time to exit.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
I have a 13" MBP Mid-2009 model, upgrading to a 15" MBP Late-2011 model. Both are on Lion OS 10.7.3. I use Time Machine to back up the old machine. If I use Migration Assistant, is a recovery from the Time Machine Backup taken on the 13" MBP over to the 15" MBP the best way to bring over all of the Apps and Data? I know that the 13" has different HW drivers, so am unsure if the recovery will overwrite these drivers on the new 15" MBP. Just trying to make sure that I do not mess up the new system, but have not been able to find out if Time Machine will preserve the critical OS files during the recovery.
Thanks all!Some suggest you use Setup Assistant when you first turn the new MBP on.
I have never used it to transfer any data from one computer to another, from Mac or PC to new Mac.
I simply don't trust it, never had on any platform.
I find it easier for me to just network computers together and copy data over. That way only the data I want is copied to the new computer. I can make all the interface changes myself.
Oh as eww says do NOT use a TM backup from the older Mac to move data over to the new one. You could possibly be looking at reinstalling the OS on the new unit. -
What is the best way to save data from GPIB Device in a file?
HI!
I have a Keithley SourceMeter and want to save readings in a File along with settings on the front panel and timestamps plus several other infos. What is the best way to do this? Which file type? Any recommendations or hints could help me?
ThanksHi Andy,
There are 3 main file formats that you can consider writing your data out to in LabVIEW:
ASCII
Binary
Datalog
ASCII
ASCII files are useful because every operating system and almost every application can read/write ASCII format files. Use ASCII files when:
Other users or applications will need to access the data file.
You will not need to perform random access file I/O
File I/O speed is not crucial
Disk space is not crucial
Examples within LabVIEW Example Finder: Fundamentals >> File Input and Output >> Write to Text File.vi and Read from Text File.vi
Binary
Binary byte stream files are more specific to data storage and retrieval. Use b
inary files when:
File I/O will remain in LabVIEW only -- no other applications will be needing to write/read that file. There is no standard formatting for binary files and thus other applications or operating systems may be unable to read the file.
Files are smaller than ASCII files
Easier and faster random access to data
Examples within LabVIEW Example Finder: Fundamentals >> File Input and Output >> Write Binary File.vi and Read Binary File.vi
Datalog
When to use datalog:
If you need to record data with a mixture of types, it can be cumbersome to convert everything to ASCII or to keep track of the binary formatting.
Datalog format is binary and internal to LabVIEW, so again only use this format if no other applications or operating systems will be needing to perform file I/O on the file.
Examples within LabVIEW Example Finder: Fundamentals >> File Input and Output >> Write Datalog File
Example.vi and Read Datalog File Example.vi
Good luck!
Kileen C.
Applications Engineer
National Instruments -
What is the best way to get PATHS from one Photoshop psd file to another?
Hi! New on the site, and I signed up specifically to ask the best way to import one .psd file into another, including the paths on the paths palette.
Almost all of my Photoshop drawings make heavy use of vector paths, which I then stroke using using PS natural-media brushes and the "stroke paths" function (usually with "simulate pressure" checked.) Also, my .psd files tend to be, um, HUGE... and I typically break up a whole drawing into separate PS files and then assemble all of them into one final finished graphic.
I have no trouble moving raster stuff from file to file. Just put all the layers I want to transfer into a group and drag the group to the other .psd. Works fine, including layer masks. But I have not found a good way to get vector paths from the Paths palette of one .psd to another. Of course I can select paths and copy them to the Win clipboard, switch to the other .psd, and paste them back in. The drawback to that method is that I lose the correct size relation between the results of previously done "stroke paths" operations (on raster layers) and the paths that generated them. Sometimes the copied-in paths are way too large, sometimes way too small, never Just Right.
As I'm sure most of you know, if you resize an entire Photoshop document from within PS, any paths it contains are correctly resized along with everything else. That's no longer true after grouped raster layers are dragged over to another document but paths are copied and pasted in. The size connection is lost. (Location placement, too.)
I WANT those paths! After I bring a piece of a drawing into the full final drawing, what looked good when I was working on it separately often doesn't look right any longer and I want to re-stroke those paths using different brush diameter, opacity, etc., or maybe even a completely different brush.
I've tried bring outside .psd files in as smart objects with the Place command but either that doesn't work or I'm not doing it right. Using Place, the paths in the Placed document don't come in at all.
I'll be very grateful for any hints or strategies any of you knowledgeable folks can give me. Thanks very much!
Jim
Note, PS CS3 extended on Win 7 pro.Denny
1. Connect the two macs - firewire, ethernet, sneakernet as suits you - and copy the iPhoto Library Folder from Old Machine to New Machine. Drag it from Home/Pictures to the same location on the new machine.
2. Because all the files 'belong' to the account on the old machine, you have to update the file permissions: hence Download BatchMod from
http://macchampion.com/arbysoft/
And apply it to the iPhoto Library Folder using the settings found here:
http://homepage.mac.com/toad.hall/.Pictures/Forum/BatChmod.png
(Credit to Old Toad for this one).
Note: This must be run on the new machine after copying the files over.
3. Then launch iPhoto on the new machine.
Regards
TD -
Best way To get data from another application using NDDE lbrary
My vb.net application gets data from another application using NDDE Library. I got stocks prices (open,high,low,close,volume,change......(about 15 records for each stock)) (about 200 stocks) . I don't know if there is a problem in my code.
This is my code:
l : is the list of stocks.
This Sub connects to server and requests the data :
Public Shared Sub GetQuotes()
Try
client1 = New DdeClient(server, topic)
client1.Connect()
For i As Integer = 0 To l.Count - 1
client1.StartAdvise("QO." & l(i).t & ".TAD$last", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$open", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$high", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$low", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$pclose", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$volume", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$date", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$time", 1, True, 60000)
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
and then I get the data from Client_advise sub (called each time a value changed )and fill the list. What I know is that client advise gets only one record for single stock each time is called..
Example: for stock AAPL. 1st time enters client_Advise I get open price for AAPL, 2nd time I get high price for AAPL,3rd time I get low price..... and I update the value in the List (l)
This the client_Advise Sub:
Private Shared Sub client1_Advise(ByVal sender As Object, ByVal e As NDde.Client.DdeAdviseEventArgs) Handles client1.Advise
For q As Integer = 0 To l.Count - 1
If l(q).t = w(1) Then
Dim item() As String = e.Item.Split("$")
If l(q).Open = "#" Then
l(q).Open = "0"
End If
If l(q).hi = "#" Then
l(q).hi = "0"
End If
If l(q).lo = "#" Then
l(q).lo = "0"
End If
If l(q).Close = "" Or l(q).Close = "#" Then
l(q).Close = "0"
End If
If l(q).pclose = "#" Then
l(q).pclose = "0"
End If
If item(1) = "open" Then
l(q).Open = Format(Val(e.Text), "0.00")
ElseIf item(1) = "last" Then
l(q).Close = Format(Val(e.Text), "0.00")
ElseIf item(1) = "high" Then
l(q).hi = Format(Val(e.Text), "0.00")
ElseIf item(1) = "volume" Then
l(q).Volume = Val(e.Text)
ElseIf item(1) = "low" Then
l(q).lo = Format(Val(e.Text), "0.00")
ElseIf item(1) = "pclose" Then
l(q).pclose = Format(Val(e.Text), "0.00")
If l(q).pclose <> "" And l(q).pclose <> "#" And l(q).Close <> "" And l(q).Close <> "#" Then
l(q).c = Format(l(q).Close - l(q).pclose, "0.00")
l(q).cp = Format(((l(q).Close - l(q).pclose) / l(q).pclose) * 100, "0.00")
End If
l(q).flag1 = 2
ElseIf item(1) = "date" Then
l(q).Date1 = e.Text
ElseIf item(1) = "time" Then
l(q).Time = e.Text
End If
Exit For
End If
Next
End Sub
Am I doing something wrong which inreases CPU usage to 80 or 90 % ?
Thanks in advance.Hi MikeHammadi,
According to your description, you'd like to get data from another app using NDDE library.
When using the NDDE library, the CPU usage is high. As the NDDE library is third-party library, it is not supported here. I suggest you checking if the problem is caused by the NDDE library.
If you'd like to get data from another app. I suggest you could save the data in the dataBase, and then read it in another application if necessary.
If you have any other concern regarding this issue, please feel free to let me know.
Best regards,
Youjun Tang
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
The best way to extract data from MySQL
I have a MySQL db that contains information about whether respondents are coming to an airshow, what days they plan to attend and how will they travel (www.hollisterairshow.com/helpusplan.php . I can export data from this to a spreadsheet as the summary info will only be seen by the organizers but ideally I'd like to create a page that will summarize responses. Something like this:
Saturday
Autos: xxxxx Occupants: yyyyyy
Aircraft: xxxxx Occupants: yyyyyy
Other: xxxxx Occupants: yyyyyy
Sunday
Autos: xxxxx Occupants: yyyyy
Aircraft: xxxxx Occupants: yyyyy
Other: xxxxx Occupants: yyyyy
Camping: xxxxx Occupants: yyyyy
How did you hear about the Airshow:
Radio: xxx TV: xxx Newspaper: xxx Magazine: xxx Internet: xxx Other: xxx
I thought I would create a couple of recordsets, one for respondents who will attend on Saturday and the other for respondents who will attend on Sunday then all I'd need to do is count the number of respondents and sum the number of occupants for each recordset, and count/ sum campers for the whole file and similarly for the "how did you hear about it" question. Is this the best way or am I missing a more elegant solution?
Thanks,
TonyThe page I'm trying to create is here www.hollisterairshow.com/plan-results.php and the questionnaire is here www.hollisterairshow.com/helpusplan.php .
I went ahead and created recordsets using advanced recordsets and these seem to be working, here's a sample SQL
SELECT *
FROM plan
WHERE Saturday = 'Saturday' AND plan.howArriving = 'Auto'
I created a recordset for each combination of day and transportation mode - six in all
This selected the correct records.
To display the count of how many records selected I then used in DW Insert/Data Objects/ Display Record Count/Total Records which generated the following code:
<?php echo $totalRows_rsSatAuto ?>
This worked OK - not elegant but OK and I repeated it for each combination of Day and Transportation mode!!
So there are two problems I'm having:
I know I can select the records I want but how do I display the sum of the column containing "How many in your party" - i.e. in the PHP code generated above what do I replace $totalRows_rsSatAuto with?
There are two questions using radio buttons where I'd like to display the count and % for each option selected. I can select all records for these questions but what code do I put to sum the number of selections for each option and what code do I put to calculate the percentage
I understand the arithmetic involved which is pretty simple but it's the mechanics of coding that has me stumped. It would really help if you could give me a sample for say the "Are you camping overnight" question which has a "Yes/No" option only. In my mundane way I would create two recordsets, one for "Yes" and one for "No", and use the same technique I describe above for counting Total Records in each recordset, but then I'm stuck with how do I calculate and display the percentages. I must be missing something very obvious as I'm sure there just has to be a more elegant solution.
Thanks so much for your continued interest.
Tony -
How is the best way to send data from local database into remote database ?
Hi all,
I need to send data from local Oracle database into remote oracle database. Both sites connected via 128 kbps frame relay connection.
The sending need to be done once a week, can be done nightly.
How is the best way to do this ?
Thank you very much,
xtantoHow is the best way to do this ?How much are you planning to send?
You can use COPY command. Ensure that you have valid database link between two databases.
Available options are:
create - creates a new table. errors out if the destination table exists.
replace - drop the destination table and re-creates with data.
insert - inserts data if the destination table exists.
append– appends data into an existing table.
use set arraysize 5000 -The arraysize specifies the number of rows that SQL*Plus will retrieve from the database at one time.
copy from scott/tiger@ORCL to scott/tiger@ORCL92 create new_emp using select * from emp; -
What is the best way to append data from one field to another?
I have the following table, table1:
Name Null? Type
MAIL_ID NOT NULL NUMBER(10)
LAST_NAME VARCHAR2(45)
FIRST_NAME VARCHAR2(45)
MIDDLE_INITIAL VARCHAR2(1)
ADDRESS_1 VARCHAR2(45)
CITY VARCHAR2(35)
STATE VARCHAR2(2)
ZIP VARCHAR2(10)
REMARKS VARCHAR2(200)
The table has duplicate entries that need to be removed. The records that will be removed need the
data in the Remarks column appended to the Remarks data of the record that is not deleted.
For example, the following listing shows a sample of the duplicate records.
Mail ID Last Name First Name M Address City St ZIP Remarks
189 BROWN STEPHEN 6706 MOESER LN EL CERRITO CA 94530-2909 Sf7#s124,f16#d7996(NML)[Cl#117][Ml#1649][NMf1#d288][NCf9#d319][SNl#e62]
211023 BROWN STEPHEN B 6706 MOESER LN EL CERRITO CA 94530 RLl#a12047[IDl#i398]
287796 BROWN STEPHEN B 6706 MOESER LN EL CERRITO CA 94530 SNl#e1163
The following listing shows how the kept record should appear after the duplicate records are deleted.
Mail ID Last Name First Name M Address City St ZIP Remarks
189 BROWN STEPHEN 6706 MOESER LN EL CERRITO CA 94530-2909 Sf7#s124,f16#d7996(NML)[Cl#117][Ml#1649][NMf1#d288][NCf9#d319][SNl#e62]RLl#a12047[IDl#i398]SNl#e1163
I have the process of deleting duplicates working but have yet to determine the best way to move
the Remarks data from the deleted records to the preserved record.
I know there are probably various ways to approach this.
Any suggestions will be greatly appreciated!
Here is the sql for deleting duplicates.
DELETE FROM table1
WHERE mail_id in (SELECT mail_id FROM table1
where not first_name = 'Null' and
not last_name = 'Null' and
not city = 'Null' and
not state = 'Null'and
not last_name = 'Anon'
minus
select min(mail_id) from table1
group by first_name, last_name, city, state, address_1, organization, title);
THANKS in advance!!!!Here's quick and dirty example probably a better way to do it, but this is what I came up with quickly.
My table looks like this:
MAIL_ID LAST FIRST PHONE REMARKS
123 Ruff Shawn 555-555-5555 Called 10-10-04
135 Ruff Shawn 555-555-5555 Called 10-12-04
201 Ruff Shawn 555-555-5555 Called 10-19-04
The code below will concatenate the remarks column from the rows, and delete the 135 and 201 rows, then update the 123 row with the concatenated remarks.
declare
l_remarks varchar2(500);
l_min_mail_id number;
begin
select min(mail_id) into l_min_mail_id
from test
group by last, first, phone;
select remarks into l_remarks from test where mail_id = l_min_mail_id;
for i in (select mail_id, remarks from test
where last = 'Ruff'
and first = 'Shawn'
and phone = '555-555-5555'
and mail_id <> l_min_mail_id)
loop
l_remarks := l_remarks||','||i.remarks;
delete from test where mail_id = i.mail_id;
end loop;
update test set remarks = l_remarks where mail_id = l_min_mail_id;
commit;
end;
Hope this helps.
Maybe you are looking for
-
Shattered iPod Touch 4g can't connect to iTunes - locked with passcode?
Okay, so I have an iPod Touch that was run over by a van and the digitizer is entirely shattered - pieces are falling off and part of the underneath is exposed. The LCD is also non-functional - I only get white (assuming this is just the backlight).
-
When i try to log in to icloud on my windows 7 it says 'you cant sign in because of a server error'
When i try to log in to icloud on my windows 7 it says 'you cant sign in because of a server error'
-
Hi I have a scenario in which i will read mail from a mailbox and forward it to another mailbox. I have done this. But the problem is with the PDF attachment. I can read a text file as attachment and sent to another mailbox as attchment. But i cannot
-
Manage MSMQ is missing from Failover Cluster Manager when configured using powershell
Hi, I am hoping someone would be able to help me as I have looked on the internet for an answer to this. We deploy a number of servers that are configured using Powershell. I am in the process of creating a clustered WIN2K8R2 cluster with MSMQ. I am
-
Acobat quits right after a file is opened
I just update from 10.3.9 to 10.4.7 - when I open a file in acrobat the app quits. I'm able to open the program, but the minute I open a file the app shuts down with no error message. I did the usual stuff repaired permissions and reinstall the app-