Declare table, insert into table, select distinct

I have a table-valued function where there are multiple tables being declared and finally joined together to create the final table with data from each table. I had a problem with duplicates so I created a new table @ORDERHEADER so select the distinct values and then insert it into the the table and eventually the final table. When I run the select distinct by itself, it populates correctly but when I run it with the insert nothing populates.

Below is the code I am currently working with (I kept the commented out lines for you to see what I have tried — above the first “–LEFT OUTER JOIN” is my working code).

DECLARE @ORDERHEADER TABLE(     [DIV_CD] [varchar](8) NULL,     [SALES_ORD_NR] [varchar](8) NOT NULL,     [CUST_EDP_ID] [decimal](28,0) NOT NULL,     [OFFER_CD] [varchar] (8) NULL)      INSERT INTO @ORDERHEADER     SELECT DISTINCT(SV_OR_1000_ORDER_HEADER.SALES_ORD_NR),  SV_OR_1000_ORDER_HEADER.DIV_CD, SV_OR_1000_ORDER_HEADER.CUST_EDP_ID,  SV_OR_1000_ORDER_HEADER.OFFER_CD     from SV_OR_1000_ORDER_HEADER     --join @RETURNS r on SV_OR_1000_ORDER_HEADER.SALES_ORD_NR =  r.SALES_ORD_NR                 --LEFT OUTER JOIN  OPENQUERY(CH1KNOWAPP,'SELECT DISTINCT SALES_ORD_NR FROM  EmailVPN..EB_RETURN_CONFIRMATION_NEW WITH(NOLOCK) WHERE  ORD_ITM_STA_LGCY_CD IN (''R'',''E'',''4'')') as RET_EMAILS on  RET_EMAILS.SALES_ORD_NR COLLATE SQL_Latin1_General_CP1_CI_AS =  SV_OR_1000_ORDER_HEADER.SALES_ORD_NR     --join @RETURNS r on SV_OR_1000_ORDER_HEADER.SALES_ORD_NR =  r.SALES_ORD_NR      --join SV_MACORD_RETURNS on  SV_OR_1000_ORDER_HEADER.SALES_ORD_NR = SV_MACORD_RETURNS.SALES_ORD_NR     -- where exists (SELECT DISTINCT * from  SV_OR_1000_ORDER_HEADER)-- exists (select * from SV_OR_1000_ORDER_HEADER  join SV_MACORD_RETURNS on SV_OR_1000_ORDER_HEADER.SALES_ORD_NR =  SV_MACORD_RETURNS.SALES_ORD_NR)      --where SV_OR_1000_ORDER_HEADER.SALES_ORD_NR is not null     --where  SV_OR_1000_ORDER_HEADER.OFFER_CD not in ('36')      where SV_OR_1000_ORDER_HEADER.SALES_ORD_NR = 'W3151536'     --group by SV_MACORD_RETURNS.SALES_ORD_NR,  SV_MACORD_RETURNS.DIVISION, SV_OR_1000_ORDER_HEADER.CUST_EDP_ID, SV_MACORD_RETURNS.OFFER_CD     --having COUNT(SV_OR_1000_ORDER_HEADER.SRC_SYS_TRANS_DT) < 2 

Insert data into the database with FullCalendar and Python/Django

I’m having trouble inserting, editing, and deleting event data with FullCalendar in a web app I’m developing

I would like everything to work on the same screen, that is, when the user selects dates in the calendar, the modal appears to insert the values (title and dates), when you click on an event, the modal to edit the event appears and a button to remove it.

So far what I could do was the following:

<script>  $  (document).ready(function () {      $  ('#calendar').fullCalendar({         header: {             left: 'prev,next today',             center: 'title',             right: 'month,agendaWeek,agendaDay'         },         navLinks: true,         editable: true,         eventLimit: true,         selectable: true,         selectHelper: true,         select: function (start, end) {             $  ('#cadastrar #start').val(moment(start).format('DD/MM/YYYY HH:mm:ss'));             $  ('#cadastrar #end').val(moment(end).format('DD/MM/YYYY HH:mm:ss'));             $  ('#cadastrar').modal('show');         },     });  });  <script> 

In template (agenda/agenda.html) I did it, which corresponds to the schedule and the modal that is opened when any date in the calendar is selected.

 <section class="content">      <div id='calendar'></div>      <div class="modal fade" id="cadastrar" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"          data-backdrop="static">         <div class="modal-dialog" role="document">             <div class="modal-content">                 <div class="modal-header">                     <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span                             aria-hidden="true">&times;</span></button>                     <h4 class="modal-title text-center">Cadastrar Evento</h4>                 </div>                 <div class="modal-body">                     <form role="form" action="" method="post">                         {% csrf_token %}                           <div class="form-group">                               {{form.event_name}}                           </div>                           <div class="form-group">                               {{form.start_date}}                           </div>                           <div class="form-group">                               {{form.end_date}}                           </div>                           <div class="form-group">                               {{form.event_type}}                           </div>                     </form>                 </div>             </div>         </div>     </div> </section> 

In models.py created the following

class Event(models.Model):     event_name = models.CharField(max_length=255, null=True, blank=True)     start_date = models.DateTimeField(null=True, blank=True)     end_date = models.DateTimeField(null=True, blank=True)     event_type = models.CharField(max_length=10, null=True, blank=True)      def __str__(self):         return self.event_name  

views

 class AddEventView(CustomCreateView):     form_class = EventForm     template_name = "agenda/agenda.html"     permission_codename = 'add_event'      def get_context_data(self, **kwargs):         context = super(AddEventView, self).get_context_data(**kwargs)         return context      def get(self, request, *args, **kwargs):         return super(AddEventView, self).get(request, *args, **kwargs)      def post(self, request, *args, **kwargs):         self.object = None         form_class = self.get_form_class()         form = self.get_form(form_class)          if form.is_valid():             self.object = form.save(commit=False)             self.object.save()             return self.form_valid(form)          return self.form_invalid(form)  class EventsListView(CustomListView):     template_name = 'agenda/agenda.html'     model = Event     context_object_name = 'all_eventos'     permission_codename = 'view_eventos'      def get_context_data(self, **kwargs):         context = super(EventosListView, self).get_context_data(**kwargs)         return context   class EditEventView(CustomUpdateView):     form_class = EventForm     model = Event     template_name = "agenda/agenda.html"     permission_codename = 'change_event'      def get_success_message(self, cleaned_data):      def get_context_data(self, **kwargs):         context = super(EditEventView, self).get_context_data(**kwargs)         return context      def post(self, request, *args, **kwargs):         self.object = self.get_object()         form_class = self.get_form_class()         form = form_class(request.POST, instance=self.object)          if form.is_valid():             self.object = form.save()             return self.form_valid(form)          return self.form_invalid(form)  

urls

   url(r'agenda/add/$  ',         views.AddEventView.as_view(), name='addeventoview'),      url(r'agenda/$  ',         views.EventsListView.as_view(), name='listeventsview'),      url(r'agenda/edit/(?P<pk>[0-9]+)/$  ',         views.EditEventView.as_view(), name='editeventview'),  

How do I call modal so that I can register, edit, and delete events? So far the modal opens, but no information appears. The problem certainly is in the view, but how do I make it Create, Edit and Delete on the same page and in the same modal?

Cannot able to curl into service by using cluster-ip from a different pod , facing connection timed out with exit code 7

In the Minikube , I created a pod with the configuration provided below

kind: Pod metadata:   name: node-js-pod spec:   containers:   - name: node-js-pod     image: bitnami/apache:latest     ports:      - containerPort: 8080  

then i created a service of type cluster-ip with configuration provided below

kind: Service metadata:    name: node-js-internal    labels:      name: node-js-internal spec:   ports:   - port: 8081   selector:     name: node-js 

After creating the service i checked the cluster ip of service using command: kubectl get services -l name=node-js-internal which gave output as:

NAME               TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE node-js-internal   ClusterIP   10.106.71.114   <none>        8081/TCP   18m 

Once I created this service i tried to access this service internally from node-js-pod using command: kubectl exec node-js-pod -- curl 10.106.71.114:8081 Which gave error message as curl 7 connection timed out :

$   kubectl exec node-js-pod -- curl 10.106.71.114:8081   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  Dload  Upload   Total   Spent    Left  Speed   0     0    0     0    0     0      0      0 --:--:--  0:02:10 --:--:--     0curl: (7) Failed to connect to 10.106.71.114 port 8081: Connection timed out command terminated with exit code 7 

How to connect to the node-js-internal service from pod node-js in minikube?

New affiliate programs have been added into Nifty Stats

Dear users,

We are constantly adding new affiliate programs to Nifty Stats, this month so far:

Hooligapps (Affise), Moneyplatform.biz, OG Affiliate, Fansbet Affiliates, Mundi Affiliates, Montecryptos, 5K Bucks, Paradise Casino, Live Cam Revenue, Easy Come Cash, Carnal Cash, Girls Rimming, Turbo Vegas, Swing Life Style Affiliates, Hill Affiliates, Aztec Bingo, Wishmaker Partners, Wetten Partners, Wir Wetten Affiliates, Coinbet24, Bet n1, Jackpot…

New affiliate programs have been added into Nifty Stats

Kubuntu Keyboard layout stuck into CZ_german no english layout after update, restore into original EN_us and EL_Gr ones

After Update on Kubuntu 16.04LTS the keyboard layout has changed into CZ_german without any english layout. Thus I want to restore it into US,GR variant.

Due to unexpected keyboard layout change I find it hard to login either via shell or Xorg. Thus the only option is to use either the recovery mode or a live USB.

Thus how I can revocer the keyboard layout into English and Greek one?

Does a sentient weapon polymorphed into a creature retain the sentience’s personality/alignment?

Consider the spell true polymorph. If you turn a creature into a creature, the new creature

retains its alignment and personality.

If you turn an object into a creature

The creature is friendly to you and your companions.

An object typically has neither personality nor alignment, so that isn’t normally an issue.

However, a sentient weapon is an object (per Sage Advice), and does have personality and alignment.

If you cast true polymorph to turn a sentient, neutral evil greatsword into a creature, does the creature retain the sword’s alignment and personality?

Which could imply that it is not friendly.

Lenovo G560 F1/F2/F12 won’t let me get into BIOS

Lenovo G560

I’ve replaced the HDD after it died to an SSD, it won’t let me boot from anything, not to mention it won’t let me get into BIOS. From all I found on google they suggested hitting F1/F2/F12/Delete (even tried the F keys with FN) nothing happens it goes into PXE, exits it and says no device.

I am clueless as to what to do with this laptop, it won’t boot to anything, although placing he dead HDD back in showed that it can’t “talk” to it and gave an error.

How to unite several .apks into one?

I’m making a quiz app for Android using MIT App Inventor. It limits the maximum size of an .apk to 10 Mb, so it is not possible to add more content into game. However, it’s possible to launch another App Inventor app inside the other app, and I used this feature. So now I have 5 several applications, each of them is run from the main application. Having 5 several applications is not nice, so I thought they can be United into one big application in some way. The developer is the same, so this won’t be a problem. Are there any solutions that could do this? Thank you in advance.