Daily Archives

Articles indexed Thursday September 6 2012

Page 7/19 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Subdomain redirect to WWW

    - by manix
    I have the domain example.com and the test.example.com running on apache server. For some reason when I try to visit test.example it is redirected to www.test.example and by consequence a Server not found error is displayed in the browser. Both .htaccess (root and subdomain folder) files are empty. Additional facts I have another subdomain xyz.example.com pointed to public_html/xyz directory with some content inside (index.html with "hello world message") and it works fine if I use xyz.example.com instead of www.xyz.example.com. So, can you help me to point to the right direction in order. I have a vps and I am able to change any file if is required. Below you can find my virtual host configuration. <VirtualHost xx.xxx.xxx:80> ServerName test.example.com ServerAlias www.test.example.com DocumentRoot /home/example/public_html/test ServerAdmin [email protected] UseCanonicalName Off CustomLog /usr/local/apache/domlogs/test.example.com combined CustomLog /usr/local/apache/domlogs/test.example.com-bytes_log "%{%s}t %I .\n%{%s}t %O ." ScriptAlias /cgi-bin/ /home/example/public_html/test/cgi-bin/ # To customize this VirtualHost use an include file at the following location # Include "/usr/local/apache/conf/userdata/std/2/example/test.example.com/*.conf" </VirtualHost>

    Read the article

  • Free online PHP hosting [closed]

    - by Anthony Newman
    Possible Duplicate: How to find web hosting that meets my requirements? I have a PHP script that can take $_GET parameters from a URL (i.e. http://www.example.com/test.php?name=george). I'd like to be able to host this script online so that others can pass parameters to it to obtain the returned data. Anyone know of a free PHP hosting site that would allow for his functionality? (PS: I can't host it myself) Thanks!

    Read the article

  • How long does it take for Google Webmasters to index site after submitting sitemap? [closed]

    - by Venkatesh Hodavdekar
    Possible Duplicate: Why isn't my website in Google search results? I have submitted my website today into Google search using Google Webmasters using sitemaps. The status on the sitemap says OK and it shows that 12 urls have been recognized. I was wondering how long does it take for the link to get indexed, as the indexed url option says "No data available. Please check back soon." I am not sure if it is showing this message due to some error, or everything is fine.

    Read the article

  • How to visually "connect" skybox edges with terrain model

    - by David
    I'm working on a simple airplane game where I use skybox cube rendered using disabled depth test. Very close to the bottom side of the skybox is my terrain model. What bothers me is that the terrain is not connected to the skybox bottom. This is not visible while the plane flies low, but as it gets some altitude, the terrain looks smaller because of the perspective. Since the skybox center is always same as the camera position, the skybox moves with the plane, but the terrain goes into the distance. Ok, I think you understand the problem. My question is how to fix it. It's an airplane game so limiting max altitude is not possible. I thought about some way to stretch terrain to always cover whole bottom side of the skybox cube, but that doesn't feel right and I don't even know how would I calculate new terrain dimensions every frame. Here are some screenshot of games where you can clearly see the problem: (oops, I cannot post images yet) darker brown is the skybox bottom here: http://i.stack.imgur.com/iMsAf.png untextured brown is the skybox bottom here: http://i.stack.imgur.com/9oZr7.png

    Read the article

  • Space invaders clone not moving properly

    - by ThePlan
    I'm trying to make a basic space invaders clone in allegro 5, I've got my game set up, basic events and such, here is the code: #include <allegro5/allegro.h> #include <allegro5/allegro_image.h> #include <allegro5/allegro_primitives.h> #include <allegro5/allegro_font.h> #include <allegro5/allegro_ttf.h> #include "Entity.h" // GLOBALS ========================================== const int width = 500; const int height = 500; const int imgsize = 3; bool key[5] = {false, false, false, false, false}; bool running = true; bool draw = true; // FUNCTIONS ======================================== void initSpaceship(Spaceship &ship); void moveSpaceshipRight(Spaceship &ship); void moveSpaceshipLeft(Spaceship &ship); void initInvader(Invader &invader); void moveInvaderRight(Invader &invader); void moveInvaderLeft(Invader &invader); void initBullet(Bullet &bullet); void fireBullet(); void doCollision(); void updateInvaders(); void drawText(); enum key_t { UP, DOWN, LEFT, RIGHT, SPACE }; enum source_t { INVADER, DEFENDER }; int main(void) { if(!al_init()) { return -1; } Spaceship ship; Invader invader; Bullet bullet; al_init_image_addon(); al_install_keyboard(); al_init_font_addon(); al_init_ttf_addon(); ALLEGRO_DISPLAY *display = al_create_display(width, height); ALLEGRO_EVENT_QUEUE *event_queue = al_create_event_queue(); ALLEGRO_TIMER *timer = al_create_timer(1.0 / 60); ALLEGRO_BITMAP *images[imgsize]; ALLEGRO_FONT *font1 = al_load_font("arial.ttf", 20, 0); al_register_event_source(event_queue, al_get_keyboard_event_source()); al_register_event_source(event_queue, al_get_display_event_source(display)); al_register_event_source(event_queue, al_get_timer_event_source(timer)); images[0] = al_load_bitmap("defender.bmp"); images[1] = al_load_bitmap("invader.bmp"); images[2] = al_load_bitmap("explosion.bmp"); al_convert_mask_to_alpha(images[0], al_map_rgb(0, 0, 0)); al_convert_mask_to_alpha(images[1], al_map_rgb(0, 0, 0)); al_convert_mask_to_alpha(images[2], al_map_rgb(0, 0, 0)); initSpaceship(ship); initBullet(bullet); initInvader(invader); al_start_timer(timer); while(running) { ALLEGRO_EVENT ev; al_wait_for_event(event_queue, &ev); if(ev.type == ALLEGRO_EVENT_TIMER) { draw = true; if(key[RIGHT] == true) moveSpaceshipRight(ship); if(key[LEFT] == true) moveSpaceshipLeft(ship); } else if(ev.type == ALLEGRO_EVENT_DISPLAY_CLOSE) running = false; else if(ev.type == ALLEGRO_EVENT_KEY_DOWN) { switch(ev.keyboard.keycode) { case ALLEGRO_KEY_ESCAPE: running = false; break; case ALLEGRO_KEY_LEFT: key[LEFT] = true; break; case ALLEGRO_KEY_RIGHT: key[RIGHT] = true; break; case ALLEGRO_KEY_SPACE: key[SPACE] = true; break; } } else if(ev.type == ALLEGRO_KEY_UP) { switch(ev.keyboard.keycode) { case ALLEGRO_KEY_LEFT: key[LEFT] = false; break; case ALLEGRO_KEY_RIGHT: key[RIGHT] = false; break; case ALLEGRO_KEY_SPACE: key[SPACE] = false; break; } } if(draw && al_is_event_queue_empty(event_queue)) { draw = false; al_draw_bitmap(images[0], ship.pos_x, ship.pos_y, 0); al_flip_display(); al_clear_to_color(al_map_rgb(0, 0, 0)); } } al_destroy_font(font1); al_destroy_event_queue(event_queue); al_destroy_timer(timer); for(int i = 0; i < imgsize; i++) al_destroy_bitmap(images[i]); al_destroy_display(display); } // FUNCTION LOGIC ====================================== void initSpaceship(Spaceship &ship) { ship.lives = 3; ship.speed = 2; ship.pos_x = width / 2; ship.pos_y = height - 20; } void initInvader(Invader &invader) { invader.health = 100; invader.count = 40; invader.speed = 0.5; invader.pos_x = 300; invader.pos_y = 300; } void initBullet(Bullet &bullet) { bullet.speed = 10; } void moveSpaceshipRight(Spaceship &ship) { ship.pos_x += ship.speed; if(ship.pos_x >= width) ship.pos_x = width-30; } void moveSpaceshipLeft(Spaceship &ship) { ship.pos_x -= ship.speed; if(ship.pos_x <= 0) ship.pos_x = 0+30; } However it's not behaving the way I want it to behave, in fact the behavior for the ship movement is un-normal. Basically I specified that the ship only moves when the right/left key is down, however the ship is moving constantly to the direction of the key pressed, it never stops although it should only move while my key is down. Even more weird behavior, when I press the opposite key the ship completely stops no matter what else I press. What's wrong with the code? Why does the ship move constantly even after I specified it only moves when a key is down?

    Read the article

  • Control convention for circular movement?

    - by Christian
    I'm currently doing a kind of training project in Unity (still a beginner). It's supposed to be somewhat like Breakout, but instead of just going left and right I want the paddle to circle around the center point. This is all fine and dandy, but the problem I have is: how do you control this with a keyboard or gamepad? For touch and mouse control I could work around the problem by letting the paddle follow the cursor/finger, but with the other control methods I'm a bit stumped. With a keyboard for example, I could either make it so that the Left arrow always moves the paddle clockwise (it starts at the bottom of the circle), or I could link it to the actual direction - meaning that if the paddle is at the bottom, it goes left and up along the circle or, if it's in the upper hemisphere, it moves left and down, both times toward the outer left point of the circle. Both feel kind of weird. With the first one, it can be counter intuitive to press Left to move the paddle right when it's in the upper area, while in the second method you'd need to constantly switch buttons to keep moving. So, long story short: is there any kind of existing standard, convention or accepted example for this type of movement and the corresponding controls? I didn't really know what to google for (control conventions for circular movement was one of the searches I tried, but it didn't give me much), and I also didn't really find anything about this on here. If there is a Question that I simply didn't see, please excuse the duplicate.

    Read the article

  • 3D Model not translating correctly (visually)

    - by ChocoMan
    In my first image, my model displays correctly: But when I move the model's position along the Z-axis (forward) I get this, yet the Y-axis doesnt change. An if I keep going, the model disappears into the ground: Any suggestions as to how I can get the model to translate properly visually? Here is how Im calling the model and the terrain in draw(): cameraPosition = new Vector3(camX, camY, camZ); // Copy any parent transforms. Matrix[] transforms = new Matrix[mShockwave.Bones.Count]; mShockwave.CopyAbsoluteBoneTransformsTo(transforms); Matrix[] ttransforms = new Matrix[terrain.Bones.Count]; terrain.CopyAbsoluteBoneTransformsTo(ttransforms); // Draw the model. A model can have multiple meshes, so loop. foreach (ModelMesh mesh in mShockwave.Meshes) { // This is where the mesh orientation is set, as well // as our camera and projection. foreach (BasicEffect effect in mesh.Effects) { effect.EnableDefaultLighting(); effect.PreferPerPixelLighting = true; effect.World = transforms[mesh.ParentBone.Index] * Matrix.CreateRotationY(modelRotation) * Matrix.CreateTranslation(modelPosition); // Looking at the model (picture shouldnt change other than rotation) effect.View = Matrix.CreateLookAt(cameraPosition, modelPosition, Vector3.Up); effect.Projection = Matrix.CreatePerspectiveFieldOfView( MathHelper.ToRadians(45.0f), aspectRatio, 1.0f, 10000.0f); effect.TextureEnabled = true; } // Draw the mesh, using the effects set above. prepare3d(); mesh.Draw(); } //Terrain test foreach (ModelMesh meshT in terrain.Meshes) { foreach (BasicEffect effect in meshT.Effects) { effect.EnableDefaultLighting(); effect.PreferPerPixelLighting = true; effect.World = ttransforms[meshT.ParentBone.Index] * Matrix.CreateRotationY(0) * Matrix.CreateTranslation(terrainPosition); // Looking at the model (picture shouldnt change other than rotation) effect.View = Matrix.CreateLookAt(cameraPosition, terrainPosition, Vector3.Up); effect.Projection = Matrix.CreatePerspectiveFieldOfView( MathHelper.ToRadians(45.0f), aspectRatio, 1.0f, 10000.0f); effect.TextureEnabled = true; } // Draw the mesh, using the effects set above. prepare3d(); meshT.Draw(); DrawText(); } base.Draw(gameTime); } Im suspecting that there may be something wrong with how I'm handling my camera. The model rotates fine on its Y-axis.

    Read the article

  • Story and news-feed ideas for social network games

    - by arpine
    I am currently working on a educational and fun 2-in-1 game. As I am not a professional, I need advice on story and news-feed. The goal is simple-get richer, the story is about a worker who is trying to get over his/her financial problems and become rich. During the whole gaming process there is a news-feed (every day there are a couple of fresh news about what is going on). The news are fresh and individual so I need to write about 2000 pieces of news for 2 year gaming, maybe more. The problem is that I am not sure whether repetitive news can interest in this game. What can be done to make the news-making process easier but not boring from the point of view of the player?

    Read the article

  • gradient coloring of an object

    - by perrakdar
    I have an object(FBX format) in my project, it's a line drawn in 3D max. I want to color the line in XNA so that the color starts from a specific RGB color in both the start and end points of the line and finish in a specific RGB color.(e.x., from (255,255,255) to (128,128,128). Something like gradient coloring of an object. I need to do that programmatically, since later in my code I have to change these two specific colors a lot.

    Read the article

  • game multiplayer service development

    - by nomad
    I'm currently working on a multiplayer game. I've looked at a number of multiplayer services(player.io, playphone, gamespy, and others) but nothing really hits the mark. They are missing features, lack platform support or cost too much. What I'm looking for is a simple poor man's version of steam or xbox live. Not the game marketplace side of those two but the multiplayer services. User accounts, profiles, presence info, friends, game stats, invites, on/offline messaging. Basically I'm looking for a unified multiplayer platform for all my games across devices. Since I can't find what I'm planning to roll my own piece by piece. I plan to save on server resources by making most of the communication p2p. Things like game data and voice chat can be handled between peers and the server keeps track of user presence and only send updates when needed or requested. I know this runs the risk of cheating but that isn't a concern right now. I plan to run this on a Amazon ec2 micro server for development then move to a small to large instance when finished. I figure user accounts would be the simplest to start with. Users can create accounts online or using in game dialog, login/out, change profile info. The user can access this info online or in game. I will need user authentication and secure communication between server and client. I figure all info will be stored in a database but I dont know how it can be stored securely and accessed from webserver and game services. I would appreciate and links to tutorials, info or advice anyone could provide to get me started. Any programming language is fine but I plan to use c# on the server and c/c++ on devices. I would like to get started right away but I'm in no hurry to get it finished just yet. If you know of a service that already fits my requirements please let me know.

    Read the article

  • Creating meaningful and engaging quests

    - by user384918
    Kill X number of monsters. Gather Y number of items (usually by killing X number of monsters). Deliver this NPC's package to this other NPC who is far far away. etc. Yeah. These quests are easy to implement, easy to complete, but also very boring after the first few times. It's kind of disingenuous to call them quests really; they're more like chores or errands. What ideas for quests have people seen that were well designed, immersive, and rewarding? What specific things did the developers do that made it so? What are some ideas you would use (or have used) to make quests more interesting?

    Read the article

  • How to manage a One-To-One and a One-To-Many of same type as unidirectional mapping?

    - by user1652438
    I'm trying to implement a model for private messages between two or more users. That means I've got two Entities: User PrivateMessage The User model shouldn't be edited, so I'm trying to set up an unidirectional relationship: @Entity (name = "User") @Table (name = "user") public class User implements Serializable { @Id String username; String password; // something like this ... } The PrivateMessage Model addresses multiple receivers and has exactly one sender. So I need something like this: @Entity (name = "PrivateMessage") @Table (name = "privateMessage") @XmlRootElement @XmlType (propOrder = {"id", "sender", "receivers", "title", "text", "date", "read"}) public class PrivateMessage implements Serializable { private static final long serialVersionUID = -9126766942868177246L; @Id @GeneratedValue private Long id; @NotNull private String title; @NotNull private String text; @NotNull @Temporal(TemporalType.TIMESTAMP) private Date date; @NotNull private boolean read; @NotNull @ElementCollection(fetch = FetchType.EAGER, targetClass = User.class) private Set<User> receivers; @NotNull @OneToOne private User sender; // and so on } The according 'privateMessage' table won't be generated and just the relationship between the PM and the many receivers is satisfied. I'm confused about this. Everytime I try to set a 'mappedBy' attribute, my IDE marks it as an error. It seems to be a problem that the User-entity isn't aware of the private message which maps it. What am I doing wrong here? I've solved some situation similar to this one, but none of those solutions will work here. Thanks in advance!

    Read the article

  • Jsch how to list files along with directories

    - by Rajeev
    In the following code when the command ls -a is executed why is that i see only the list of directories and not any files that are on a remote linux server JSch jsch = new JSch(); Session session = jsch.getSession(username1, ip1, 22); java.util.Properties config = new java.util.Properties(); config.put("StrictHostKeyChecking", "no"); session.setConfig(config); //session.setPassword(password.getText().toString()); session.setPassword(password1); session.connect(); final ListView mainlist = (ListView)findViewById(R.id.list); final RelativeLayout rl = (RelativeLayout)findViewById(R.id.rl); mainlist.setVisibility(View.VISIBLE); rl.setVisibility(View.INVISIBLE); String command = "ls -a"; Channel channel = session.openChannel("exec"); ((ChannelExec) channel).setCommand(command); channel.setInputStream(null); ((ChannelExec) channel).setErrStream(System.err); InputStream in = channel.getInputStream();

    Read the article

  • Change Keyboard input language

    - by Stack
    I am developing one android app in two different languages. When user click on "Change language" button it ask to choose language from two different languages option and change keyboard according to that language. For example : User choose "Arabic" language then keyboard input language should automatically change from English to Arabic. Please help me to resolve this issue. It's urgent for me. Thanks in advance.

    Read the article

  • Grouped UITableView's cell separator missing when setting backgroundView with an image

    - by Howard Spear
    I have a grouped UITableView with a custom UITableViewCell class and I am adding a custom background image to each cell. However, when I do this, the cell's separator is not visible. If simply switch the table style to Plain instead of Grouped, the separator is showing up. I need the grouped table - how do I make the separator show up? Here's my code: @interface MyCustomTableViewCell : UITableViewCell @end @implementation MyCustomTableViewCell // because I'm loading the cell from a xib file - (id)initWithCoder:(NSCoder *)coder { self = [super initWithCoder:coder]; if (self) { // Create a background image view. self.backgroundView = [[UIImageView alloc] init]; } return self; } // MyViewController - (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // // standard cell dequeue + create cell code here // // // Configure the cell background now // UIImage *backgroundImage = [UIImage imageNamed:@"odd_row.png"]; if (indexPath.row % 2 == 0) { backgroundImage = [UIImage imageNamed:@"even_row.png"]; } UIImageView *backgroundView = (UIImageView *)cell.backgroundView; backgroundView.image = backgroundImage; }

    Read the article

  • How to override [Authorize] attribute in the MVC Web API?

    - by NullReference
    I have a MVC Web Api Controller that uses the [Authorize] attribute at the class level. This makes all of the api methods require authorization but I'd like to create an attribute called [ApiPublic] that overrides the [Authorize] attribute. There is a similar technique described here for normal MVC controllers. I tried creating an AuthorizeAttribute based of the System.Web.Http.AuthorizeAttribute but none of the overridden events are called if I put it on a api method that has the [Authorize] at the class level. Anyone have an idea how to override the authorize for the web api? [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public class ApiPublicAttribute : AuthorizeAttribute { protected override void HandleUnauthorizedRequest(System.Web.Http.Controllers.HttpActionContext actionContext) { base.HandleUnauthorizedRequest(actionContext); } public override void OnAuthorization(System.Web.Http.Controllers.HttpActionContext actionContext) { base.OnAuthorization(actionContext); } protected override bool IsAuthorized(System.Web.Http.Controllers.HttpActionContext actionContext) { return true; } }

    Read the article

  • Jersey Rest : How to send Object to a Jersey Service class

    - by Preethi Jain
    I have this functionality in my Application implemented using Jersey Rest WebServices . Once the user is logged into the application , i am creating DTO Object and setting some User Specific Data inside it . Please let me know how can i pass this User Specific DTO Object to the Jersey Service class ?? Please note that , I dont want to use HttpSession to store Data (Because in our Application we have a facility where a User can enter with Multiple ID's in one browser as a result same sessionId will be created by the browser )

    Read the article

  • PHPFOG and MySql

    - by jim dif
    I am playing around with PHPFog and as a result I ended up with a MySql database. I am trying to figure out how to connect to it with a success message. PHPFog says use this: mysql_connect( $server = getenv('MYSQL_DB_HOST'), $username = getenv('MYSQL_USERNAME'), $password = getenv('MYSQL_PASSWORD')); mysql_select_db(getenv('MYSQL_DB_NAME')); So I basically plug my variables into the above? Or Do I do something different? Thanks, Jim

    Read the article

  • javascript window.close, once again

    - by John Kjøller
    Im sorry if I havent done my research properly, - but couldnt find the answer I needed, so here goes: From my main page I open a new window using mainPlayer = window.open(); This window stays open until user clicks on a mainPlayer.close(); event. (or simply x closes the window) However, the idea is to make it possible to let the player keep playing, while browsing around the rest of the pages. But as soon as the user leaves the page that opened the mainPlayer window, the reference to the mainPlayer window seem to be lost. How do I, from the site's other pages, check if the mainPlayer window is open and close it on a click event? Thx John

    Read the article

  • Imputing missing data in aligned sequences

    - by Kwame Oduro
    I want a simple perl script that can help me impute missing nucleotides in aligned sequences: As an example, my old_file contains the following aligned sequences: seq1 ATGTC seq2 ATGTC seq3 ATNNC seq4 NNGTN seq5 CTCTN So I now want to infer all Ns in the file and get a new file with all the Ns inferred based on the majority nucleotide at a particular position. My new_file should look like this: seq1 ATGTC seq2 ATGTC seq3 ATGTC seq4 ATGTC seq5 CTCTC A script with usage: "impute_missing_data.pl old_file new_file" or any other approach will be helpful to me. Thank you.

    Read the article

  • mvc jquery passing form values after user presses "Accept" button

    - by gdubs
    So I have a form and a submit button that posts the form to an action. But I wanted to show a popup where the user can deny or accept an agreement. Here's my jquery $(document).ready((function () { var dialog = $('#confirmation-dialog').dialog({ autoOpen: false, width: 500, height: 600, resizable: false, modal: true, buttons: { "Accept": function () { $(this).dialog('close'); $.ajax({ type: 'POST', data: {__RequestVerificationToken: $("input[name=__RequestVerificationToken]").val()} }); }, "Cancel": function () { $(this).dialog('close'); } } }); $('#registration-submit').click(function (e) { var action = $(this.form); console.log(action); var form = $('form'); dialog.dialog("open"); return false; }); })); My problem with this is that it would post, but it would only send my AntiforgeryToken, and not the values of the form. But when it goes through the TryupdateModel it would go through for some reason but will not Save (cuz of the missing data that wasn't passed on the formcollection).

    Read the article

  • Android MediaPlayer crashing app

    - by user1555863
    I have an android app with a button that plays a sound. the code for playing the sound: if (mp != null) { mp.release(); } mp = MediaPlayer.create(this, R.raw.match); mp.start(); mp is a field in the activity: public class Game extends Activity implements OnClickListener { /** Called when the activity is first created. */ //variables: MediaPlayer mp; //... The app runs ok, but after clicking the button about 200 times on the emulator, app crashed and gave me this error https://dl.dropbox.com/u/5488790/error.txt (couldn't figure how to post it here so it will appear decently) i am assuming this is because the MediaPlayer object is consuming up too much memory, but isn't mp.release() supposed to take care of this? What am i doing wrong here?

    Read the article

  • Is this syntactically correct?

    - by Borrito
    I have code in one of the source file as follows: #include <stdio.h> #include <math.h> int a ; int b = 256 ; int c = 16 ; int d = 4 ; int main() { if ((d <= (b) && (d == ( c / sizeof(a)))) { printf("%d",sizeof(a) ); } return 0; } I have removed the casts and have simplified on the data names. The sizeof(a) can be taken as 4. I want to know if the the if syntax is a valid one and if so why doesn't it execute? PS : I haven't sat down on this for long due to time constraints. Pardon me if you find a childish error in the code.

    Read the article

  • Inner or Outer left Join

    - by user1557856
    I'm having difficulty modifying a script for this situation and wondering if someone maybe able to help: I have an address table and a phone table both sharing the same column called id_number. So id_number = 2 on both tables refers to the same entity. Address and phone information used to be stored in one table (the address table) but it is now split into address and phone tables since we moved to Oracle 11g. There is a 3rd table called both_ids. This table also has an id_number column in addition to an other_ids column storing SSN and some other ids. Before the table was split into address and phone tables, I had this script: (Written in Sybase) INSERT INTO sometable_3 ( SELECT a.id_number, a.other_id, NVL(a1.addr_type_code,0) home_addr_type_code, NVL(a1.addr_status_code,0) home_addr_status_code, NVL(a1.addr_pref_ind,0) home_addr_pref_ind, NVL(a1.street1,0) home_street1, NVL(a1.street2,0) home_street2, NVL(a1.street3,0) home_street3, NVL(a1.city,0) home_city, NVL(a1.state_code,0) home_state_code, NVL(a1.zipcode,0) home_zipcode, NVL(a1.zip_suffix,0) home_zip_suffix, NVL(a1.telephone_status_code,0) home_phone_status, NVL(a1.area_code,0) home_area_code, NVL(a1.telephone_number,0) home_phone_number, NVL(a1.extension,0) home_phone_extension, NVL(a1.date_modified,'') home_date_modified FROM both_ids a, address a1 WHERE a.id_number = a1.id_number(+) AND a1.addr_type_code = 'H'); Now that we moved to Oracle 11g, the address and phone information are split. How can I modify the above script to generate the same result in Oracle 11g? Do I have to first do INNER JOIN between address and phone tables and then do a LEFT OUTER JOIN to both_ids? I tried the following and it did not work: Insert Into.. select ... FROM a1. address INNER JOIN t.Phone ON a1.id_number = t.id_number LEFT OUTER JOIN both_ids a ON a.id_number = a1.id_number WHERE a1.adrr_type_code = 'H'

    Read the article

  • How do I write this GROUP BY in mysql UNION query

    - by user1652368
    Trying to group the results of two queries together. When I run this query: SELECT pr_id, pr_sbtcode, pr_sdesc, od_quantity, od_amount FROM ( SELECT `bgProducts`.`pr_id`, `bgProducts`.`pr_sbtcode`, `bgProducts`.`pr_sdesc`, SUM(`od_quantity`) AS `od_quantity`, SUM(`od_amount`) AS `od_amount`, MIN(UNIX_TIMESTAMP(`or_date`)) AS `or_date` FROM `bgOrderMain` JOIN `bgOrderData` JOIN `bgProducts` WHERE `bgOrderMain`.`or_id` = `bgOrderData`.`or_id` AND `od_pr` = `pr_id` AND UNIX_TIMESTAMP(`or_date`) >= '1262322000' AND UNIX_TIMESTAMP(`or_date`) <= '1346990399' AND (`pr_id` = '415' OR `pr_id` = '1088') GROUP BY `bgProducts`.`pr_id` UNION SELECT `bgProducts`.`pr_id`, `bgProducts`.`pr_sbtcode`, `bgProducts`.`pr_sdesc`,SUM(`od_quantity`) AS `od_quantity`, SUM(`od_amount`) AS `od_amount`, MIN(UNIX_TIMESTAMP(`or_date`)) AS `or_date` FROM `npOrderMain` JOIN `npOrderData` JOIN `bgProducts` WHERE `npOrderMain`.`or_id` = `npOrderData`.`or_id` AND `od_pr` = `pr_id` AND UNIX_TIMESTAMP(`or_date`) >= '1262322000' AND UNIX_TIMESTAMP(`or_date`) <= '1346990399' AND (`pr_id` = '415' OR `pr_id` = '1088') GROUP BY `bgProducts`.`pr_id` ) TEMPTABLE3; it produces this result +-------+------------+--------------------------+-------------+-----------+ | pr_id | pr_sbtcode | pr_sdesc | od_quantity | od_amount +-------+------------+--------------------------+-------------+-----------+ | 415 | NP13 | Product 13 | 5 | 125 | 1088 | NPAW | Product AW | 4 | 100 | 415 | NP13 | Product 13 | 5 | 125 | 1088 | NPAW | Product AW | 2 | 50 +-------+------------+--------------------------+-------------+-----------+</pre> What I want to get a result that combines those into 2 lines: +-------+------------+--------------------------+-------------+-----------+ | pr_id | pr_sbtcode | pr_sdesc | od_quantity | od_amount +-------+------------+--------------------------+-------------+-----------+ | 415 | NP13 | Product 13 | 10 | 250 | 1088 | NPAW | Product AW | 6 | 150 +-------+------------+--------------------------+-------------+-----------+</pre> So I added GROUP BY pr_id to the end of the query: SELECT pr_id, pr_sbtcode, pr_sdesc, od_quantity, od_amount FROM ( SELECT `bgProducts`.`pr_id`, `bgProducts`.`pr_sbtcode`, `bgProducts`.`pr_sdesc`, SUM(`od_quantity`) AS `od_quantity`, SUM(`od_amount`) AS `od_amount`, MIN(UNIX_TIMESTAMP(`or_date`)) AS `or_date` FROM `bgOrderMain` JOIN `bgOrderData` JOIN `bgProducts` WHERE `bgOrderMain`.`or_id` = `bgOrderData`.`or_id` AND `od_pr` = `pr_id` AND UNIX_TIMESTAMP(`or_date`) >= '1262322000' AND UNIX_TIMESTAMP(`or_date`) <= '1346990399' AND (`pr_id` = '415' OR `pr_id` = '1088') GROUP BY `bgProducts`.`pr_id` UNION SELECT `bgProducts`.`pr_id`, `bgProducts`.`pr_sbtcode`, `bgProducts`.`pr_sdesc`,SUM(`od_quantity`) AS `od_quantity`, SUM(`od_amount`) AS `od_amount`, MIN(UNIX_TIMESTAMP(`or_date`)) AS `or_date` FROM `npOrderMain` JOIN `npOrderData` JOIN `bgProducts` WHERE `npOrderMain`.`or_id` = `npOrderData`.`or_id` AND `od_pr` = `pr_id` AND UNIX_TIMESTAMP(`or_date`) >= '1262322000' AND UNIX_TIMESTAMP(`or_date`) <= '1346990399' AND (`pr_id` = '415' OR `pr_id` = '1088') GROUP BY `bgProducts`.`pr_id` ) TEMPTABLE3 GROUP BY pr_id; But that just gives me this: +-------+------------+--------------------------+-------------+-----------+ | pr_id | pr_sbtcode | pr_sdesc | od_quantity | od_amount +-------+------------+--------------------------+-------------+-----------+ | 415 | NP13 | Product 13 | 5 | 125 | 1088 | NPAW | Product AW | 4 | 100 +-------+------------+--------------------------+-------------+-----------+ What am I missing here??

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >